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 /** @fileoverview Suite of tests for zoom-levels. */ | 5 /** @fileoverview Suite of tests for zoom-levels. */ |
6 suite('ZoomLevels', function() { | 6 suite('ZoomLevels', function() { |
7 /** | 7 /** |
8 * A zoom levels category created before each test. | 8 * A zoom levels category created before each test. |
9 * @type {ZoomLevels} | 9 * @type {ZoomLevels} |
10 */ | 10 */ |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 return browserProxy.whenCalled('fetchZoomLevels'); | 59 return browserProxy.whenCalled('fetchZoomLevels'); |
60 } | 60 } |
61 | 61 |
62 /** | 62 /** |
63 * Fetch the remove button from the list. | 63 * Fetch the remove button from the list. |
64 * @param {!HTMLElement} listContainer The list to use for the lookup. | 64 * @param {!HTMLElement} listContainer The list to use for the lookup. |
65 * @param {number} index The index of the child element (which site) to | 65 * @param {number} index The index of the child element (which site) to |
66 * fetch. | 66 * fetch. |
67 */ | 67 */ |
68 function getRemoveButton(listContainer, index) { | 68 function getRemoveButton(listContainer, index) { |
69 return listContainer.children[index].querySelector('paper-icon-button'); | 69 return listContainer.children[index].querySelector('button'); |
70 } | 70 } |
71 | 71 |
72 test('empty zoom state', function() { | 72 test('empty zoom state', function() { |
73 var list = testElement.$.list; | 73 var list = testElement.$.list; |
74 assertTrue(!!list); | 74 assertTrue(!!list); |
75 assertEquals(0, list.items.length); | 75 assertEquals(0, list.items.length); |
76 assertEquals( | 76 assertEquals( |
77 0, testElement.shadowRoot.querySelectorAll('.list-item').length); | 77 0, testElement.shadowRoot.querySelectorAll('.list-item').length); |
78 assertTrue(!!testElement.$$('#empty')); | 78 assertTrue(!!testElement.$$('#empty')); |
79 }); | 79 }); |
(...skipping 13 matching lines...) Expand all Loading... |
93 var removeButton = getRemoveButton(testElement.$.listContainer, 0); | 93 var removeButton = getRemoveButton(testElement.$.listContainer, 0); |
94 assert(!!removeButton); | 94 assert(!!removeButton); |
95 MockInteractions.tap(removeButton); | 95 MockInteractions.tap(removeButton); |
96 return browserProxy.whenCalled('removeZoomLevel'); | 96 return browserProxy.whenCalled('removeZoomLevel'); |
97 }) | 97 }) |
98 .then(function(args) { | 98 .then(function(args) { |
99 assertEquals('http://www.google.com', args[0]); | 99 assertEquals('http://www.google.com', args[0]); |
100 }); | 100 }); |
101 }); | 101 }); |
102 }); | 102 }); |
OLD | NEW |