Commit 06a3bcf4 authored by rbpotter's avatar rbpotter Committed by Commit Bot

Settings: Port site_list and dependencies to Polymer 3

Note: Currently SiteList test is disabled for flakiness. Re-enabled to
test locally, and fixed a few consistent errors that likely appeared
since the test was disabled. Did not observe any failures in 10 runs
locally so will try to re-enable this test in a separate CL.

Bug: 1026426
Change-Id: I72eead1d0fe4d70052ad7c1333a9c7b2ed104c9a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2109410
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: default avatardpapad <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751921}
parent e0f773c5
...@@ -63,6 +63,7 @@ import './search_engines_page/omnibox_extension_entry.m.js'; ...@@ -63,6 +63,7 @@ import './search_engines_page/omnibox_extension_entry.m.js';
import './search_engines_page/search_engine_dialog.m.js'; import './search_engines_page/search_engine_dialog.m.js';
import './search_engines_page/search_engine_entry.m.js'; import './search_engines_page/search_engine_entry.m.js';
import './site_settings/site_list_entry.m.js'; import './site_settings/site_list_entry.m.js';
import './site_settings/site_list.m.js';
// <if expr="_google_chrome and is_win"> // <if expr="_google_chrome and is_win">
export {CHROME_CLEANUP_DEFAULT_ITEMS_TO_SHOW} from './chrome_cleanup_page/items_to_remove_list.m.js'; export {CHROME_CLEANUP_DEFAULT_ITEMS_TO_SHOW} from './chrome_cleanup_page/items_to_remove_list.m.js';
...@@ -81,8 +82,9 @@ export {ClearBrowsingDataBrowserProxyImpl} from './clear_browsing_data_dialog/cl ...@@ -81,8 +82,9 @@ export {ClearBrowsingDataBrowserProxyImpl} from './clear_browsing_data_dialog/cl
export {DownloadsBrowserProxyImpl} from './downloads_page/downloads_browser_proxy.m.js'; export {DownloadsBrowserProxyImpl} from './downloads_page/downloads_browser_proxy.m.js';
export {kMenuCloseDelay} from './languages_page/languages_page.m.js'; export {kMenuCloseDelay} from './languages_page/languages_page.m.js';
export {LanguagesBrowserProxyImpl} from './languages_page/languages_browser_proxy.m.js'; export {LanguagesBrowserProxyImpl} from './languages_page/languages_browser_proxy.m.js';
export {ChooserType,ContentSetting,ContentSettingsTypes,SiteSettingSource} from './site_settings/constants.m.js'; export {ChooserType,ContentSetting,ContentSettingsTypes,SiteSettingSource,SITE_EXCEPTION_WILDCARD} from './site_settings/constants.m.js';
export {cookieInfo} from './site_settings/cookie_info.m.js'; export {cookieInfo} from './site_settings/cookie_info.m.js';
export {kControlledByLookup} from './site_settings/site_settings_behavior.m.js';
export {LocalDataBrowserProxyImpl} from './site_settings/local_data_browser_proxy.m.js'; export {LocalDataBrowserProxyImpl} from './site_settings/local_data_browser_proxy.m.js';
export {SiteSettingsPrefsBrowserProxyImpl} from './site_settings/site_settings_prefs_browser_proxy.m.js'; export {SiteSettingsPrefsBrowserProxyImpl} from './site_settings/site_settings_prefs_browser_proxy.m.js';
...@@ -92,5 +94,6 @@ export {ProfileShortcutStatus, ManageProfileBrowserProxyImpl} from './people_pag ...@@ -92,5 +94,6 @@ export {ProfileShortcutStatus, ManageProfileBrowserProxyImpl} from './people_pag
// </if> // </if>
// <if expr="chromeos"> // <if expr="chromeos">
export {AndroidInfoBrowserProxyImpl} from './site_settings/android_info_browser_proxy.m.js';
export {BlockingRequestManager} from './autofill_page/blocking_request_manager.m.js'; export {BlockingRequestManager} from './autofill_page/blocking_request_manager.m.js';
// </if> // </if>
...@@ -11,6 +11,8 @@ settings_namespace_rewrites = [ ...@@ -11,6 +11,8 @@ settings_namespace_rewrites = [
"settings.AboutPageBrowserProxy|AboutPageBrowserProxy", "settings.AboutPageBrowserProxy|AboutPageBrowserProxy",
"settings.AccountManagerBrowserProxy|AccountManagerBrowserProxy", "settings.AccountManagerBrowserProxy|AccountManagerBrowserProxy",
"settings.Account|Account", "settings.Account|Account",
"settings.AndroidInfoBrowserProxy|AndroidInfoBrowserProxy",
"settings.AndroidSmsInfo|AndroidSmsInfo",
"settings.AppearanceBrowserProxy|AppearanceBrowserProxy", "settings.AppearanceBrowserProxy|AppearanceBrowserProxy",
"settings.AutofillManager|AutofillManager", "settings.AutofillManager|AutofillManager",
"settings.BlockingRequestManager|BlockingRequestManager", "settings.BlockingRequestManager|BlockingRequestManager",
...@@ -33,6 +35,7 @@ settings_namespace_rewrites = [ ...@@ -33,6 +35,7 @@ settings_namespace_rewrites = [
"settings.ImportDataBrowserProxy|ImportDataBrowserProxy", "settings.ImportDataBrowserProxy|ImportDataBrowserProxy",
"settings.IncompatibleApplicationsBrowserProxy|IncompatibleApplicationsBrowserProxy", "settings.IncompatibleApplicationsBrowserProxy|IncompatibleApplicationsBrowserProxy",
"settings.IncompatibleApplication|IncompatibleApplication", "settings.IncompatibleApplication|IncompatibleApplication",
"settings.INVALID_CATEGORY_SUBTYPE|INVALID_CATEGORY_SUBTYPE",
"settings.LanguagesBrowserProxy|LanguagesBrowserProxy", "settings.LanguagesBrowserProxy|LanguagesBrowserProxy",
"settings.LifetimeBrowserProxy|LifetimeBrowserProxy", "settings.LifetimeBrowserProxy|LifetimeBrowserProxy",
"settings.LocalDataBrowserProxy|LocalDataBrowserProxy", "settings.LocalDataBrowserProxy|LocalDataBrowserProxy",
...@@ -89,4 +92,5 @@ settings_auto_imports = [ ...@@ -89,4 +92,5 @@ settings_auto_imports = [
"chrome/browser/resources/settings/prefs/prefs_behavior.html|PrefsBehavior", "chrome/browser/resources/settings/prefs/prefs_behavior.html|PrefsBehavior",
"chrome/browser/resources/settings/prefs/prefs_types.html|CrSettingsPrefs", "chrome/browser/resources/settings/prefs/prefs_types.html|CrSettingsPrefs",
"chrome/browser/resources/settings/printing_page/printing_browser_proxy.html|PrintingBrowserProxyImpl", "chrome/browser/resources/settings/printing_page/printing_browser_proxy.html|PrintingBrowserProxyImpl",
"chrome/browser/resources/settings/site_settings/site_settings_behavior.html|SiteSettingsBehavior",
] ]
...@@ -542,6 +542,16 @@ ...@@ -542,6 +542,16 @@
file="${root_gen_dir}/chrome/browser/resources/settings/site_favicon.m.js" file="${root_gen_dir}/chrome/browser/resources/settings/site_favicon.m.js"
use_base_dir="false" use_base_dir="false"
type="BINDATA" /> type="BINDATA" />
<include name="IDR_SETTINGS_SITE_SETTINGS_ADD_SITE_DIALOG_M_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/site_settings/add_site_dialog.m.js"
use_base_dir="false"
type="BINDATA" />
<if expr="chromeos">
<include name="IDR_SETTINGS_SITE_SETTINGS_ANDROID_INFO_BROWSER_PROXY_M_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/site_settings/android_info_browser_proxy.m.js"
use_base_dir="false"
type="BINDATA" />
</if>
<include name="IDR_SETTINGS_SITE_SETTINGS_CONSTANTS_M_JS" <include name="IDR_SETTINGS_SITE_SETTINGS_CONSTANTS_M_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/site_settings/constants.m.js" file="${root_gen_dir}/chrome/browser/resources/settings/site_settings/constants.m.js"
use_base_dir="false" use_base_dir="false"
...@@ -550,6 +560,10 @@ ...@@ -550,6 +560,10 @@
file="${root_gen_dir}/chrome/browser/resources/settings/site_settings/cookie_info.m.js" file="${root_gen_dir}/chrome/browser/resources/settings/site_settings/cookie_info.m.js"
use_base_dir="false" use_base_dir="false"
type="BINDATA" /> type="BINDATA" />
<include name="IDR_SETTINGS_SITE_SETTINGS_EDIT_EXCEPTION_DIALOG_M_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/site_settings/edit_exception_dialog.m.js"
use_base_dir="false"
type="BINDATA" />
<include name="IDR_SETTINGS_SITE_SETTINGS_LOCAL_DATA_BROWSER_PROXY_M_JS" <include name="IDR_SETTINGS_SITE_SETTINGS_LOCAL_DATA_BROWSER_PROXY_M_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/site_settings/local_data_browser_proxy.m.js" file="${root_gen_dir}/chrome/browser/resources/settings/site_settings/local_data_browser_proxy.m.js"
use_base_dir="false" use_base_dir="false"
...@@ -558,6 +572,11 @@ ...@@ -558,6 +572,11 @@
file="${root_gen_dir}/chrome/browser/resources/settings/site_settings/site_data_details_subpage.m.js" file="${root_gen_dir}/chrome/browser/resources/settings/site_settings/site_data_details_subpage.m.js"
use_base_dir="false" use_base_dir="false"
type="BINDATA" /> type="BINDATA" />
<include name="IDR_SETTINGS_SITE_SETTINGS_SITE_LIST_M_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/site_settings/site_list.m.js"
use_base_dir="false"
type="BINDATA"
preprocess="true" />
<include name="IDR_SETTINGS_SITE_SETTINGS_SITE_LIST_ENTRY_M_JS" <include name="IDR_SETTINGS_SITE_SETTINGS_SITE_LIST_ENTRY_M_JS"
file="${root_gen_dir}/chrome/browser/resources/settings/site_settings/site_list_entry.m.js" file="${root_gen_dir}/chrome/browser/resources/settings/site_settings/site_list_entry.m.js"
use_base_dir="false" use_base_dir="false"
......
...@@ -298,18 +298,19 @@ js_library("zoom_levels") { ...@@ -298,18 +298,19 @@ js_library("zoom_levels") {
js_type_check("closure_compile_module") { js_type_check("closure_compile_module") {
is_polymer3 = true is_polymer3 = true
deps = [ deps = [
# ":add_site_dialog.m", ":add_site_dialog.m",
# ":all_sites.m", # ":all_sites.m",
# ":all_sites_icons.m", # ":all_sites_icons.m",
# ":android_info_browser_proxy.m", ":android_info_browser_proxy.m",
# ":category_default_setting.m", # ":category_default_setting.m",
# ":category_setting_exceptions.m", # ":category_setting_exceptions.m",
# ":chooser_exception_list.m", # ":chooser_exception_list.m",
# ":chooser_exception_list_entry.m", # ":chooser_exception_list_entry.m",
":constants.m", ":constants.m",
":cookie_info.m", ":cookie_info.m",
":edit_exception_dialog.m",
# ":edit_exception_dialog.m",
":local_data_browser_proxy.m", ":local_data_browser_proxy.m",
# ":media_picker.m", # ":media_picker.m",
...@@ -322,7 +323,7 @@ js_type_check("closure_compile_module") { ...@@ -322,7 +323,7 @@ js_type_check("closure_compile_module") {
# ":site_details.m", # ":site_details.m",
# ":site_details_permission.m", # ":site_details_permission.m",
# ":site_entry.m", # ":site_entry.m",
# ":site_list.m", ":site_list.m",
":site_list_entry.m", ":site_list_entry.m",
":site_settings_behavior.m", ":site_settings_behavior.m",
":site_settings_prefs_browser_proxy.m", ":site_settings_prefs_browser_proxy.m",
...@@ -335,7 +336,12 @@ js_type_check("closure_compile_module") { ...@@ -335,7 +336,12 @@ js_type_check("closure_compile_module") {
js_library("add_site_dialog.m") { js_library("add_site_dialog.m") {
sources = [ "$root_gen_dir/chrome/browser/resources/settings/site_settings/add_site_dialog.m.js" ] sources = [ "$root_gen_dir/chrome/browser/resources/settings/site_settings/add_site_dialog.m.js" ]
deps = [ deps = [
# TODO: Fill those in. ":constants.m",
":site_settings_behavior.m",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/cr_elements/cr_dialog:cr_dialog.m",
"//ui/webui/resources/js:assert.m",
"//ui/webui/resources/js:web_ui_listener_behavior.m",
] ]
extra_deps = [ ":add_site_dialog_module" ] extra_deps = [ ":add_site_dialog_module" ]
} }
...@@ -358,9 +364,7 @@ js_library("all_sites_icons.m") { ...@@ -358,9 +364,7 @@ js_library("all_sites_icons.m") {
js_library("android_info_browser_proxy.m") { js_library("android_info_browser_proxy.m") {
sources = [ "$root_gen_dir/chrome/browser/resources/settings/site_settings/android_info_browser_proxy.m.js" ] sources = [ "$root_gen_dir/chrome/browser/resources/settings/site_settings/android_info_browser_proxy.m.js" ]
deps = [ deps = [ "//ui/webui/resources/js:cr.m" ]
# TODO: Fill those in.
]
extra_deps = [ ":modulize" ] extra_deps = [ ":modulize" ]
} }
...@@ -410,7 +414,10 @@ js_library("cookie_info.m") { ...@@ -410,7 +414,10 @@ js_library("cookie_info.m") {
js_library("edit_exception_dialog.m") { js_library("edit_exception_dialog.m") {
sources = [ "$root_gen_dir/chrome/browser/resources/settings/site_settings/edit_exception_dialog.m.js" ] sources = [ "$root_gen_dir/chrome/browser/resources/settings/site_settings/edit_exception_dialog.m.js" ]
deps = [ deps = [
# TODO: Fill those in. ":constants.m",
":site_settings_prefs_browser_proxy.m",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/cr_elements/cr_dialog:cr_dialog.m",
] ]
extra_deps = [ ":edit_exception_dialog_module" ] extra_deps = [ ":edit_exception_dialog_module" ]
} }
...@@ -505,8 +512,20 @@ js_library("site_entry.m") { ...@@ -505,8 +512,20 @@ js_library("site_entry.m") {
js_library("site_list.m") { js_library("site_list.m") {
sources = [ "$root_gen_dir/chrome/browser/resources/settings/site_settings/site_list.m.js" ] sources = [ "$root_gen_dir/chrome/browser/resources/settings/site_settings/site_list.m.js" ]
deps = [ deps = [
# TODO: Fill those in. ":android_info_browser_proxy.m",
":constants.m",
":site_list_entry.m",
":site_settings_behavior.m",
":site_settings_prefs_browser_proxy.m",
"//third_party/polymer/v3_0/components-chromium/paper-tooltip:paper-tooltip",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/cr_elements/cr_action_menu:cr_action_menu.m",
"//ui/webui/resources/js:assert.m",
"//ui/webui/resources/js:list_property_update_behavior.m",
"//ui/webui/resources/js:web_ui_listener_behavior.m",
"//ui/webui/resources/js/cr/ui:focus_without_ink.m",
] ]
externs_list = [ "$externs_path/settings_private.js" ]
extra_deps = [ ":site_list_module" ] extra_deps = [ ":site_list_module" ]
} }
...@@ -593,6 +612,11 @@ polymer_modulizer("add_site_dialog") { ...@@ -593,6 +612,11 @@ polymer_modulizer("add_site_dialog") {
js_file = "add_site_dialog.js" js_file = "add_site_dialog.js"
html_file = "add_site_dialog.html" html_file = "add_site_dialog.html"
html_type = "dom-module" html_type = "dom-module"
auto_imports = settings_auto_imports + [
"chrome/browser/resources/settings/site_settings/constants.html|ContentSetting,ContentSettingsTypes,SITE_EXCEPTION_WILDCARD",
"ui/webui/resources/html/assert.html|assert",
]
namespace_rewrites = settings_namespace_rewrites
} }
polymer_modulizer("all_sites") { polymer_modulizer("all_sites") {
...@@ -641,6 +665,11 @@ polymer_modulizer("edit_exception_dialog") { ...@@ -641,6 +665,11 @@ polymer_modulizer("edit_exception_dialog") {
js_file = "edit_exception_dialog.js" js_file = "edit_exception_dialog.js"
html_file = "edit_exception_dialog.html" html_file = "edit_exception_dialog.html"
html_type = "dom-module" html_type = "dom-module"
auto_imports = settings_auto_imports + [
"chrome/browser/resources/settings/site_settings/constants.html|SITE_EXCEPTION_WILDCARD",
"chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.html|SiteException,SiteSettingsPrefsBrowserProxy,SiteSettingsPrefsBrowserProxyImpl",
]
namespace_rewrites = settings_namespace_rewrites
} }
polymer_modulizer("media_picker") { polymer_modulizer("media_picker") {
...@@ -708,6 +737,13 @@ polymer_modulizer("site_list") { ...@@ -708,6 +737,13 @@ polymer_modulizer("site_list") {
js_file = "site_list.js" js_file = "site_list.js"
html_file = "site_list.html" html_file = "site_list.html"
html_type = "dom-module" html_type = "dom-module"
auto_imports = settings_auto_imports + [
"chrome/browser/resources/settings/site_settings/android_info_browser_proxy.html|AndroidInfoBrowserProxyImpl,AndroidSmsInfo",
"chrome/browser/resources/settings/site_settings/constants.html|ContentSetting,ContentSettingsTypes,INVALID_CATEGORY_SUBTYPE",
"chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.html|RawSiteException,SiteException,SiteSettingsPrefsBrowserProxyImpl",
"ui/webui/resources/html/assert.html|assert",
]
namespace_rewrites = settings_namespace_rewrites
} }
polymer_modulizer("site_list_entry") { polymer_modulizer("site_list_entry") {
...@@ -718,7 +754,6 @@ polymer_modulizer("site_list_entry") { ...@@ -718,7 +754,6 @@ polymer_modulizer("site_list_entry") {
"chrome/browser/resources/settings/route.html|routes", "chrome/browser/resources/settings/route.html|routes",
"chrome/browser/resources/settings/router.html|Router", "chrome/browser/resources/settings/router.html|Router",
"chrome/browser/resources/settings/site_settings/constants.html|ChooserType,ContentSettingsTypes,SITE_EXCEPTION_WILDCARD", "chrome/browser/resources/settings/site_settings/constants.html|ChooserType,ContentSettingsTypes,SITE_EXCEPTION_WILDCARD",
"chrome/browser/resources/settings/site_settings/site_settings_behavior.html|SiteSettingsBehavior",
"chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.html|SiteException", "chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.html|SiteException",
"ui/webui/resources/html/assert.html|assert", "ui/webui/resources/html/assert.html|assert",
] ]
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<link rel="import" href="chrome://resources/cr_elements/cr_checkbox/cr_checkbox.html"> <link rel="import" href="chrome://resources/cr_elements/cr_checkbox/cr_checkbox.html">
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html"> <link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html"> <link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="../i18n_setup.html"> <link rel="import" href="../i18n_setup.html">
<link rel="import" href="../settings_shared_css.html"> <link rel="import" href="../settings_shared_css.html">
......
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// clang-format off
// #import {addSingletonGetter, sendWithPromise} from 'chrome://resources/js/cr.m.js';
// clang-format on
/** /**
* Type definition of AndroidAppsInfo entry. |playStoreEnabled| indicates that * Type definition of AndroidAppsInfo entry. |playStoreEnabled| indicates that
* Play Store is enabled. |settingsAppAvailable| indicates that Android settings * Play Store is enabled. |settingsAppAvailable| indicates that Android settings
...@@ -22,7 +26,7 @@ cr.define('settings', function() { ...@@ -22,7 +26,7 @@ cr.define('settings', function() {
* @typedef {{origin: string, * @typedef {{origin: string,
* enabled: boolean}} * enabled: boolean}}
*/ */
let AndroidSmsInfo; /* #export */ let AndroidSmsInfo;
/** @interface */ /** @interface */
class AndroidInfoBrowserProxy { class AndroidInfoBrowserProxy {
...@@ -39,7 +43,7 @@ cr.define('settings', function() { ...@@ -39,7 +43,7 @@ cr.define('settings', function() {
/** /**
* @implements {settings.AndroidInfoBrowserProxy} * @implements {settings.AndroidInfoBrowserProxy}
*/ */
class AndroidInfoBrowserProxyImpl { /* #export */ class AndroidInfoBrowserProxyImpl {
/** @override */ /** @override */
getAndroidSmsInfo() { getAndroidSmsInfo() {
return cr.sendWithPromise('getAndroidSmsInfo'); return cr.sendWithPromise('getAndroidSmsInfo');
......
...@@ -115,7 +115,7 @@ cr.define('settings', function() { ...@@ -115,7 +115,7 @@ cr.define('settings', function() {
* An invalid subtype value. * An invalid subtype value.
* @type {string} * @type {string}
*/ */
const INVALID_CATEGORY_SUBTYPE = ''; /* #export */ const INVALID_CATEGORY_SUBTYPE = '';
/** /**
* Contains the record action types logged before M82. * Contains the record action types logged before M82.
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html"> <link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html">
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html"> <link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
<link rel="import" href="../i18n_setup.html"> <link rel="import" href="../i18n_setup.html">
<link rel="import" href="constants.html">
<link rel="import" href="site_settings_prefs_browser_proxy.html"> <link rel="import" href="site_settings_prefs_browser_proxy.html">
<dom-module id="settings-edit-exception-dialog"> <dom-module id="settings-edit-exception-dialog">
......
...@@ -37,7 +37,7 @@ Polymer({ ...@@ -37,7 +37,7 @@ Polymer({
}, },
}, },
/** @private {!settings.SiteSettingsPrefsBrowserProxy} */ /** @private {?settings.SiteSettingsPrefsBrowserProxy} */
browserProxy_: null, browserProxy_: null,
/** @override */ /** @override */
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* TODO(dschuyler): Can they be unified (and this dictionary removed)? * TODO(dschuyler): Can they be unified (and this dictionary removed)?
* @type {!Object} * @type {!Object}
*/ */
const kControlledByLookup = { /* #export */ const kControlledByLookup = {
'extension': chrome.settingsPrivate.ControlledBy.EXTENSION, 'extension': chrome.settingsPrivate.ControlledBy.EXTENSION,
'HostedApp': chrome.settingsPrivate.ControlledBy.EXTENSION, 'HostedApp': chrome.settingsPrivate.ControlledBy.EXTENSION,
'platform_app': chrome.settingsPrivate.ControlledBy.EXTENSION, 'platform_app': chrome.settingsPrivate.ControlledBy.EXTENSION,
......
...@@ -256,6 +256,7 @@ js2gtest("browser_tests_js_webui") { ...@@ -256,6 +256,7 @@ js2gtest("browser_tests_js_webui") {
"$root_gen_dir/chrome/test/data/webui/settings/test_metrics_browser_proxy.m.js", "$root_gen_dir/chrome/test/data/webui/settings/test_metrics_browser_proxy.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/site_data_details_subpage_tests.m.js", "$root_gen_dir/chrome/test/data/webui/settings/site_data_details_subpage_tests.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/site_list_entry_tests.m.js", "$root_gen_dir/chrome/test/data/webui/settings/site_list_entry_tests.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/site_list_tests.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/sync_test_util.m.js", "$root_gen_dir/chrome/test/data/webui/settings/sync_test_util.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/test_extension_control_browser_proxy.m.js", "$root_gen_dir/chrome/test/data/webui/settings/test_extension_control_browser_proxy.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/test_languages_browser_proxy.m.js", "$root_gen_dir/chrome/test/data/webui/settings/test_languages_browser_proxy.m.js",
...@@ -280,7 +281,9 @@ js2gtest("browser_tests_js_webui") { ...@@ -280,7 +281,9 @@ js2gtest("browser_tests_js_webui") {
if (is_chromeos) { if (is_chromeos) {
data += [ data += [
"$root_gen_dir/chrome/test/data/webui/cr_elements/cr_searchable_drop_down_tests.m.js", "$root_gen_dir/chrome/test/data/webui/cr_elements/cr_searchable_drop_down_tests.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/site_list_tests_cros.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/passwords_section_test_cros.m.js", "$root_gen_dir/chrome/test/data/webui/settings/passwords_section_test_cros.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/test_android_info_browser_proxy.m.js",
] ]
} else { } else {
data += [ data += [
......
...@@ -51,6 +51,7 @@ js_modulizer("modulize") { ...@@ -51,6 +51,7 @@ js_modulizer("modulize") {
"settings_ui_tests.js", "settings_ui_tests.js",
"site_data_details_subpage_tests.js", "site_data_details_subpage_tests.js",
"site_list_entry_tests.js", "site_list_entry_tests.js",
"site_list_tests.js",
"site_favicon_test.js", "site_favicon_test.js",
"startup_urls_page_test.js", "startup_urls_page_test.js",
"sync_test_util.js", "sync_test_util.js",
...@@ -75,7 +76,11 @@ js_modulizer("modulize") { ...@@ -75,7 +76,11 @@ js_modulizer("modulize") {
] ]
} }
if (is_chromeos) { if (is_chromeos) {
input_files += [ "passwords_section_test_cros.js" ] input_files += [
"passwords_section_test_cros.js",
"site_list_tests_cros.js",
"test_android_info_browser_proxy.js",
]
} else { } else {
input_files += [ input_files += [
"default_browser_browsertest.js", "default_browser_browsertest.js",
...@@ -85,6 +90,8 @@ js_modulizer("modulize") { ...@@ -85,6 +90,8 @@ js_modulizer("modulize") {
] ]
} }
namespace_rewrites = settings_namespace_rewrites + test_namespace_rewrites + [ namespace_rewrites = settings_namespace_rewrites + test_namespace_rewrites + [
"android_info.TestAndroidInfoBrowserProxy|TestAndroidInfoBrowserProxy",
"android_info.TEST_ANDROID_SMS_ORIGIN|TEST_ANDROID_SMS_ORIGIN",
"autofill_test_util.PasswordSectionElementFactory|PasswordSectionElementFactory", "autofill_test_util.PasswordSectionElementFactory|PasswordSectionElementFactory",
"autofill_test_util.PasswordManagerExpectations|PasswordManagerExpectations", "autofill_test_util.PasswordManagerExpectations|PasswordManagerExpectations",
"autofill_test_util.AutofillManagerExpectations|AutofillManagerExpectations", "autofill_test_util.AutofillManagerExpectations|AutofillManagerExpectations",
...@@ -111,6 +118,8 @@ js_modulizer("modulize") { ...@@ -111,6 +118,8 @@ js_modulizer("modulize") {
"settings_search.TestSearchEnginesBrowserProxy|TestSearchEnginesBrowserProxy", "settings_search.TestSearchEnginesBrowserProxy|TestSearchEnginesBrowserProxy",
"sync_test_util.getSyncAllPrefs|getSyncAllPrefs", "sync_test_util.getSyncAllPrefs|getSyncAllPrefs",
"sync_test_util.simulateSyncStatus|simulateSyncStatus", "sync_test_util.simulateSyncStatus|simulateSyncStatus",
"test_util.createContentSettingTypeToValuePair|createContentSettingTypeToValuePair",
"test_util.createRawSiteException|createRawSiteException",
"test_util.createSiteSettingsPrefs|createSiteSettingsPrefs", "test_util.createSiteSettingsPrefs|createSiteSettingsPrefs",
"test_util.setupPopstateListener|setupPopstateListener", "test_util.setupPopstateListener|setupPopstateListener",
] ]
......
...@@ -1539,24 +1539,53 @@ CrSettingsSiteListTest.prototype = { ...@@ -1539,24 +1539,53 @@ CrSettingsSiteListTest.prototype = {
'test_util.js', 'test_util.js',
'../test_util.js', '../test_util.js',
'test_site_settings_prefs_browser_proxy.js', 'test_site_settings_prefs_browser_proxy.js',
'test_android_info_browser_proxy.js',
'site_list_tests.js', 'site_list_tests.js',
]), ]),
}; };
// TODO(crbug.com/929455): flaky, fix. // TODO(crbug.com/929455): flaky, fix.
TEST_F('CrSettingsSiteListTest', 'DISABLED_SiteList', function() { TEST_F('CrSettingsSiteListTest', 'DISABLED_SiteList', function() {
mocha.grep('SiteList').run(); runMochaSuite('SiteList');
}); });
TEST_F('CrSettingsSiteListTest', 'EditExceptionDialog', function() { TEST_F('CrSettingsSiteListTest', 'EditExceptionDialog', function() {
mocha.grep('EditExceptionDialog').run(); runMochaSuite('EditExceptionDialog');
}); });
TEST_F('CrSettingsSiteListTest', 'AddExceptionDialog', function() { TEST_F('CrSettingsSiteListTest', 'AddExceptionDialog', function() {
mocha.grep('AddExceptionDialog').run(); runMochaSuite('AddExceptionDialog');
}); });
GEN('#if defined(OS_CHROMEOS)');
/**
* @constructor
* @extends {CrSettingsBrowserTest}
*/
function CrSettingsSiteListChromeOSTest() {}
CrSettingsSiteListChromeOSTest.prototype = {
__proto__: CrSettingsBrowserTest.prototype,
/** @override */
browsePreload: 'chrome://settings/site_settings/site_list.html',
/** @override */
extraLibraries: CrSettingsBrowserTest.prototype.extraLibraries.concat([
'../test_browser_proxy.js',
'test_util.js',
'../test_util.js',
'test_site_settings_prefs_browser_proxy.js',
'test_android_info_browser_proxy.js',
'site_list_tests_cros.js',
]),
};
// TODO(crbug.com/929455): flaky, fix.
TEST_F('CrSettingsSiteListChromeOSTest', 'DISABLED_AndroidSmsInfo', function() {
mocha.run();
});
GEN('#endif // defined(OS_CHROMEOS)');
/** /**
* @constructor * @constructor
* @extends {CrSettingsBrowserTest} * @extends {CrSettingsBrowserTest}
......
...@@ -662,3 +662,42 @@ var CrSettingsSiteListEntryV3Test = class extends CrSettingsV3BrowserTest { ...@@ -662,3 +662,42 @@ var CrSettingsSiteListEntryV3Test = class extends CrSettingsV3BrowserTest {
TEST_F('CrSettingsSiteListEntryV3Test', 'All', function() { TEST_F('CrSettingsSiteListEntryV3Test', 'All', function() {
mocha.run(); mocha.run();
}); });
// eslint-disable-next-line no-var
var CrSettingsSiteListV3Test = class extends CrSettingsV3BrowserTest {
/** @override */
get browsePreload() {
return 'chrome://settings/test_loader.html?module=settings/site_list_tests.m.js';
}
};
// Copied from Polymer 2 test:
// TODO(crbug.com/929455): flaky, fix.
TEST_F('CrSettingsSiteListV3Test', 'DISABLED_SiteList', function() {
runMochaSuite('SiteList');
});
TEST_F('CrSettingsSiteListV3Test', 'EditExceptionDialog', function() {
runMochaSuite('EditExceptionDialog');
});
TEST_F('CrSettingsSiteListV3Test', 'AddExceptionDialog', function() {
runMochaSuite('AddExceptionDialog');
});
GEN('#if defined(OS_CHROMEOS)');
// eslint-disable-next-line no-var
var CrSettingsSiteListChromeOSV3Test = class extends CrSettingsV3BrowserTest {
/** @override */
get browsePreload() {
return 'chrome://settings/test_loader.html?module=settings/site_list_tests_cros.m.js';
}
};
// Copied from Polymer 2 test:
// TODO(crbug.com/929455): flaky, fix.
TEST_F(
'CrSettingsSiteListChromeOSV3Test', 'DISABLED_AndroidSmsInfo', function() {
mocha.run();
});
GEN('#endif // defined(OS_CHROMEOS)');
...@@ -4,6 +4,15 @@ ...@@ -4,6 +4,15 @@
/** @fileoverview Suite of tests for site-list. */ /** @fileoverview Suite of tests for site-list. */
// clang-format off
// #import {ContentSetting,ContentSettingsTypes,kControlledByLookup,SiteSettingSource,SiteSettingsPrefsBrowserProxyImpl,SITE_EXCEPTION_WILDCARD} from 'chrome://settings/lazy_load.js';
// #import {createContentSettingTypeToValuePair,createRawSiteException,createSiteSettingsPrefs} from 'chrome://test/settings/test_util.m.js';
// #import {CrSettingsPrefs,Router} from 'chrome://settings/settings.js';
// #import {eventToPromise,waitBeforeNextRender} from 'chrome://test/test_util.m.js';
// #import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
// #import {TestSiteSettingsPrefsBrowserProxy} from 'chrome://test/settings/test_site_settings_prefs_browser_proxy.m.js';
// clang-format on
/** /**
* An example pref with 2 blocked location items and 2 allowed. This pref * An example pref with 2 blocked location items and 2 allowed. This pref
* is also used for the All Sites category and therefore needs values for * is also used for the All Sites category and therefore needs values for
...@@ -12,6 +21,12 @@ ...@@ -12,6 +21,12 @@
*/ */
let prefsGeolocation; let prefsGeolocation;
/**
* An example pref that is empty.
* @type {SiteSettingsPref}
*/
let prefsGeolocationEmpty;
/** /**
* An example of prefs controlledBy policy. * An example of prefs controlledBy policy.
* @type {SiteSettingsPref} * @type {SiteSettingsPref}
...@@ -37,6 +52,12 @@ let prefsMixedProvider; ...@@ -37,6 +52,12 @@ let prefsMixedProvider;
*/ */
let prefsMixedEmbeddingOrigin; let prefsMixedEmbeddingOrigin;
/**
* An example pref with native file system write
* @type {SiteSettingsPref}
*/
let prefsNativeFileSystemWrite;
/** /**
* An example pref with multiple categories and multiple allow/block * An example pref with multiple categories and multiple allow/block
* state. * state.
...@@ -74,12 +95,6 @@ let prefsIncognito; ...@@ -74,12 +95,6 @@ let prefsIncognito;
*/ */
let prefsChromeExtension; let prefsChromeExtension;
/**
* An example Javascript pref for android_sms notification setting.
* @type {SiteSettingsPref}
*/
let prefsAndroidSms;
/** /**
* Creates all the test |SiteSettingsPref|s that are needed for the tests in * Creates all the test |SiteSettingsPref|s that are needed for the tests in
* this file. They are populated after test setup in order to access the * this file. They are populated after test setup in order to access the
...@@ -248,16 +263,6 @@ function populateTestExceptions() { ...@@ -248,16 +263,6 @@ function populateTestExceptions() {
prefsGeolocationEmpty = test_util.createSiteSettingsPrefs([], []); prefsGeolocationEmpty = test_util.createSiteSettingsPrefs([], []);
prefsAndroidSms = test_util.createSiteSettingsPrefs(
[], [test_util.createContentSettingTypeToValuePair(
settings.ContentSettingsTypes.NOTIFICATIONS, [
// android sms setting.
test_util.createRawSiteException(
android_info.TEST_ANDROID_SMS_ORIGIN),
// Non android sms setting that should be handled as usual.
test_util.createRawSiteException('http://bar.com')
])]);
prefsNativeFileSystemWrite = test_util.createSiteSettingsPrefs( prefsNativeFileSystemWrite = test_util.createSiteSettingsPrefs(
[], [test_util.createContentSettingTypeToValuePair( [], [test_util.createContentSettingTypeToValuePair(
settings.ContentSettingsTypes.NATIVE_FILE_SYSTEM_WRITE, settings.ContentSettingsTypes.NATIVE_FILE_SYSTEM_WRITE,
...@@ -279,14 +284,13 @@ suite('SiteList', function() { ...@@ -279,14 +284,13 @@ suite('SiteList', function() {
*/ */
let browserProxy = null; let browserProxy = null;
/**
* Mock AndroidInfoBrowserProxy to use during test.
* @type {TestAndroidInfoBrowserProxy}
*/
let androidInfoBrowserProxy = null;
suiteSetup(function() { suiteSetup(function() {
CrSettingsPrefs.setInitialized(); // clang-format off
/* #ignore */ PolymerTest.importHtml(
/* #ignore */ 'chrome://settings/prefs/prefs_types.html').then(() => {
CrSettingsPrefs.setInitialized();
/* #ignore */ });
// clang-format on
}); });
suiteTeardown(function() { suiteTeardown(function() {
...@@ -303,11 +307,6 @@ suite('SiteList', function() { ...@@ -303,11 +307,6 @@ suite('SiteList', function() {
testElement = document.createElement('site-list'); testElement = document.createElement('site-list');
testElement.searchFilter = ''; testElement.searchFilter = '';
document.body.appendChild(testElement); document.body.appendChild(testElement);
if (cr.isChromeOS) {
androidInfoBrowserProxy = new android_info.TestAndroidInfoBrowserProxy();
settings.AndroidInfoBrowserProxyImpl.instance_ = androidInfoBrowserProxy;
}
}); });
teardown(function() { teardown(function() {
...@@ -315,13 +314,6 @@ suite('SiteList', function() { ...@@ -315,13 +314,6 @@ suite('SiteList', function() {
// The code being tested changes the Route. Reset so that state is not // The code being tested changes the Route. Reset so that state is not
// leaked across tests. // leaked across tests.
settings.Router.getInstance().resetRouteForTesting(); settings.Router.getInstance().resetRouteForTesting();
if (cr.isChromeOS) {
// Reset multidevice enabled flag.
loadTimeData.overrideValues({
multideviceAllowedByPolicy: false
});
}
}); });
/** /**
...@@ -406,60 +398,6 @@ suite('SiteList', function() { ...@@ -406,60 +398,6 @@ suite('SiteList', function() {
}); });
}); });
if (cr.isChromeOS) {
test('update androidSmsInfo', function() {
setUpCategory(
settings.ContentSettingsTypes.NOTIFICATIONS,
settings.ContentSetting.ALLOW, prefsAndroidSms);
assertEquals(
0, androidInfoBrowserProxy.getCallCount('getAndroidSmsInfo'));
loadTimeData.overrideValues({multideviceAllowedByPolicy: true});
setUpCategory(
settings.ContentSettingsTypes.NOTIFICATIONS,
settings.ContentSetting.ALLOW, prefsAndroidSms);
// Assert 2 calls since the observer observes 2 properties.
assertEquals(
2, androidInfoBrowserProxy.getCallCount('getAndroidSmsInfo'));
return androidInfoBrowserProxy.whenCalled('getAndroidSmsInfo')
.then(() => browserProxy.whenCalled('getExceptionList'))
.then((contentType) => {
assertEquals(
settings.ContentSettingsTypes.NOTIFICATIONS, contentType);
assertEquals(2, testElement.sites.length);
assertEquals(
prefsAndroidSms.exceptions[contentType][0].origin,
testElement.sites[0].origin);
assertTrue(testElement.sites[0].showAndroidSmsNote);
assertEquals(
prefsAndroidSms.exceptions[contentType][1].origin,
testElement.sites[1].origin);
assertEquals(undefined, testElement.sites[1].showAndroidSmsNote);
browserProxy.resetResolver('getExceptionList');
return browserProxy.whenCalled('getExceptionList');
})
.then((contentType) => {
assertEquals(
settings.ContentSettingsTypes.NOTIFICATIONS, contentType);
assertEquals(2, testElement.sites.length);
assertEquals(
prefsAndroidSms.exceptions[contentType][0].origin,
testElement.sites[0].origin);
assertEquals(undefined, testElement.sites[0].showAndroidSmsNote);
assertEquals(
prefsAndroidSms.exceptions[contentType][1].origin,
testElement.sites[1].origin);
assertEquals(undefined, testElement.sites[1].showAndroidSmsNote);
});
});
}
test('getExceptionList API used', function() { test('getExceptionList API used', function() {
setUpCategory( setUpCategory(
settings.ContentSettingsTypes.GEOLOCATION, settings.ContentSettingsTypes.GEOLOCATION,
...@@ -622,10 +560,6 @@ suite('SiteList', function() { ...@@ -622,10 +560,6 @@ suite('SiteList', function() {
Polymer.dom.flush(); Polymer.dom.flush();
assertEquals(2, list.querySelector('iron-list').items.length); assertEquals(2, list.querySelector('iron-list').items.length);
assertTrue(hasAnIncognito(list)); assertTrue(hasAnIncognito(list));
assertTrue(Array.from(list.querySelectorAll('site-list-entry'))
.some(
entry => entry.$.siteDescription.textContent ==
'Current incognito session'));
browserProxy.resetResolver('getExceptionList'); browserProxy.resetResolver('getExceptionList');
browserProxy.setIncognito(false); browserProxy.setIncognito(false);
return browserProxy.whenCalled('getExceptionList'); return browserProxy.whenCalled('getExceptionList');
...@@ -1041,6 +975,9 @@ suite('EditExceptionDialog', function() { ...@@ -1041,6 +975,9 @@ suite('EditExceptionDialog', function() {
*/ */
let cookieException; let cookieException;
/** @type {SiteSettingsPrefsBrowserProxy} */
let browserProxy;
setup(function() { setup(function() {
cookieException = { cookieException = {
category: settings.ContentSettingsTypes.COOKIES, category: settings.ContentSettingsTypes.COOKIES,
...@@ -1129,6 +1066,9 @@ suite('EditExceptionDialog', function() { ...@@ -1129,6 +1066,9 @@ suite('EditExceptionDialog', function() {
suite('AddExceptionDialog', function() { suite('AddExceptionDialog', function() {
/** @type {AddSiteDialogElement} */ let dialog; /** @type {AddSiteDialogElement} */ let dialog;
/** @type {SiteSettingsPrefsBrowserProxy} */
let browserProxy;
setup(function() { setup(function() {
populateTestExceptions(); populateTestExceptions();
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// clang-format off
// #import {AndroidInfoBrowserProxyImpl,ContentSetting,ContentSettingsTypes,SiteSettingsPrefsBrowserProxyImpl} from 'chrome://settings/lazy_load.js';
// #import {createContentSettingTypeToValuePair,createRawSiteException,createSiteSettingsPrefs} from 'chrome://test/settings/test_util.m.js';
// #import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
// #import {Router} from 'chrome://settings/settings.js';
// #import {TestAndroidInfoBrowserProxy, TEST_ANDROID_SMS_ORIGIN} from 'chrome://test/settings/test_android_info_browser_proxy.m.js';
// #import {TestSiteSettingsPrefsBrowserProxy} from 'chrome://test/settings/test_site_settings_prefs_browser_proxy.m.js';
// clang-format on
suite('SiteListChromeOS', function() {
/**
* A site list element created before each test.
* @type {SiteList}
*/
let testElement;
/**
* The mock proxy object to use during test.
* @type {TestSiteSettingsPrefsBrowserProxy}
*/
let browserProxy = null;
/**
* Mock AndroidInfoBrowserProxy to use during test.
* @type {TestAndroidInfoBrowserProxy}
*/
let androidInfoBrowserProxy = null;
/**
* An example Javascript pref for android_sms notification setting.
* @type {SiteSettingsPref}
*/
let prefsAndroidSms;
// Initialize a site-list before each test.
setup(function() {
prefsAndroidSms = test_util.createSiteSettingsPrefs(
[], [test_util.createContentSettingTypeToValuePair(
settings.ContentSettingsTypes.NOTIFICATIONS, [
// android sms setting.
test_util.createRawSiteException(
android_info.TEST_ANDROID_SMS_ORIGIN),
// Non android sms setting that should be handled as usual.
test_util.createRawSiteException('http://bar.com')
])]);
browserProxy = new TestSiteSettingsPrefsBrowserProxy();
settings.SiteSettingsPrefsBrowserProxyImpl.instance_ = browserProxy;
androidInfoBrowserProxy = new android_info.TestAndroidInfoBrowserProxy();
settings.AndroidInfoBrowserProxyImpl.instance_ = androidInfoBrowserProxy;
PolymerTest.clearBody();
testElement = document.createElement('site-list');
testElement.searchFilter = '';
document.body.appendChild(testElement);
});
teardown(function() {
// The code being tested changes the Route. Reset so that state is not
// leaked across tests.
settings.Router.getInstance().resetRouteForTesting();
// Reset multidevice enabled flag.
loadTimeData.overrideValues({multideviceAllowedByPolicy: false});
});
/** Configures the test element. */
function setUpAndroidSmsNotifications() {
browserProxy.setPrefs(prefsAndroidSms);
testElement.categorySubtype = settings.ContentSetting.ALLOW;
// Some route is needed, but the actual route doesn't matter.
testElement.currentRoute = {
page: 'dummy',
section: 'privacy',
subpage: ['site-settings', 'site-settings-category-location'],
};
testElement.category = settings.ContentSettingsTypes.NOTIFICATIONS;
}
test('update androidSmsInfo', function() {
setUpAndroidSmsNotifications();
assertEquals(0, androidInfoBrowserProxy.getCallCount('getAndroidSmsInfo'));
loadTimeData.overrideValues({multideviceAllowedByPolicy: true});
setUpAndroidSmsNotifications();
// Assert 2 calls since the observer observes 2 properties.
assertEquals(2, androidInfoBrowserProxy.getCallCount('getAndroidSmsInfo'));
return Promise
.all([
androidInfoBrowserProxy.whenCalled('getAndroidSmsInfo'),
browserProxy.whenCalled('getExceptionList'),
])
.then(results => {
const contentType = results[1];
Polymer.dom.flush();
assertEquals(
settings.ContentSettingsTypes.NOTIFICATIONS, contentType);
assertEquals(2, testElement.sites.length);
assertEquals(
prefsAndroidSms.exceptions[contentType][0].origin,
testElement.sites[0].origin);
assertTrue(testElement.sites[0].showAndroidSmsNote);
assertEquals(
prefsAndroidSms.exceptions[contentType][1].origin,
testElement.sites[1].origin);
assertEquals(undefined, testElement.sites[1].showAndroidSmsNote);
});
});
});
...@@ -2,14 +2,18 @@ ...@@ -2,14 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// clang-format off
// #import {TestBrowserProxy} from 'chrome://test/test_browser_proxy.m.js';
// clang-format on
cr.define('android_info', function() { cr.define('android_info', function() {
/** /**
* Test value for messages for web permissions origin. * Test value for messages for web permissions origin.
*/ */
const TEST_ANDROID_SMS_ORIGIN = 'http://foo.com'; /* #export */ const TEST_ANDROID_SMS_ORIGIN = 'http://foo.com';
/** @implements {settings.AndroidInfoBrowserProxy} */ /** @implements {settings.AndroidInfoBrowserProxy} */
class TestAndroidInfoBrowserProxy extends TestBrowserProxy { /* #export */ class TestAndroidInfoBrowserProxy extends TestBrowserProxy {
constructor() { constructor() {
super([ super([
'getAndroidSmsInfo', 'getAndroidSmsInfo',
...@@ -24,6 +28,7 @@ cr.define('android_info', function() { ...@@ -24,6 +28,7 @@ cr.define('android_info', function() {
} }
} }
// #cr_define_end
return { return {
TestAndroidInfoBrowserProxy: TestAndroidInfoBrowserProxy, TestAndroidInfoBrowserProxy: TestAndroidInfoBrowserProxy,
TEST_ANDROID_SMS_ORIGIN: TEST_ANDROID_SMS_ORIGIN, TEST_ANDROID_SMS_ORIGIN: TEST_ANDROID_SMS_ORIGIN,
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
// clang-format off // clang-format off
// #import {assert} from 'chrome://resources/js/assert.m.js';
// #import {ContentSetting} from 'chrome://settings/lazy_load.js'; // #import {ContentSetting} from 'chrome://settings/lazy_load.js';
// #import {createSiteSettingsPrefs, getContentSettingsTypeFromChooserType} from 'chrome://test/settings/test_util.m.js'; // #import {createSiteSettingsPrefs, getContentSettingsTypeFromChooserType} from 'chrome://test/settings/test_util.m.js';
// #import {TestBrowserProxy} from 'chrome://test/test_browser_proxy.m.js'; // #import {TestBrowserProxy} from 'chrome://test/test_browser_proxy.m.js';
......
...@@ -18,7 +18,8 @@ cr.define('test_util', function() { ...@@ -18,7 +18,8 @@ cr.define('test_util', function() {
* @param {Object} value The value to map to |contentType|. * @param {Object} value The value to map to |contentType|.
* @return {Object<setting: settings.ContentSettingsTypes, value: Object>} * @return {Object<setting: settings.ContentSettingsTypes, value: Object>}
*/ */
function createContentSettingTypeToValuePair(contentType, value) { /* #export */ function createContentSettingTypeToValuePair(
contentType, value) {
return {setting: contentType, value: value}; return {setting: contentType, value: value};
} }
...@@ -49,7 +50,7 @@ cr.define('test_util', function() { ...@@ -49,7 +50,7 @@ cr.define('test_util', function() {
* defaults in this function's return value. * defaults in this function's return value.
* @return {RawSiteException} * @return {RawSiteException}
*/ */
function createRawSiteException(origin, override) { /* #export */ function createRawSiteException(origin, override) {
if (override === undefined) { if (override === undefined) {
override = {}; 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