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 /** @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 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 702 setUpCategory(settings.ContentSettingsTypes.GEOLOCATION, | 702 setUpCategory(settings.ContentSettingsTypes.GEOLOCATION, |
| 703 settings.PermissionValues.ALLOW, prefsOneDisabled); | 703 settings.PermissionValues.ALLOW, prefsOneDisabled); |
| 704 return browserProxy.whenCalled('getExceptionList').then( | 704 return browserProxy.whenCalled('getExceptionList').then( |
| 705 function(contentType) { | 705 function(contentType) { |
| 706 assertEquals( | 706 assertEquals( |
| 707 settings.ContentSettingsTypes.GEOLOCATION, contentType); | 707 settings.ContentSettingsTypes.GEOLOCATION, contentType); |
| 708 assertFalse(testElement.$.category.hidden); | 708 assertFalse(testElement.$.category.hidden); |
| 709 }); | 709 }); |
| 710 }); | 710 }); |
| 711 | 711 |
| 712 test('All sites category no action menu', function() { | |
| 713 setUpCategory(settings.ALL_SITES, '', prefsVarious); | |
| 714 return browserProxy.whenCalled('getExceptionList').then( | |
| 715 function(contentType) { | |
| 716 // Use resolver to ensure asserts bubble up to the framework with | |
| 717 // meaningful errors. | |
| 718 var resolver = new PromiseResolver(); | |
| 719 testElement.async(resolver.resolve); | |
| 720 return resolver.promise.then(function() { | |
|
dschuyler
2016/12/21 02:06:47
I'm including this promise resolve because other t
dpapad
2016/12/21 02:32:13
The comment is a bit misleading (or I am misunders
dschuyler
2016/12/21 02:39:39
Thanks for looking at that with me. Knowing when P
| |
| 721 var item = testElement.$.listContainer.children[0]; | |
| 722 var dots = item.querySelector('paper-icon-button'); | |
| 723 assertTrue(!!dots); | |
| 724 assertTrue(dots.hidden); | |
| 725 }); | |
| 726 }); | |
| 727 }); | |
| 728 | |
| 712 test('All sites category', function() { | 729 test('All sites category', function() { |
| 713 // Prefs: Multiple and overlapping sites. | 730 // Prefs: Multiple and overlapping sites. |
| 714 setUpCategory(settings.ALL_SITES, '', prefsVarious); | 731 setUpCategory(settings.ALL_SITES, '', prefsVarious); |
| 715 | 732 |
| 716 return browserProxy.whenCalled('getExceptionList').then( | 733 return browserProxy.whenCalled('getExceptionList').then( |
| 717 function(contentType) { | 734 function(contentType) { |
| 718 // Use resolver to ensure asserts bubble up to the framework with | 735 // Use resolver to ensure asserts bubble up to the framework with |
| 719 // meaningful errors. | 736 // meaningful errors. |
| 720 var resolver = new PromiseResolver(); | 737 var resolver = new PromiseResolver(); |
| 721 testElement.async(resolver.resolve); | 738 testElement.async(resolver.resolve); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 851 assertEquals(settings.ContentSettingsTypes.JAVASCRIPT, args[2]); | 868 assertEquals(settings.ContentSettingsTypes.JAVASCRIPT, args[2]); |
| 852 assertEquals('allow', args[3]); | 869 assertEquals('allow', args[3]); |
| 853 }); | 870 }); |
| 854 }); | 871 }); |
| 855 }); | 872 }); |
| 856 } | 873 } |
| 857 return { | 874 return { |
| 858 registerTests: registerTests, | 875 registerTests: registerTests, |
| 859 }; | 876 }; |
| 860 }); | 877 }); |
| OLD | NEW |