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 /** | 5 /** |
6 * Standalone unit tests of the PDF Polymer elements. | 6 * Standalone unit tests of the PDF Polymer elements. |
7 */ | 7 */ |
8 var tests = [ | 8 var tests = [ |
9 /** | 9 /** |
10 * Test that viewer-page-selector reacts correctly to text entry. The page | 10 * Test that viewer-page-selector reacts correctly to text entry. The page |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 chrome.test.succeed(); | 43 chrome.test.succeed(); |
44 }, | 44 }, |
45 | 45 |
46 /** | 46 /** |
47 * Test that viewer-page-selector changes in response to setting docLength. | 47 * Test that viewer-page-selector changes in response to setting docLength. |
48 */ | 48 */ |
49 function testPageSelectorDocLength() { | 49 function testPageSelectorDocLength() { |
50 var selector = | 50 var selector = |
51 Polymer.Base.create('viewer-page-selector', {docLength: 1234}); | 51 Polymer.Base.create('viewer-page-selector', {docLength: 1234}); |
52 chrome.test.assertEq('/ 1234', selector.$.pagelength.textContent); | 52 chrome.test.assertEq('1234', selector.$.pagelength.textContent); |
53 chrome.test.assertEq('2.4em', selector.$.pageselector.style.width); | 53 chrome.test.assertEq('4ch', selector.$.pageselector.style.width); |
54 chrome.test.succeed(); | 54 chrome.test.succeed(); |
55 }, | 55 }, |
56 | 56 |
57 /** | 57 /** |
58 * Test that clicking the dropdown icon opens/closes the dropdown. | 58 * Test that clicking the dropdown icon opens/closes the dropdown. |
59 */ | 59 */ |
60 function testToolbarDropdownShowHide() { | 60 function testToolbarDropdownShowHide() { |
61 var dropdown = Polymer.Base.create('viewer-toolbar-dropdown', { | 61 var dropdown = Polymer.Base.create('viewer-toolbar-dropdown', { |
62 header: 'Test Menu', | 62 header: 'Test Menu', |
63 closedIcon: 'closedIcon', | 63 closedIcon: 'closedIcon', |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 MockInteractions.tap(fab); | 178 MockInteractions.tap(fab); |
179 assertEvent('fit-to-page'); | 179 assertEvent('fit-to-page'); |
180 | 180 |
181 chrome.test.succeed(); | 181 chrome.test.succeed(); |
182 } | 182 } |
183 ]; | 183 ]; |
184 | 184 |
185 importTestHelpers().then(function() { | 185 importTestHelpers().then(function() { |
186 chrome.test.runTests(tests); | 186 chrome.test.runTests(tests); |
187 }); | 187 }); |
OLD | NEW |