Chromium Code Reviews| 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 92c08a5dfc3acaa866e6c62289a422feab8a70f4..be7aab815c941f22bd7bbc430bb310bb45340fb8 100644 |
| --- a/chrome/test/data/webui/settings/appearance_page_test.js |
| +++ b/chrome/test/data/webui/settings/appearance_page_test.js |
| @@ -15,6 +15,7 @@ var TestAppearanceBrowserProxy = function() { |
| 'openWallpaperManager', |
| 'useDefaultTheme', |
| 'useSystemTheme', |
| + 'validateStartupPage', |
| ]); |
| /** @private */ |
| @@ -60,6 +61,11 @@ TestAppearanceBrowserProxy.prototype = { |
| this.methodCalled('useSystemTheme'); |
| }, |
| + /** @override */ |
| + useSystemTheme: function() { |
|
dpapad
2017/03/24 21:47:43
Accidental copy paste?
scottchen
2017/03/24 22:56:31
Done.
|
| + this.methodCalled('useSystemTheme'); |
| + }, |
| + |
| /** @param {number} defaultZoom */ |
| setDefaultZoom: function(defaultZoom) { |
| this.defaultZoom_ = defaultZoom; |
| @@ -69,6 +75,14 @@ TestAppearanceBrowserProxy.prototype = { |
| setIsSupervised: function(isSupervised) { |
| this.isSupervised_ = isSupervised; |
| }, |
| + |
| + /** @override */ |
| + validateStartupPage: function(value) { |
| + this.methodCalled('validateStartupPage'); |
| + // 'false' is an invalid value for testing purposes. |
| + var returnValue = 'false' ? false : true; // 'false' |
|
dpapad
2017/03/24 21:47:43
Instead of hardcoding an invalid value, how about
scottchen
2017/03/24 22:56:31
Done.
|
| + return Promise.resolve(returnValue); |
| + }, |
| }; |
| var appearancePage = null; |
| @@ -224,4 +238,42 @@ suite('AppearanceHandler', function() { |
| assertEquals('175%', getDefaultZoomText()); |
| }); |
| }); |
| + |
| + test('show home button toggling', function() { |
| + assertFalse(!!appearancePage.$$('.list-frame')); |
| + appearancePage.set('prefs', {browser: {show_home_button: {value: true}}}); |
| + |
| + Polymer.dom.flush(); |
| + |
| + assertTrue(!!appearancePage.$$('.list-frame')); |
| + }); |
| + |
| + test('home button urls', function() { |
| + appearancePage.set('prefs', { |
| + browser: {show_home_button: {value: true}}, |
| + homepage: {type: chrome.settingsPrivate.PrefType.URL, value: 'test'} |
| + }); |
| + |
| + Polymer.dom.flush(); |
| + |
| + var input = appearancePage.$$('#customHomePage'); |
| + assertTrue(!!input); |
| + assertFalse(input.invalid); |
| + assertEquals(input.value, 'test'); |
| + |
| + input.value = 'false'; // 'false' is an invalid value for testing purposes. |
| + input.fire('input'); |
| + |
| + return appearanceBrowserProxy.whenCalled('validateStartupPage') |
| + .then(function() { |
| + Polymer.dom.flush(); |
| + assertEquals(input.value, 'false'); |
| + assertTrue(input.invalid); |
| + |
| + // Should reset to default value on change event. |
| + input.$$('paper-input').fire('change'); |
|
dpapad
2017/03/24 21:47:43
Does the 'change' event have to be fired from pape
scottchen
2017/03/24 22:56:31
settingsInput.onChange_ was attached to <paper-inp
|
| + Polymer.dom.flush(); |
| + assertEquals(input.value, 'test'); |
| + }); |
| + }); |
| }); |