| 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 /** @fileoverview Suite of tests for site-list. */ | 5 /** @fileoverview Suite of tests for site-list. */ |
| 6 cr.define('site_list', function() { | 6 cr.define('site_list', function() { |
| 7 function registerTests() { | 7 function registerTests() { |
| 8 suite('SiteList', function() { | 8 suite('SiteList', function() { |
| 9 /** | 9 /** |
| 10 * A site list element created before each test. | 10 * A site list element created before each test. |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 setup(function() { | 337 setup(function() { |
| 338 browserProxy = new TestSiteSettingsPrefsBrowserProxy(); | 338 browserProxy = new TestSiteSettingsPrefsBrowserProxy(); |
| 339 settings.SiteSettingsPrefsBrowserProxyImpl.instance_ = browserProxy; | 339 settings.SiteSettingsPrefsBrowserProxyImpl.instance_ = browserProxy; |
| 340 PolymerTest.clearBody(); | 340 PolymerTest.clearBody(); |
| 341 testElement = document.createElement('site-list'); | 341 testElement = document.createElement('site-list'); |
| 342 document.body.appendChild(testElement); | 342 document.body.appendChild(testElement); |
| 343 }); | 343 }); |
| 344 | 344 |
| 345 teardown(function() { | 345 teardown(function() { |
| 346 closeActionMenu(); | 346 closeActionMenu(); |
| 347 // The code being tested changes the Route. Reset so that state is not |
| 348 // leaked across tests. |
| 349 settings.resetRouteForTesting(); |
| 347 }); | 350 }); |
| 348 | 351 |
| 349 /** | 352 /** |
| 350 * Fetch the non-hidden menu items from the action menu. | 353 * Fetch the non-hidden menu items from the action menu. |
| 351 */ | 354 */ |
| 352 function getMenuItems() { | 355 function getMenuItems() { |
| 353 var menu = testElement.$$('dialog[is=cr-action-menu]'); | 356 var menu = testElement.$$('dialog[is=cr-action-menu]'); |
| 354 assertTrue(!!menu); | 357 assertTrue(!!menu); |
| 355 return menu.querySelectorAll('button:not([hidden])'); | 358 return menu.querySelectorAll('button:not([hidden])'); |
| 356 } | 359 } |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 assertEquals(settings.ContentSettingsTypes.JAVASCRIPT, args[2]); | 886 assertEquals(settings.ContentSettingsTypes.JAVASCRIPT, args[2]); |
| 884 assertEquals('allow', args[3]); | 887 assertEquals('allow', args[3]); |
| 885 }); | 888 }); |
| 886 }); | 889 }); |
| 887 }); | 890 }); |
| 888 } | 891 } |
| 889 return { | 892 return { |
| 890 registerTests: registerTests, | 893 registerTests: registerTests, |
| 891 }; | 894 }; |
| 892 }); | 895 }); |
| OLD | NEW |