Commit ca9704e4 authored by Thomas Tangl's avatar Thomas Tangl Committed by Commit Bot

Fix CrSettingsMetricsReportingTest.All

Replace the settings-privacy-page element with a
settings-personalization-options element.
(The code for the metrics reporting was moved to
settings-personalization-options as part of
UnifiedConsent.)

Bug: 960259
Change-Id: I919248f4078bbca438611fc0e64da907fe86ef2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1604269
Auto-Submit: Thomas Tangl <tangltom@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Commit-Queue: Thomas Tangl <tangltom@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658525}
parent 0bc6fd5c
...@@ -2059,8 +2059,7 @@ CrSettingsMetricsReportingTest.prototype = { ...@@ -2059,8 +2059,7 @@ CrSettingsMetricsReportingTest.prototype = {
]), ]),
}; };
// TODO(crbug.com/960259): Broken with UnifiedConsent. TEST_F('CrSettingsMetricsReportingTest', 'All', function() {
TEST_F('CrSettingsMetricsReportingTest', 'DISABLED_All', function() {
mocha.run(); mocha.run();
}); });
......
...@@ -13,7 +13,7 @@ suite('metrics reporting', function() { ...@@ -13,7 +13,7 @@ suite('metrics reporting', function() {
testBrowserProxy = new TestPrivacyPageBrowserProxy(); testBrowserProxy = new TestPrivacyPageBrowserProxy();
settings.PrivacyPageBrowserProxyImpl.instance_ = testBrowserProxy; settings.PrivacyPageBrowserProxyImpl.instance_ = testBrowserProxy;
PolymerTest.clearBody(); PolymerTest.clearBody();
page = document.createElement('settings-privacy-page'); page = document.createElement('settings-personalization-options');
document.body.appendChild(page); document.body.appendChild(page);
}); });
...@@ -28,8 +28,7 @@ suite('metrics reporting', function() { ...@@ -28,8 +28,7 @@ suite('metrics reporting', function() {
return PolymerTest.flushTasks(); return PolymerTest.flushTasks();
}) })
.then(function() { .then(function() {
const control = page.$$('settings-personalization-options') const control = page.$.metricsReportingControl;
.$.metricsReportingControl;
assertEquals( assertEquals(
testBrowserProxy.metricsReporting.enabled, control.checked); testBrowserProxy.metricsReporting.enabled, control.checked);
assertEquals( assertEquals(
...@@ -62,7 +61,7 @@ suite('metrics reporting', function() { ...@@ -62,7 +61,7 @@ suite('metrics reporting', function() {
Polymer.dom.flush(); Polymer.dom.flush();
// Restart button should be hidden by default (in any state). // Restart button should be hidden by default (in any state).
assertFalse(!!page.$$('settings-personalization-options').$$('#restart')); assertFalse(!!page.$$('#restart'));
// Simulate toggling via policy. // Simulate toggling via policy.
cr.webUIListenerCallback('metrics-reporting-change', { cr.webUIListenerCallback('metrics-reporting-change', {
...@@ -71,7 +70,7 @@ suite('metrics reporting', function() { ...@@ -71,7 +70,7 @@ suite('metrics reporting', function() {
}); });
// No restart button should show because the value is managed. // No restart button should show because the value is managed.
assertFalse(!!page.$$('settings-personalization-options').$$('#restart')); assertFalse(!!page.$$('#restart'));
cr.webUIListenerCallback('metrics-reporting-change', { cr.webUIListenerCallback('metrics-reporting-change', {
enabled: true, enabled: true,
...@@ -81,7 +80,7 @@ suite('metrics reporting', function() { ...@@ -81,7 +80,7 @@ suite('metrics reporting', function() {
// Changes in policy should not show the restart button because the value // Changes in policy should not show the restart button because the value
// is still managed. // is still managed.
assertFalse(!!page.$$('settings-personalization-options').$$('#restart')); assertFalse(!!page.$$('#restart'));
// Remove the policy and toggle the value. // Remove the policy and toggle the value.
cr.webUIListenerCallback('metrics-reporting-change', { cr.webUIListenerCallback('metrics-reporting-change', {
...@@ -91,7 +90,7 @@ suite('metrics reporting', function() { ...@@ -91,7 +90,7 @@ suite('metrics reporting', function() {
Polymer.dom.flush(); Polymer.dom.flush();
// Now the restart button should be showing. // Now the restart button should be showing.
assertTrue(!!page.$$('settings-personalization-options').$$('#restart')); assertTrue(!!page.$$('#restart'));
// Receiving the same values should have no effect. // Receiving the same values should have no effect.
cr.webUIListenerCallback('metrics-reporting-change', { cr.webUIListenerCallback('metrics-reporting-change', {
...@@ -99,7 +98,7 @@ suite('metrics reporting', function() { ...@@ -99,7 +98,7 @@ suite('metrics reporting', function() {
managed: false, managed: false,
}); });
Polymer.dom.flush(); Polymer.dom.flush();
assertTrue(!!page.$$('settings-personalization-options').$$('#restart')); assertTrue(!!page.$$('#restart'));
}); });
}); });
}); });
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