OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 * Test fixture for print preview WebUI testing. | 6 * Test fixture for print preview WebUI testing. |
7 * @extends {testing.Test} | 7 * @extends {testing.Test} |
8 * @constructor | 8 * @constructor |
9 */ | 9 */ |
10 function PrintPreviewWebUITest() {} | 10 function PrintPreviewWebUITest() {} |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 'src', | 160 'src', |
161 'chrome://print/' + previewUid + '/' + srcDataIndex + '/print.pdf'); | 161 'chrome://print/' + previewUid + '/' + srcDataIndex + '/print.pdf'); |
162 pdfViewer.setAttribute('aria-live', 'polite'); | 162 pdfViewer.setAttribute('aria-live', 'polite'); |
163 pdfViewer.setAttribute('aria-atomic', 'true'); | 163 pdfViewer.setAttribute('aria-atomic', 'true'); |
164 function fakeFunction() {} | 164 function fakeFunction() {} |
165 pdfViewer.onload = fakeFunction; | 165 pdfViewer.onload = fakeFunction; |
166 pdfViewer.goToPage = fakeFunction; | 166 pdfViewer.goToPage = fakeFunction; |
167 pdfViewer.removePrintButton = fakeFunction; | 167 pdfViewer.removePrintButton = fakeFunction; |
168 pdfViewer.fitToHeight = fakeFunction; | 168 pdfViewer.fitToHeight = fakeFunction; |
169 pdfViewer.grayscale = fakeFunction; | 169 pdfViewer.grayscale = fakeFunction; |
| 170 pdfViewer.getZoomLevel = fakeFunction; |
| 171 pdfViewer.setZoomLevel = fakeFunction; |
| 172 pdfViewer.pageXOffset = fakeFunction; |
| 173 pdfViewer.pageYOffset = fakeFunction; |
| 174 pdfViewer.setPageXOffset = fakeFunction; |
| 175 pdfViewer.setPageYOffset = fakeFunction; |
| 176 pdfViewer.getHeight = fakeFunction; |
| 177 pdfViewer.getWidth = fakeFunction; |
| 178 pdfViewer.getPageLocationNormalized = fakeFunction; |
| 179 pdfViewer.onScroll = fakeFunction; |
| 180 pdfViewer.onPluginSizeChanged = fakeFunction; |
| 181 pdfViewer.getHorizontalScrollbarThickness = fakeFunction; |
| 182 pdfViewer.getVerticalScrollbarThickness = fakeFunction; |
170 $('mainview').appendChild(pdfViewer); | 183 $('mainview').appendChild(pdfViewer); |
171 onPDFLoad(); | 184 onPDFLoad(); |
172 }, | 185 }, |
173 | 186 |
174 /** | 187 /** |
175 * Always return true so tests run on systems without plugin available. | 188 * Always return true so tests run on systems without plugin available. |
176 * @return {boolean} Always true. | 189 * @return {boolean} Always true. |
177 */ | 190 */ |
178 checkCompatiblePluginExists: function() { | 191 checkCompatiblePluginExists: function() { |
179 return true; | 192 return true; |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 | 443 |
431 // Test that error message is displayed when plugin doesn't exist. | 444 // Test that error message is displayed when plugin doesn't exist. |
432 TEST_F('PrintPreviewNoPDFWebUITest', 'TestErrorMessage', function() { | 445 TEST_F('PrintPreviewNoPDFWebUITest', 'TestErrorMessage', function() { |
433 var errorButton = $('error-button'); | 446 var errorButton = $('error-button'); |
434 assertNotEquals(null, errorButton); | 447 assertNotEquals(null, errorButton); |
435 expectFalse(errorButton.disabled); | 448 expectFalse(errorButton.disabled); |
436 var errorText = $('custom-message'); | 449 var errorText = $('custom-message'); |
437 assertNotEquals(null, errorText); | 450 assertNotEquals(null, errorText); |
438 expectFalse(errorText.classList.contains('hidden')); | 451 expectFalse(errorText.classList.contains('hidden')); |
439 }); | 452 }); |
OLD | NEW |