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

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: Address review comments on #3, simplify idle error cases 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
« no previous file with comments | « 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..6472b7c4dd5cfcd984f1cca3a17842b1ff653283 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(logsUploadEnabled) {
+ this.methodCalled('startCleanup', logsUploadEnabled);
+ }
};
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(logsUploadEnabled) {
+ assertFalse(logsUploadEnabled);
+ cr.webUIListenerCallback('chrome-cleanup-on-cleaning', false);
+ Polymer.dom.flush();
+
+ var spinner = chromeCleanupPage.$$('#cleaning-spinner');
+ assertTrue(spinner.active);
+ })
});
test('rebootFromRebootRequired', function() {
@@ -119,4 +128,24 @@ 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.$$('#chromeCleanupLogsUploadControl');
+ 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): Mock tapping on |control| and verify that
+ // |setLogsUploadPermission| is called with the right argument.
+ });
});
« no previous file with comments | « chrome/common/url_constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698