| 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 | 249 |
| 250 setup(function() { | 250 setup(function() { |
| 251 browserProxy = new TestStartupUrlsPageBrowserProxy(); | 251 browserProxy = new TestStartupUrlsPageBrowserProxy(); |
| 252 settings.StartupUrlsPageBrowserProxyImpl.instance_ = browserProxy; | 252 settings.StartupUrlsPageBrowserProxyImpl.instance_ = browserProxy; |
| 253 PolymerTest.clearBody(); | 253 PolymerTest.clearBody(); |
| 254 element = document.createElement('settings-startup-url-entry'); | 254 element = document.createElement('settings-startup-url-entry'); |
| 255 element.model = createSampleUrlEntry(); | 255 element.model = createSampleUrlEntry(); |
| 256 document.body.appendChild(element); | 256 document.body.appendChild(element); |
| 257 | 257 |
| 258 // Bring up the popup menu for the following tests to use. | 258 // Bring up the popup menu for the following tests to use. |
| 259 assertFalse(!!element.$$('iron-dropdown')); | 259 assertFalse(!!element.$$('dialog[is=settings-action-menu]')); |
| 260 MockInteractions.tap(element.$.dots); | 260 MockInteractions.tap(element.$.dots); |
| 261 Polymer.dom.flush(); | 261 Polymer.dom.flush(); |
| 262 assertTrue(!!element.$$('iron-dropdown')); | 262 assertTrue(!!element.$$('dialog[is=settings-action-menu]')); |
| 263 }); | 263 }); |
| 264 | 264 |
| 265 teardown(function() { element.remove(); }); | 265 teardown(function() { element.remove(); }); |
| 266 | 266 |
| 267 test('MenuOptions_Remove', function() { | 267 test('MenuOptions_Remove', function() { |
| 268 var removeButton = element.shadowRoot.querySelector('#remove') | 268 var removeButton = element.shadowRoot.querySelector('#remove') |
| 269 MockInteractions.tap(removeButton); | 269 MockInteractions.tap(removeButton); |
| 270 return browserProxy.whenCalled('removeStartupPage').then( | 270 return browserProxy.whenCalled('removeStartupPage').then( |
| 271 function(modelIndex) { | 271 function(modelIndex) { |
| 272 assertEquals(element.model.modelIndex, modelIndex); | 272 assertEquals(element.model.modelIndex, modelIndex); |
| 273 }); | 273 }); |
| 274 }); | 274 }); |
| 275 }); | 275 }); |
| 276 }); | 276 }); |
| OLD | NEW |