Commit be2478a3 authored by Demetrios Papadopoulos's avatar Demetrios Papadopoulos Committed by Commit Bot

Settings: Pass settings_main.html to Polymer 3 auto-gen tools.

Previously settings_main.html was using a pattern that is not supported
by polymer_modulizer(), where multiple <script> tags appeared within the
element's template.

Removed the usage of that pattern, by creating a dedicated
search_settings.html file similar to how other pure JS files are
imported in Polymer 2 code. This also simplifies the setup steps
of the CrSettingsSearchTest.All test case.

Bug: 1026426
Change-Id: Ic35da83e72e75864434b6dc0ba31f2cfc7508e01
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2032327Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737155}
parent 814d6cf9
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/cr.html">
<link rel="import" href="chrome://resources/html/search_highlight_utils.html">
<link rel="import" href="chrome://resources/html/util.html">
<link rel="import" href="i18n_setup.html">
<script src="search_settings.js"></script>
......@@ -29,26 +29,22 @@ js_library("settings_main") {
# deps = [ ":settings_main.m" ]
#}
# TODO(crbug.com/1026426): Fix and enable.
#js_library("settings_main.m") {
# sources = [ "$root_gen_dir/chrome/browser/resources/settings/settings_main/settings_main.m.js" ]
# deps = [
# # TODO: Fill those in.
# ]
# extra_deps = [ ":settings_main_module" ]
#}
js_library("settings_main.m") {
sources = [ "$root_gen_dir/chrome/browser/resources/settings/settings_main/settings_main.m.js" ]
deps = [
# TODO: Fill those in.
]
extra_deps = [ ":settings_main_module" ]
}
import("//tools/polymer/polymer.gni")
group("polymer3_elements") {
deps = [
# TODO(crbug.com/1026426): Fix and uncomment.
#":settings_main_module"
]
deps = [ ":settings_main_module" ]
}
polymer_modulizer("settings_main") {
js_file = "settings_main.js"
html_file = "settings_main.html"
html_type = "dom-module"
}
# TODO(crbug.com/1026426): Fix and enable.
#polymer_modulizer("settings_main") {
# js_file = "settings_main.js"
# html_file = "settings_main.html"
# html_type = "dom-module"
#}
......@@ -13,6 +13,7 @@
<link rel="import" href="../prefs/prefs.html">
<link rel="import" href="../route.html">
<link rel="import" href="../router.html">
<link rel="import" href="../search_settings.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="../settings_vars_css.html">
......@@ -83,5 +84,4 @@
<div id="overscroll" style="padding-bottom: [[overscroll_]]px"></div>
</template>
<script src="settings_main.js"></script>
<script src="../search_settings.js"></script>
</dom-module>
......@@ -184,6 +184,9 @@
<structure name="IDR_SETTINGS_ON_STARTUP_PAGE_JS"
file="on_startup_page/on_startup_page.js"
type="chrome_html" />
<structure name="IDR_SETTINGS_SEARCH_SETTINGS_HTML"
file="search_settings.html"
type="chrome_html" />
<structure name="IDR_SETTINGS_SEARCH_SETTINGS_JS"
file="search_settings.js"
type="chrome_html" />
......
......@@ -1821,7 +1821,7 @@ CrSettingsSearchTest.prototype = {
__proto__: CrSettingsBrowserTest.prototype,
/** @override */
browsePreload: 'chrome://settings/settings_page/settings_section.html',
browsePreload: 'chrome://settings/search_settings.html',
/** @override */
extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([
......
......@@ -7,16 +7,12 @@ cr.define('settings_test', function() {
suite('SearchSettingsTest', function() {
let searchManager;
// Don't import script if already imported (happens in Vulcanized mode).
suiteSetup(function() {
if (!window.settings || !settings.getSearchManager) {
return Promise.all([
PolymerTest.loadScript('chrome://resources/js/load_time_data.js'),
PolymerTest.loadScript('chrome://settings/strings.js'),
PolymerTest.loadScript(
'chrome://resources/js/search_highlight_utils.js'),
PolymerTest.loadScript('chrome://settings/search_settings.js'),
]);
// Import <settings-section> manually if not already imported
// (happens when |optimize_webui| is false).
if (customElements.get('settings-section') === undefined) {
return PolymerTest.importHtml(
'chrome://settings/settings_page/settings_section.html');
}
});
......
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