Commit 1347e7c0 authored by dpapad's avatar dpapad Committed by Commit Bot

Settings: Port privacy_page_test.js to Polymer3.

Bug: 1026426
Change-Id: Ife93a1eceedd067cbb6fbfd8fd08197f0ef54ad6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2128926Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Auto-Submit: dpapad <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755035}
parent 9194030c
...@@ -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/pref_util_tests.m.js", "$root_gen_dir/chrome/test/data/webui/settings/pref_util_tests.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/prefs_test_cases.m.js", "$root_gen_dir/chrome/test/data/webui/settings/prefs_test_cases.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/prefs_tests.m.js", "$root_gen_dir/chrome/test/data/webui/settings/prefs_tests.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/privacy_page_test.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/protocol_handlers_tests.m.js", "$root_gen_dir/chrome/test/data/webui/settings/protocol_handlers_tests.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/recent_site_permissions_test.m.js", "$root_gen_dir/chrome/test/data/webui/settings/recent_site_permissions_test.m.js",
"$root_gen_dir/chrome/test/data/webui/settings/reset_page_test.m.js", "$root_gen_dir/chrome/test/data/webui/settings/reset_page_test.m.js",
......
...@@ -51,6 +51,7 @@ js_modulizer("modulize") { ...@@ -51,6 +51,7 @@ js_modulizer("modulize") {
"prefs_test_cases.js", "prefs_test_cases.js",
"prefs_tests.js", "prefs_tests.js",
"pref_util_tests.js", "pref_util_tests.js",
"privacy_page_test.js",
"protocol_handlers_tests.js", "protocol_handlers_tests.js",
"recent_site_permissions_test.js", "recent_site_permissions_test.js",
"reset_page_test.js", "reset_page_test.js",
......
...@@ -297,6 +297,64 @@ TEST_F('CrSettingsPersonalizationOptionsV3Test', 'AllBuildsOld', function() { ...@@ -297,6 +297,64 @@ TEST_F('CrSettingsPersonalizationOptionsV3Test', 'AllBuildsOld', function() {
runMochaSuite('PersonalizationOptionsTests_AllBuilds_Old'); runMochaSuite('PersonalizationOptionsTests_AllBuilds_Old');
}); });
// eslint-disable-next-line no-var
var CrSettingsPrivacyPageV3Test = class extends CrSettingsV3BrowserTest {
/** @override */
get browsePreload() {
return 'chrome://settings/test_loader.html?module=settings/privacy_page_test.m.js';
}
};
TEST_F('CrSettingsPrivacyPageV3Test', 'PrivacyPageTests', function() {
runMochaSuite('PrivacyPage');
});
TEST_F('CrSettingsPrivacyPageV3Test', 'PrivacyPageRedesignTests', function() {
runMochaSuite('PrivacyPageRedesignEnabled');
});
// TODO(crbug.com/1043665): flaky crash on Linux Tests (dbg).
TEST_F(
'CrSettingsPrivacyPageV3Test', 'DISABLED_PrivacyPageSoundTests',
function() {
runMochaSuite('PrivacyPageSound');
});
// TODO(sauski): Privacy page UMA changing, tests need updating/removal.
TEST_F('CrSettingsPrivacyPageV3Test', 'DISABLED_UMALoggingTests', function() {
runMochaSuite('PrivacyPageUMACheck');
});
GEN('#if defined(OS_MACOSX) || defined(OS_WIN)');
// TODO(crbug.com/1043665): disabling due to failures on several builders.
TEST_F(
'CrSettingsPrivacyPageV3Test', 'DISABLED_CertificateManagerTests',
function() {
runMochaSuite('NativeCertificateManager');
});
GEN('#endif');
// eslint-disable-next-line no-var
var CrSettingsPrivacyPageRedesignV3Test =
class extends CrSettingsV3BrowserTest {
/** @override */
get browsePreload() {
return 'chrome://settings/test_loader.html?module=settings/privacy_page_test.m.js';
}
get featureList() {
const list = super.featureList;
list.enabled.push('features::kPrivacySettingsRedesign');
return list;
}
};
TEST_F(
'CrSettingsPrivacyPageRedesignV3Test', 'HappinessTrackingSurveysTests',
function() {
runMochaSuite('HappinessTrackingSurveys');
});
[['AllSites', 'all_sites_tests.m.js'], [['AllSites', 'all_sites_tests.m.js'],
['AppearanceFontsPage', 'appearance_fonts_page_test.m.js'], ['AppearanceFontsPage', 'appearance_fonts_page_test.m.js'],
['AppearancePage', 'appearance_page_test.m.js'], ['AppearancePage', 'appearance_page_test.m.js'],
......
...@@ -2,6 +2,20 @@ ...@@ -2,6 +2,20 @@
// 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 {SiteSettingsPrefsBrowserProxyImpl} from 'chrome://settings/lazy_load.js';
// #import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
// #import {MetricsBrowserProxyImpl, PrivacyElementInteractions, PrivacyPageBrowserProxyImpl, SyncBrowserProxyImpl, HatsBrowserProxyImpl, Router, routes} from 'chrome://settings/settings.js';
// #import {TestMetricsBrowserProxy} from 'chrome://test/settings/test_metrics_browser_proxy.m.js';
// #import {TestPrivacyPageBrowserProxy} from 'chrome://test/settings/test_privacy_page_browser_proxy.m.js';
// #import {TestSyncBrowserProxy} from 'chrome://test/settings/test_sync_browser_proxy.m.js';
// #import {TestHatsBrowserProxy} from 'chrome://test/settings/test_hats_browser_proxy.m.js';
// #import {TestSiteSettingsPrefsBrowserProxy} from 'chrome://test/settings/test_site_settings_prefs_browser_proxy.m.js';
// #import {isMac, isWindows} from 'chrome://resources/js/cr.m.js';
// #import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
// #import {whenAttributeIs, flushTasks, isChildVisible} from 'chrome://test/test_util.m.js';
// clang-format on
suite('PrivacyPageUMACheck', function() { suite('PrivacyPageUMACheck', function() {
/** @type {settings.TestPrivacyPageBrowserProxy} */ /** @type {settings.TestPrivacyPageBrowserProxy} */
let testBrowserProxy; let testBrowserProxy;
...@@ -125,7 +139,7 @@ suite('PrivacyPage', function() { ...@@ -125,7 +139,7 @@ suite('PrivacyPage', function() {
setup(async function() { setup(async function() {
PolymerTest.clearBody(); PolymerTest.clearBody();
await settings.forceLazyLoaded(); /* #ignore */ await settings.forceLazyLoaded();
const testBrowserProxy = new TestPrivacyPageBrowserProxy(); const testBrowserProxy = new TestPrivacyPageBrowserProxy();
settings.PrivacyPageBrowserProxyImpl.instance_ = testBrowserProxy; settings.PrivacyPageBrowserProxyImpl.instance_ = testBrowserProxy;
......
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