Commit 808b68cf authored by rbpotter's avatar rbpotter Committed by Commit Bot

Settings: migrate zoom_levels_tests/metrics_reporting_tests to Polymer 3

Bug: 1026426
Change-Id: I46539fbff2ed19bcfd810235d2f9ec5798f33298
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2133301Reviewed-by: default avatardpapad <dpapad@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756007}
parent d1e7dab0
......@@ -242,6 +242,7 @@ js2gtest("browser_tests_js_webui") {
"$root_gen_dir/chrome/test/data/webui/settings/idle_load_tests.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/languages_tests.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/languages_page_tests.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/metrics_reporting_tests.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/on_startup_page_tests.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/password_check_test.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/passwords_and_autofill_fake_data.m.js",
......@@ -302,6 +303,7 @@ js2gtest("browser_tests_js_webui") {
"$root_gen_dir/chrome/test/data/webui/settings/test_site_settings_prefs_browser_proxy.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/test_sync_browser_proxy.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/test_util.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/zoom_levels_tests.m.js",
"$root_gen_dir/chrome/test/data/webui/test_browser_proxy.m.js",
"$root_gen_dir/chrome/test/data/webui/test_store.m.js",
"$root_gen_dir/chrome/test/data/webui/test_util.m.js",
......
......@@ -36,6 +36,7 @@ js_modulizer("modulize") {
"idle_load_tests.js",
"languages_page_tests.js",
"languages_tests.js",
"metrics_reporting_tests.js",
"on_startup_page_tests.js",
"passwords_leak_detection_toggle_test.js",
"passwords_and_autofill_fake_data.js",
......@@ -100,6 +101,7 @@ js_modulizer("modulize") {
"test_site_settings_prefs_browser_proxy.js",
"test_sync_browser_proxy.js",
"test_util.js",
"zoom_levels_tests.js",
]
if (is_win) {
input_files += [
......
......@@ -404,6 +404,7 @@ TEST_F(
['Subpage', 'settings_subpage_test.m.js'],
['Textarea', 'settings_textarea_tests.m.js'],
['ToggleButton', 'settings_toggle_button_tests.m.js'],
['ZoomLevels', 'zoom_levels_tests.m.js'],
].forEach(test => registerTest(...test));
GEN('#if defined(OS_CHROMEOS)');
......@@ -433,6 +434,10 @@ GEN('#if defined(OS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING)');
].forEach(test => registerTest(...test));
GEN('#endif // defined(OS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING)');
GEN('#if BUILDFLAG(GOOGLE_CHROME_BRANDING) && !defined(OS_CHROMEOS)');
registerTest('MetricsReporting', 'metrics_reporting_tests.m.js');
GEN('#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING) && !defined(OS_CHROMEOS)');
function registerTest(testName, module, caseName) {
const className = `CrSettings${testName}V3Test`;
this[className] = class extends CrSettingsV3BrowserTest {
......
......@@ -2,6 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// clang-format off
// #import {PrivacyPageBrowserProxyImpl} from 'chrome://settings/settings.js';
// #import 'chrome://settings/lazy_load.js';
// #import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
// #import {flushTasks} from 'chrome://test/test_util.m.js';
// #import {TestPrivacyPageBrowserProxy} from 'chrome://test/settings/test_privacy_page_browser_proxy.m.js';
// #import {webUIListenerCallback} from 'chrome://resources/js/cr.m.js';
// clang-format on
suite('metrics reporting', function() {
/** @type {settings.TestPrivacyPageBrowserProxy} */
let testBrowserProxy;
......
......@@ -2,6 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// clang-format off
// #import {SiteSettingsPrefsBrowserProxyImpl} from 'chrome://settings/lazy_load.js';
// #import {TestSiteSettingsPrefsBrowserProxy} from 'chrome://test/settings/test_site_settings_prefs_browser_proxy.m.js';
// #import {waitBeforeNextRender} from 'chrome://test/test_util.m.js';
// clang-format on
/** @fileoverview Suite of tests for zoom-levels. */
suite('ZoomLevels', function() {
/**
......@@ -40,7 +46,7 @@ suite('ZoomLevels', function() {
];
setup(async function() {
await settings.forceLazyLoaded();
/* #ignore */ await settings.forceLazyLoaded();
browserProxy = new TestSiteSettingsPrefsBrowserProxy();
settings.SiteSettingsPrefsBrowserProxyImpl.instance_ = browserProxy;
return initPage();
......@@ -94,7 +100,7 @@ suite('ZoomLevels', function() {
2, testElement.shadowRoot.querySelectorAll('.list-item').length);
const removeButton = getRemoveButton(testElement.$.listContainer, 0);
assert(!!removeButton);
assertTrue(!!removeButton);
removeButton.click();
return browserProxy.whenCalled('removeZoomLevel');
})
......
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