Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(890)

Unified Diff: chrome/test/data/webui/settings/chrome_cleanup_page_test.js

Issue 2971823002: Cleanup Tool WebUI: Add logs upload checkbox and minor polishing (Closed)
Patch Set: Minor fixes Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« chrome/common/url_constants.cc ('K') | « chrome/common/url_constants.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webui/settings/chrome_cleanup_page_test.js
diff --git a/chrome/test/data/webui/settings/chrome_cleanup_page_test.js b/chrome/test/data/webui/settings/chrome_cleanup_page_test.js
index 9af4c293c1546769c4ce878962d52b84baef971f..967e9c1c1bafd03174ae35c8a797525967fe9aab 100644
--- a/chrome/test/data/webui/settings/chrome_cleanup_page_test.js
+++ b/chrome/test/data/webui/settings/chrome_cleanup_page_test.js
@@ -12,6 +12,7 @@ var TestChromeCleanupProxy = function() {
'dismissCleanupPage',
'registerChromeCleanerObserver',
'restartComputer',
+ 'setLogsUploadPermission',
'startCleanup',
]);
};
@@ -35,9 +36,14 @@ TestChromeCleanupProxy.prototype = {
},
/** @override */
- startCleanup: function() {
- this.methodCalled('startCleanup');
+ setLogsUploadPermission: function(enabled) {
+ this.methodCalled('setLogsUploadPermission', enabled);
},
+
+ /** @override */
+ startCleanup: function(logs_upload_enabled) {
+ this.methodCalled('startCleanup', logs_upload_enabled);
+ }
};
var chromeCleanupPage = null;
@@ -61,6 +67,7 @@ suite('ChromeCleanupHandler', function() {
});
test('startCleanupFromInfected', function() {
+ cr.webUIListenerCallback('chrome-cleanup-upload-permission-change', false);
cr.webUIListenerCallback(
'chrome-cleanup-on-infected', ['file 1', 'file 2', 'file 3']);
Polymer.dom.flush();
@@ -75,13 +82,15 @@ suite('ChromeCleanupHandler', function() {
var actionButton = chromeCleanupPage.$$('#action-button');
assertTrue(!!actionButton);
MockInteractions.tap(actionButton);
- ChromeCleanupProxy.whenCalled('startCleanup').then(function() {
- cr.webUIListenerCallback('chrome-cleanup-on-cleaning', false);
- Polymer.dom.flush();
-
- var spinner = chromeCleanupPage.$$('#cleaning-spinner');
- assertTrue(spinner.active);
- })
+ ChromeCleanupProxy.whenCalled('startCleanup').then(
+ function(logs_upload_enabled) {
ftirelo 2017/07/05 19:02:26 logsUploadEnabled?
proberge 2017/07/05 20:14:21 Done.
+ assertFalse(logs_upload_enabled);
+ cr.webUIListenerCallback('chrome-cleanup-on-cleaning', false);
+ Polymer.dom.flush();
+
+ var spinner = chromeCleanupPage.$$('#cleaning-spinner');
+ assertTrue(spinner.active);
+ })
});
test('rebootFromRebootRequired', function() {
@@ -119,4 +128,32 @@ suite('ChromeCleanupHandler', function() {
MockInteractions.tap(actionButton);
return ChromeCleanupProxy.whenCalled('dismissCleanupPage');
});
+
+ test('setLogsUploadPermission', function() {
+ cr.webUIListenerCallback(
+ 'chrome-cleanup-on-infected', ['file 1', 'file 2', 'file 3']);
+ Polymer.dom.flush();
+
+ var control = chromeCleanupPage.$$('#logsUploadControl');
+ assertTrue(!!control);
+
+ cr.webUIListenerCallback('chrome-cleanup-upload-permission-change', true);
+ Polymer.dom.flush();
+ assertTrue(control.checked);
+
+ cr.webUIListenerCallback('chrome-cleanup-upload-permission-change', false);
+ Polymer.dom.flush();
+ assertFalse(control.checked);
+
+ // TODO(proberge): This tap doesn't seem to do anything and the test hangs
+ // on the whenCalled below.
+ // Manually clicking on the control if pixel-output is enabled resolves the
+ // whenCalled and successfully completes the test.
+ MockInteractions.tap(control);
+
+ return ChromeCleanupProxy.whenCalled('setLogsUploadPermission').then(
+ function(enabled) {
+ assertTrue(enabled);
+ });
+ });
});
« chrome/common/url_constants.cc ('K') | « chrome/common/url_constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698