| 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 that the list container is populated. |
| 717 var resolver = new PromiseResolver(); |
| 718 testElement.async(resolver.resolve); |
| 719 return resolver.promise.then(function() { |
| 720 var item = testElement.$.listContainer.children[0]; |
| 721 var dots = item.querySelector('paper-icon-button'); |
| 722 assertTrue(!!dots); |
| 723 assertTrue(dots.hidden); |
| 724 }); |
| 725 }); |
| 726 }); |
| 727 |
| 712 test('All sites category', function() { | 728 test('All sites category', function() { |
| 713 // Prefs: Multiple and overlapping sites. | 729 // Prefs: Multiple and overlapping sites. |
| 714 setUpCategory(settings.ALL_SITES, '', prefsVarious); | 730 setUpCategory(settings.ALL_SITES, '', prefsVarious); |
| 715 | 731 |
| 716 return browserProxy.whenCalled('getExceptionList').then( | 732 return browserProxy.whenCalled('getExceptionList').then( |
| 717 function(contentType) { | 733 function(contentType) { |
| 718 // Use resolver to ensure asserts bubble up to the framework with | 734 // Use resolver to ensure asserts bubble up to the framework with |
| 719 // meaningful errors. | 735 // meaningful errors. |
| 720 var resolver = new PromiseResolver(); | 736 var resolver = new PromiseResolver(); |
| 721 testElement.async(resolver.resolve); | 737 testElement.async(resolver.resolve); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 851 assertEquals(settings.ContentSettingsTypes.JAVASCRIPT, args[2]); | 867 assertEquals(settings.ContentSettingsTypes.JAVASCRIPT, args[2]); |
| 852 assertEquals('allow', args[3]); | 868 assertEquals('allow', args[3]); |
| 853 }); | 869 }); |
| 854 }); | 870 }); |
| 855 }); | 871 }); |
| 856 } | 872 } |
| 857 return { | 873 return { |
| 858 registerTests: registerTests, | 874 registerTests: registerTests, |
| 859 }; | 875 }; |
| 860 }); | 876 }); |
| OLD | NEW |