| 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 /** | 7 /** |
| 8 * An example pref with 2 blocked location items and 2 allowed. This pref | 8 * An example pref with 2 blocked location items and 2 allowed. This pref |
| 9 * is also used for the All Sites category and therefore needs values for | 9 * is also used for the All Sites category and therefore needs values for |
| 10 * all types, even though some might be blank. | 10 * all types, even though some might be blank. |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 setUpCategory( | 626 setUpCategory( |
| 627 settings.ContentSettingsTypes.COOKIES, | 627 settings.ContentSettingsTypes.COOKIES, |
| 628 settings.PermissionValues.SESSION_ONLY, | 628 settings.PermissionValues.SESSION_ONLY, |
| 629 prefsSessionOnly); | 629 prefsSessionOnly); |
| 630 | 630 |
| 631 return browserProxy.whenCalled('getExceptionList').then(function() { | 631 return browserProxy.whenCalled('getExceptionList').then(function() { |
| 632 Polymer.dom.flush(); // Populates action menu. | 632 Polymer.dom.flush(); // Populates action menu. |
| 633 | 633 |
| 634 openActionMenu(0); | 634 openActionMenu(0); |
| 635 assertMenu(['Allow', 'Block', 'Edit', 'Remove'], testElement); | 635 assertMenu(['Allow', 'Block', 'Edit', 'Remove'], testElement); |
| 636 var menu = testElement.$$('dialog[is=cr-action-menu]'); |
| 637 assertTrue(menu.open); |
| 636 var edit = testElement.$.edit; | 638 var edit = testElement.$.edit; |
| 637 assertTrue(!!edit); | 639 assertTrue(!!edit); |
| 638 MockInteractions.tap(edit); | 640 MockInteractions.tap(edit); |
| 639 Polymer.dom.flush(); | 641 Polymer.dom.flush(); |
| 642 assertFalse(menu.open); |
| 640 | 643 |
| 641 assertTrue(!!testElement.$$('settings-edit-exception-dialog')); | 644 assertTrue(!!testElement.$$('settings-edit-exception-dialog')); |
| 642 }); | 645 }); |
| 643 }); | 646 }); |
| 644 | 647 |
| 645 test('list items shown and clickable when data is present', function() { | 648 test('list items shown and clickable when data is present', function() { |
| 646 var contentType = settings.ContentSettingsTypes.GEOLOCATION; | 649 var contentType = settings.ContentSettingsTypes.GEOLOCATION; |
| 647 setUpCategory(contentType, settings.PermissionValues.ALLOW, prefs); | 650 setUpCategory(contentType, settings.PermissionValues.ALLOW, prefs); |
| 648 return browserProxy.whenCalled('getExceptionList').then( | 651 return browserProxy.whenCalled('getExceptionList').then( |
| 649 function(actualContentType) { | 652 function(actualContentType) { |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 | 982 |
| 980 assertFalse(dialog.$.dialog.open); | 983 assertFalse(dialog.$.dialog.open); |
| 981 }); | 984 }); |
| 982 }); | 985 }); |
| 983 }); | 986 }); |
| 984 | 987 |
| 985 return { | 988 return { |
| 986 registerTests: registerTests, | 989 registerTests: registerTests, |
| 987 }; | 990 }; |
| 988 }); | 991 }); |
| OLD | NEW |