Commit e4e9da59 authored by Yue Zhang's avatar Yue Zhang Committed by Commit Bot

Reland "[ntp][modules] Disable dummy modules in NTP for official build"

This reverts commit 4e791c49.

Reason for revert: Try to fix the failed test.

Original change's description:
> Revert "[ntp][modules] Disable dummy modules in NTP for official build"
> 
> This reverts commit a099d2db.
> 
> Reason for revert: NewTabPageModulesDummyModuleTest.All failing. bot failures on linux-chromeos-chrome: https://ci.chromium.org/p/chrome/builders/ci/linux-chromeos-chrome
> 
> First failure: https://ci.chromium.org/p/chrome/builders/ci/linux-chromeos-chrome/8711
> 
> Original change's description:
> > [ntp][modules] Disable dummy modules in NTP for official build
> >
> > Bug: 1130814
> > Change-Id: If8d93fb7c134637f399735637ff031abbe31ebc2
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2411671
> > Reviewed-by: Esmael Elmoslimany <aee@chromium.org>
> > Reviewed-by: Tibor Goldschwendt <tiborg@chromium.org>
> > Commit-Queue: Yue Zhang <yuezhanggg@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#809463}
> 
> TBR=tiborg@chromium.org,aee@chromium.org,yuezhanggg@chromium.org
> 
> Change-Id: I4537af0a34a5cc61a1f7b228a5047127862e2a0f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1130814
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2425207
> Reviewed-by: Darwin Huang <huangdarwin@chromium.org>
> Commit-Queue: Darwin Huang <huangdarwin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#809564}

TBR=tiborg@chromium.org,aee@chromium.org,huangdarwin@chromium.org,yuezhanggg@chromium.org

# Not skipping CQ checks because this is a reland.

Bug: 1130814
Change-Id: I401cc73cd1af0cf9d2329cb97583e6f40c4c6a09
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2427183Reviewed-by: default avatarYue Zhang <yuezhanggg@chromium.org>
Reviewed-by: default avatarDarwin Huang <huangdarwin@chromium.org>
Reviewed-by: default avatarTibor Goldschwendt <tiborg@chromium.org>
Reviewed-by: default avatarEsmael Elmoslimany <aee@chromium.org>
Commit-Queue: Yue Zhang <yuezhanggg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810401}
parent dd9dfe99
......@@ -234,7 +234,7 @@ if (!is_android) {
"root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir),
]
defines = chrome_grit_defines
defines = chrome_grit_defines + [ "is_official_build=$is_official_build" ]
outputs = [
"grit/new_tab_page_resources.h",
"grit/new_tab_page_resources_map.cc",
......
......@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//chrome/browser/resources/optimize_webui.gni")
import("//chrome/common/features.gni")
import("//third_party/closure_compiler/compile_js.gni")
import("//tools/grit/grit_rule.gni")
import("//tools/polymer/html_to_js.gni")
......@@ -277,6 +278,7 @@ if (optimize_webui) {
"root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir),
]
defines = chrome_grit_defines + [ "is_official_build=$is_official_build" ]
outputs = [
"grit/new_tab_page_resources.h",
"grit/new_tab_page_resources_map.cc",
......
......@@ -8,7 +8,9 @@
import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
// <if expr="not is_official_build">
import {dummyDescriptor, dummyDescriptor2} from './dummy/module.js';
// </if>
import {kaleidoscopeDescriptor} from './kaleidoscope/module.js';
import {ModuleDescriptor} from './module_descriptor.js';
import {ModuleRegistry} from './module_registry.js';
......@@ -20,7 +22,9 @@ if (loadTimeData.getBoolean('kaleidoscopeModuleEnabled')) {
descriptors.push(kaleidoscopeDescriptor);
}
// <if expr="not is_official_build">
descriptors.push(dummyDescriptor);
descriptors.push(dummyDescriptor2);
// </if>
ModuleRegistry.getInstance().registerModules(descriptors);
<?xml version="1.0" encoding="UTF-8"?>
<grit-part>
<if expr="not is_official_build">
<include name="IDR_NEW_TAB_PAGE_MODULES_DUMMY_MODULE_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/modules/dummy/module.js"
use_base_dir="false" type="BINDATA" compress="false" />
</if>
<include name="IDR_NEW_TAB_PAGE_MODULES_KALEIDOSCOPE_MODULE_JS"
file="modules/kaleidoscope/module.js"
type="BINDATA" compress="false" />
<include name="IDR_NEW_TAB_PAGE_MODULES_MODULE_DESCRIPTOR_JS"
file="modules/module_descriptor.js" type="BINDATA" compress="false" />
<include name="IDR_NEW_TAB_PAGE_MODULES_MODULES_JS"
file="modules/modules.js" type="BINDATA" compress="false" />
file="modules/modules.js" type="BINDATA" compress="false" preprocess="true"/>
<include name="IDR_NEW_TAB_PAGE_MODULES_MODULE_REGISTRY_JS"
file="modules/module_registry.js" type="BINDATA" compress="false" />
<include name="IDR_NEW_TAB_PAGE_MODULE_WRAPPER_JS"
......
......@@ -16,7 +16,9 @@ export {BackgroundManager} from './background_manager.js';
export {BrowserProxy} from './browser_proxy.js';
export {BackgroundSelectionType} from './customize_dialog.js';
export {ImgElement} from './img.js';
// <if expr="not is_official_build">
export {dummyDescriptor} from './modules/dummy/module.js';
// </if>
export {kaleidoscopeDescriptor} from './modules/kaleidoscope/module.js';
export {ModuleDescriptor} from './modules/module_descriptor.js';
export {ModuleRegistry} from './modules/module_registry.js';
......
......@@ -13,7 +13,7 @@
<release seq="1">
<includes>
<include name="IDR_NEW_TAB_PAGE_NEW_TAB_PAGE_JS"
file="new_tab_page.js" type="BINDATA" compress="false" />
file="new_tab_page.js" type="BINDATA" compress="false" preprocess="true"/>
<include name="IDR_NEW_TAB_PAGE_APP_JS"
file="${root_gen_dir}/chrome/browser/resources/new_tab_page/app.js"
use_base_dir="false" type="BINDATA" compress="false"
......
......@@ -203,6 +203,9 @@ TEST_F('NewTabPageModulesModuleRegistryTest', 'All', function() {
mocha.run();
});
// The dummy module is not available in official builds.
GEN('#if !defined(OFFICIAL_BUILD)');
// eslint-disable-next-line no-var
var NewTabPageModulesDummyModuleTest = class extends NewTabPageBrowserTest {
/** @override */
......@@ -215,6 +218,8 @@ TEST_F('NewTabPageModulesDummyModuleTest', 'All', function() {
mocha.run();
});
GEN('#endif // !defined(OFFICIAL_BUILD)');
// eslint-disable-next-line no-var
var NewTabPageMiddleSlotPromoTest = class extends NewTabPageBrowserTest {
/** @override */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment