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

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

Issue 2773233002: MD Settings: change settings-input to home-url-input due to reduced usage. (Closed)
Patch Set: updates based on comments Created 3 years, 9 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/browser/resources/settings/settings_resources.grd ('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/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');
});
});
-});
+});
« no previous file with comments | « chrome/browser/resources/settings/settings_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698