| 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..59ef458cef62f1a2a2469f31ff15a0587d3d3a61 100644
|
| --- a/chrome/test/data/webui/settings/appearance_page_test.js
|
| +++ b/chrome/test/data/webui/settings/appearance_page_test.js
|
| @@ -75,8 +75,8 @@ TestAppearanceBrowserProxy.prototype = {
|
| },
|
|
|
| /** @override */
|
| - validateStartupPage: function(value) {
|
| - this.methodCalled('validateStartupPage');
|
| + validateStartupPage: function(url) {
|
| + this.methodCalled('validateStartupPage', url);
|
| return Promise.resolve(this.isHomeUrlValid_);
|
| },
|
|
|
| @@ -250,34 +250,43 @@ 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;
|
| + 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() {
|
| + .then(function(url) {
|
| + assertEquals(homeUrlInput.value, url);
|
| Polymer.dom.flush();
|
| - assertEquals(input.value, '@@@');
|
| - assertTrue(input.invalid);
|
| + assertEquals(homeUrlInput.value, '@@@'); // Value hasn't changed.
|
| + 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');
|
| });
|
| });
|
| -});
|
| +});
|
|
|