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

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

Issue 2413623004: MD Settings: allow changing to GTK+ theme on Linux (Closed)
Patch Set: rejigger tests Created 4 years, 2 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
Index: chrome/test/data/webui/settings/appearance_page_test.js
diff --git a/chrome/test/data/webui/settings/appearance_page_test.js b/chrome/test/data/webui/settings/appearance_page_test.js
index 425f21743bd114a15312e59e218e7a63f1be39fc..4d62dbe9231a01ac16c418570bfcc6ac5ec86e83 100644
--- a/chrome/test/data/webui/settings/appearance_page_test.js
+++ b/chrome/test/data/webui/settings/appearance_page_test.js
@@ -14,25 +14,20 @@ cr.define('settings_appearance', function() {
*/
var TestAppearanceBrowserProxy = function() {
settings.TestBrowserProxy.call(this, [
- 'getResetThemeEnabled',
+ 'getThemeInfo',
'openWallpaperManager',
- 'resetTheme',
+ 'useDefaultTheme',
+ 'useSystemTheme',
]);
-
- /**
- * @type {boolean}
- * @private
- */
- this.allowResetTheme_ = false;
};
TestAppearanceBrowserProxy.prototype = {
__proto__: settings.TestBrowserProxy.prototype,
/** @override */
- getResetThemeEnabled: function() {
- this.methodCalled('getResetThemeEnabled');
- return Promise.resolve(this.allowResetTheme_);
+ getThemeInfo: function(themeId) {
+ this.methodCalled('getThemeInfo', themeId);
+ return Promise.resolve({name: 'Sports car red'});
},
/** @override */
@@ -41,18 +36,14 @@ cr.define('settings_appearance', function() {
},
/** @override */
- resetTheme: function() {
- this.methodCalled('resetTheme');
+ useDefaultTheme: function() {
+ this.methodCalled('useDefaultTheme');
},
- /**
- * @param {boolean} isEnabled Whether the user reset the theme.
- */
- setAllowResetTheme: function(isEnabled) {
- this.allowResetTheme_ = isEnabled;
- cr.webUIListenerCallback('reset-theme-enabled-changed', isEnabled);
- Polymer.dom.flush();
- }
+ /** @override */
+ useSystemTheme: function() {
+ this.methodCalled('useSystemTheme');
+ },
};
/**
@@ -110,7 +101,20 @@ cr.define('settings_appearance', function() {
PolymerTest.clearBody();
appearancePage = document.createElement('settings-appearance-page');
+ appearancePage.set('prefs', {
+ extensions: {
+ theme: {
+ id: {
+ value: 'asdf',
+ },
+ use_system: {
+ value: false,
+ },
+ },
+ },
+ });
document.body.appendChild(appearancePage);
+ Polymer.dom.flush();
});
teardown(function() { appearancePage.remove(); });
@@ -130,13 +134,23 @@ cr.define('settings_appearance', function() {
});
}
- test('resetTheme', function() {
- appearanceBrowserProxy.setAllowResetTheme(true);
- var button = appearancePage.$$('#resetTheme');
+ test('useDefaultTheme', function() {
+ var button = appearancePage.$$('#useDefault');
assertTrue(!!button);
MockInteractions.tap(button);
- return appearanceBrowserProxy.whenCalled('resetTheme');
+ return appearanceBrowserProxy.whenCalled('useDefaultTheme');
});
+
+ if (cr.isLinux && !cr.isChromeOS) {
+ test('useSystemTheme', function() {
+ Polymer.dom.flush();
+
+ var button = appearancePage.$$('#useSystem');
+ assertTrue(!!button);
+ MockInteractions.tap(button);
+ return appearanceBrowserProxy.whenCalled('useSystemTheme');
+ });
+ }
});
}

Powered by Google App Engine
This is Rietveld 408576698