Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @implements {settings.AppearanceBrowserProxy} | 7 * @implements {settings.AppearanceBrowserProxy} |
| 8 * @extends {settings.TestBrowserProxy} | 8 * @extends {settings.TestBrowserProxy} |
| 9 */ | 9 */ |
| 10 var TestAppearanceBrowserProxy = function() { | 10 var TestAppearanceBrowserProxy = function() { |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 245 test('show home button toggling', function() { | 245 test('show home button toggling', function() { |
| 246 assertFalse(!!appearancePage.$$('.list-frame')); | 246 assertFalse(!!appearancePage.$$('.list-frame')); |
| 247 appearancePage.set('prefs', {browser: {show_home_button: {value: true}}}); | 247 appearancePage.set('prefs', {browser: {show_home_button: {value: true}}}); |
| 248 | 248 |
| 249 Polymer.dom.flush(); | 249 Polymer.dom.flush(); |
| 250 | 250 |
| 251 assertTrue(!!appearancePage.$$('.list-frame')); | 251 assertTrue(!!appearancePage.$$('.list-frame')); |
| 252 }); | 252 }); |
| 253 | 253 |
| 254 test('home button urls', function() { | 254 test('home button urls', function() { |
| 255 appearancePage.set('prefs', { | 255 var input = document.createElement('home-url-input'); |
| 256 browser: {show_home_button: {value: true}}, | 256 input.set( |
| 257 homepage: {type: chrome.settingsPrivate.PrefType.URL, value: 'test'} | 257 'pref', {type: chrome.settingsPrivate.PrefType.URL, value: 'test'}); |
| 258 }); | |
| 259 | 258 |
| 259 document.body.appendChild(input); | |
|
dpapad
2017/03/30 20:27:00
This test no longer uses appearancePage. Let's cal
scottchen
2017/03/31 00:01:06
Done.
| |
| 260 Polymer.dom.flush(); | 260 Polymer.dom.flush(); |
| 261 | 261 |
| 262 var input = appearancePage.$$('#customHomePage'); | |
| 263 assertTrue(!!input); | |
| 264 assertFalse(input.invalid); | 262 assertFalse(input.invalid); |
| 265 assertEquals(input.value, 'test'); | 263 assertEquals(input.value, 'test'); |
| 266 | 264 |
| 267 input.value = '@@@'; | 265 input.value = '@@@'; |
| 268 appearanceBrowserProxy.setValidStartupPageResponse(false); | 266 appearanceBrowserProxy.setValidStartupPageResponse(false); |
| 269 input.fire('input'); | 267 input.$.input.fire('input'); |
| 270 | 268 |
| 271 return appearanceBrowserProxy.whenCalled('validateStartupPage') | 269 return appearanceBrowserProxy.whenCalled('validateStartupPage') |
| 272 .then(function() { | 270 .then(function() { |
| 273 Polymer.dom.flush(); | 271 Polymer.dom.flush(); |
| 274 assertEquals(input.value, '@@@'); | 272 assertEquals(input.value, '@@@'); |
| 275 assertTrue(input.invalid); | 273 assertTrue(input.invalid); |
| 276 | 274 |
| 277 // Should reset to default value on change event. | 275 // Should reset to default value on change event. |
| 278 input.$$('paper-input').fire('change'); | 276 input.$.input.fire('change'); |
| 279 Polymer.dom.flush(); | 277 Polymer.dom.flush(); |
| 280 assertEquals(input.value, 'test'); | 278 assertEquals(input.value, 'test'); |
| 281 }); | 279 }); |
| 282 }); | 280 }); |
| 283 }); | 281 }); |
| OLD | NEW |