Commit 98ed1184 authored by Sean Harrison's avatar Sean Harrison Committed by Commit Bot

Re-enable CrSettingsPrivacyPageTest.UMALoggingTests

Merge all Privacy page logging tests into one test

Test flakiness of UMA logging tests appears to be related to intermittent timeouts.

This has been fixed by merging all tests in the suite into one test that navigates around the privacy card instead of separate tests that reinstantiate the browser for each test in the suite, dramatically speeding up the whole test suite.

Bug: 1043665
Change-Id: I3332516923dfbfa780fc1dee1561ecdd15bd0774
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2027333
Commit-Queue: Sean Harrison <harrisonsean@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738920}
parent ece6d7d9
......@@ -930,8 +930,7 @@ TEST_F('CrSettingsPrivacyPageTest', 'PrivacyPageSecureDnsTests', function() {
mocha.run();
});
// TODO(crbug.com/1043665): flaky crash on Linux Tests (dbg).
TEST_F('CrSettingsPrivacyPageTest', 'DISABLED_UMALoggingTests', function() {
TEST_F('CrSettingsPrivacyPageTest', 'UMALoggingTests', function() {
settings_privacy_page.registerUMALoggingTests();
mocha.run();
});
......
......@@ -166,75 +166,69 @@ cr.define('settings_privacy_page', function() {
{enabled: {value: true}, scout_reporting_enabled: {value: true}},
};
document.body.appendChild(page);
Polymer.dom.flush();
});
teardown(function() {
page.remove();
});
test('LogMangeCerfificatesClick', function() {
test('LogAllPrivacyPageClicks', async function() {
page.$$('#manageCertificates').click();
return testMetricsBrowserProxy.whenCalled('recordSettingsPageHistogram')
.then(result => {
assertEquals(
settings.SettingsPageInteractions.PRIVACY_MANAGE_CERTIFICATES,
result);
});
});
let result = await testMetricsBrowserProxy.whenCalled(
'recordSettingsPageHistogram');
assertEquals(
settings.SettingsPageInteractions.PRIVACY_MANAGE_CERTIFICATES,
result);
test('LogClearBrowsingClick', function() {
page.$$('#clearBrowsingData').click();
return testMetricsBrowserProxy.whenCalled('recordSettingsPageHistogram')
.then(result => {
assertEquals(
settings.SettingsPageInteractions.PRIVACY_CLEAR_BROWSING_DATA,
result);
});
});
settings.Router.getInstance().navigateTo(settings.routes.PRIVACY);
testMetricsBrowserProxy.reset();
test('LogDoNotTrackClick', function() {
page.$$('#doNotTrack').click();
return testMetricsBrowserProxy.whenCalled('recordSettingsPageHistogram')
.then(result => {
assertEquals(
settings.SettingsPageInteractions.PRIVACY_DO_NOT_TRACK,
result);
});
});
result = await testMetricsBrowserProxy.whenCalled(
'recordSettingsPageHistogram');
assertEquals(
settings.SettingsPageInteractions.PRIVACY_DO_NOT_TRACK, result);
settings.Router.getInstance().navigateTo(settings.routes.PRIVACY);
testMetricsBrowserProxy.reset();
test('LogCanMakePaymentToggleClick', function() {
page.$$('#canMakePaymentToggle').click();
return testMetricsBrowserProxy.whenCalled('recordSettingsPageHistogram')
.then(result => {
assertEquals(
settings.SettingsPageInteractions.PRIVACY_PAYMENT_METHOD,
result);
});
});
result = await testMetricsBrowserProxy.whenCalled(
'recordSettingsPageHistogram');
assertEquals(
settings.SettingsPageInteractions.PRIVACY_PAYMENT_METHOD, result);
settings.Router.getInstance().navigateTo(settings.routes.PRIVACY);
testMetricsBrowserProxy.reset();
test('LogSiteSettingsSubpageClick', function() {
page.$$('#site-settings-subpage-trigger').click();
return testMetricsBrowserProxy.whenCalled('recordSettingsPageHistogram')
.then(result => {
assertEquals(
settings.SettingsPageInteractions.PRIVACY_SITE_SETTINGS,
result);
});
});
result = await testMetricsBrowserProxy.whenCalled(
'recordSettingsPageHistogram');
assertEquals(
settings.SettingsPageInteractions.PRIVACY_SITE_SETTINGS, result);
settings.Router.getInstance().navigateTo(settings.routes.PRIVACY);
testMetricsBrowserProxy.reset();
test('LogSafeBrowsingToggleClick', function() {
Polymer.dom.flush();
page.$$('#safeBrowsingToggle').click();
result = await testMetricsBrowserProxy.whenCalled(
'recordSettingsPageHistogram');
assertEquals(
settings.SettingsPageInteractions.PRIVACY_SAFE_BROWSING, result);
});
test('LogDoNotTrackClick', function() {
page.$$('#doNotTrack').click();
return testMetricsBrowserProxy.whenCalled('recordSettingsPageHistogram')
.then(result => {
assertEquals(
settings.SettingsPageInteractions.PRIVACY_SAFE_BROWSING,
settings.SettingsPageInteractions.PRIVACY_DO_NOT_TRACK,
result);
});
});
test('LogSafeBrowsingReportingToggleClick', function() {
Polymer.dom.flush();
page.$$('#safeBrowsingReportingToggle').click();
return testMetricsBrowserProxy.whenCalled('recordSettingsPageHistogram')
.then(result => {
......
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