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 3beb0a747e40463d643ec7c1e70a7cb71d577c97..1efc709f8ed1ab870a6c5e2523a90a314b3f2110 100644 |
| --- a/chrome/test/data/webui/settings/appearance_page_test.js |
| +++ b/chrome/test/data/webui/settings/appearance_page_test.js |
| @@ -250,34 +250,44 @@ suite('AppearanceHandler', function() { |
| 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'} |
| - }); |
| +suite('HomeUrlInput', function() { |
| + var homeUrlInput; |
| + |
| + setup(function() { |
| + appearanceBrowserProxy = new TestAppearanceBrowserProxy(); |
| + settings.AppearanceBrowserProxyImpl.instance_ = appearanceBrowserProxy; |
| + |
| + appearanceBrowserProxy.reset(); |
|
dpapad
2017/03/31 20:38:52
Nit: There is no need to reset() the proxy if you
scottchen
2017/03/31 21:02:46
Done.
|
| + PolymerTest.clearBody(); |
| + |
| + homeUrlInput = document.createElement('home-url-input'); |
| + homeUrlInput.set( |
| + 'pref', {type: chrome.settingsPrivate.PrefType.URL, value: 'test'}); |
| + document.body.appendChild(homeUrlInput); |
| Polymer.dom.flush(); |
| + }); |
| - var input = appearancePage.$$('#customHomePage'); |
| - assertTrue(!!input); |
| - assertFalse(input.invalid); |
| - assertEquals(input.value, 'test'); |
| + test('home button urls', function() { |
| + assertFalse(homeUrlInput.invalid); |
| + assertEquals(homeUrlInput.value, 'test'); |
| - input.value = '@@@'; |
| + homeUrlInput.value = '@@@'; |
| appearanceBrowserProxy.setValidStartupPageResponse(false); |
| - input.fire('input'); |
| + homeUrlInput.$.input.fire('input'); |
| return appearanceBrowserProxy.whenCalled('validateStartupPage') |
| .then(function() { |
|
dpapad
2017/03/31 20:38:52
Can you add an assertion that checks that the stri
scottchen
2017/03/31 21:02:46
The Promise only resolves with a boolean value, it
dpapad
2017/03/31 21:05:08
Need to change this line, https://cs.chromium.org/
scottchen
2017/03/31 21:20:43
Done.
|
| Polymer.dom.flush(); |
| - assertEquals(input.value, '@@@'); |
| - assertTrue(input.invalid); |
| + assertEquals(homeUrlInput.value, '@@@'); |
| + assertTrue(homeUrlInput.invalid); |
| // Should reset to default value on change event. |
| - input.$$('paper-input').fire('change'); |
| + homeUrlInput.$.input.fire('change'); |
| Polymer.dom.flush(); |
| - assertEquals(input.value, 'test'); |
| + assertEquals(homeUrlInput.value, 'test'); |
| }); |
| }); |
| -}); |
| +}); |