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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 172 |
173 // Tap 2: Fire fit-to-width, show fit-to-page. | 173 // Tap 2: Fire fit-to-width, show fit-to-page. |
174 MockInteractions.tap(fab); | 174 MockInteractions.tap(fab); |
175 assertEvent('fit-to-width'); | 175 assertEvent('fit-to-width'); |
176 chrome.test.assertTrue(fab.icon.endsWith(fitPageIcon)); | 176 chrome.test.assertTrue(fab.icon.endsWith(fitPageIcon)); |
177 | 177 |
178 // Tap 3: Fire fit-to-page again. | 178 // Tap 3: Fire fit-to-page again. |
179 MockInteractions.tap(fab); | 179 MockInteractions.tap(fab); |
180 assertEvent('fit-to-page'); | 180 assertEvent('fit-to-page'); |
181 | 181 |
| 182 // Do the same as above, but with fitToggleFromHotKey(). |
| 183 zoomToolbar.fitToggleFromHotKey(); |
| 184 assertEvent('fit-to-width'); |
| 185 zoomToolbar.fitToggleFromHotKey(); |
| 186 assertEvent('fit-to-page'); |
| 187 zoomToolbar.fitToggleFromHotKey(); |
| 188 assertEvent('fit-to-width'); |
| 189 |
| 190 // Tap 4: Fire fit-to-page again. |
| 191 MockInteractions.tap(fab); |
| 192 assertEvent('fit-to-page'); |
| 193 |
182 chrome.test.succeed(); | 194 chrome.test.succeed(); |
183 } | 195 } |
184 ]; | 196 ]; |
185 | 197 |
186 importTestHelpers().then(function() { | 198 importTestHelpers().then(function() { |
187 chrome.test.runTests(tests); | 199 chrome.test.runTests(tests); |
188 }); | 200 }); |
OLD | NEW |