| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 cr.define('settings_startup_urls_page', function() { | 5 cr.define('settings_startup_urls_page', function() { |
| 6 /** | 6 /** |
| 7 * @constructor | 7 * @constructor |
| 8 * @implements {settings.StartupUrlsPageBrowserProxy} | 8 * @implements {settings.StartupUrlsPageBrowserProxy} |
| 9 * @extends {settings.TestBrowserProxy} | 9 * @extends {settings.TestBrowserProxy} |
| 10 */ | 10 */ |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 assertTrue(!!addPageButton); | 243 assertTrue(!!addPageButton); |
| 244 assertFalse(!!page.$$('settings-startup-url-dialog')); | 244 assertFalse(!!page.$$('settings-startup-url-dialog')); |
| 245 | 245 |
| 246 MockInteractions.tap(addPageButton); | 246 MockInteractions.tap(addPageButton); |
| 247 Polymer.dom.flush(); | 247 Polymer.dom.flush(); |
| 248 assertTrue(!!page.$$('settings-startup-url-dialog')); | 248 assertTrue(!!page.$$('settings-startup-url-dialog')); |
| 249 }); | 249 }); |
| 250 | 250 |
| 251 test('EditPage_OpensDialog', function() { | 251 test('EditPage_OpensDialog', function() { |
| 252 assertFalse(!!page.$$('settings-startup-url-dialog')); | 252 assertFalse(!!page.$$('settings-startup-url-dialog')); |
| 253 page.fire(settings.EDIT_STARTUP_URL_EVENT, createSampleUrlEntry()); | 253 page.fire( |
| 254 settings.EDIT_STARTUP_URL_EVENT, |
| 255 {model: createSampleUrlEntry(), anchor: null}); |
| 254 Polymer.dom.flush(); | 256 Polymer.dom.flush(); |
| 255 assertTrue(!!page.$$('settings-startup-url-dialog')); | 257 assertTrue(!!page.$$('settings-startup-url-dialog')); |
| 256 }); | 258 }); |
| 257 | 259 |
| 258 test('StartupPagesChanges_CloseOpenEditDialog', function() { | 260 test('StartupPagesChanges_CloseOpenEditDialog', function() { |
| 259 var entry1 = { | 261 var entry1 = { |
| 260 modelIndex: 2, | 262 modelIndex: 2, |
| 261 title: 'Test page 1', | 263 title: 'Test page 1', |
| 262 tooltip: 'test tooltip', | 264 tooltip: 'test tooltip', |
| 263 url: 'chrome://bar', | 265 url: 'chrome://bar', |
| 264 }; | 266 }; |
| 265 | 267 |
| 266 var entry2 = { | 268 var entry2 = { |
| 267 modelIndex: 2, | 269 modelIndex: 2, |
| 268 title: 'Test page 2', | 270 title: 'Test page 2', |
| 269 tooltip: 'test tooltip', | 271 tooltip: 'test tooltip', |
| 270 url: 'chrome://foo', | 272 url: 'chrome://foo', |
| 271 }; | 273 }; |
| 272 | 274 |
| 273 cr.webUIListenerCallback('update-startup-pages', [entry1, entry2]); | 275 cr.webUIListenerCallback('update-startup-pages', [entry1, entry2]); |
| 274 page.fire(settings.EDIT_STARTUP_URL_EVENT, entry2); | 276 page.fire( |
| 277 settings.EDIT_STARTUP_URL_EVENT, {model: entry2, anchor: null}); |
| 275 Polymer.dom.flush(); | 278 Polymer.dom.flush(); |
| 276 | 279 |
| 277 assertTrue(!!page.$$('settings-startup-url-dialog')); | 280 assertTrue(!!page.$$('settings-startup-url-dialog')); |
| 278 cr.webUIListenerCallback('update-startup-pages', [entry1]); | 281 cr.webUIListenerCallback('update-startup-pages', [entry1]); |
| 279 Polymer.dom.flush(); | 282 Polymer.dom.flush(); |
| 280 | 283 |
| 281 assertFalse(!!page.$$('settings-startup-url-dialog')); | 284 assertFalse(!!page.$$('settings-startup-url-dialog')); |
| 282 }); | 285 }); |
| 283 | 286 |
| 284 test('StarupPages_WhenExtensionControlled', function() { | 287 test('StarupPages_WhenExtensionControlled', function() { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 test('Editable', function() { | 355 test('Editable', function() { |
| 353 assertFalse(!!element.editable); | 356 assertFalse(!!element.editable); |
| 354 assertFalse(!!element.$$('#dots')); | 357 assertFalse(!!element.$$('#dots')); |
| 355 | 358 |
| 356 element.editable = true; | 359 element.editable = true; |
| 357 Polymer.dom.flush(); | 360 Polymer.dom.flush(); |
| 358 assertTrue(!!element.$$('#dots')); | 361 assertTrue(!!element.$$('#dots')); |
| 359 }); | 362 }); |
| 360 }); | 363 }); |
| 361 }); | 364 }); |
| OLD | NEW |