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

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: move home url buttons test to its own suite 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
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');
});
});
-});
+});

Powered by Google App Engine
This is Rietveld 408576698