OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 * @constructor | 7 * @constructor |
8 * @extends {testing.Test} | 8 * @extends {testing.Test} |
9 */ | 9 */ |
10 function PrintPreviewWebUITest() { | 10 function PrintPreviewWebUITest() { |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 false /*selectionOnly*/, | 180 false /*selectionOnly*/, |
181 'FooDevice' /*systemDefaultDestinationId*/, | 181 'FooDevice' /*systemDefaultDestinationId*/, |
182 null /*serializedAppStateStr*/, | 182 null /*serializedAppStateStr*/, |
183 false /*documentHasSelection*/); | 183 false /*documentHasSelection*/); |
184 this.localDestinationInfos_ = [ | 184 this.localDestinationInfos_ = [ |
185 { printerName: 'FooName', deviceName: 'FooDevice' }, | 185 { printerName: 'FooName', deviceName: 'FooDevice' }, |
186 { printerName: 'BarName', deviceName: 'BarDevice' } | 186 { printerName: 'BarName', deviceName: 'BarDevice' } |
187 ]; | 187 ]; |
188 this.nativeLayer_ = printPreview.nativeLayer_; | 188 this.nativeLayer_ = printPreview.nativeLayer_; |
189 | 189 |
190 // Make all transitions and animations take 0ms for testing purposes. | 190 testing.Test.disableAnimationsAndTransitions(); |
191 // Animations still happen and must be waited on. | |
192 var noAnimationStyle = document.createElement('style'); | |
193 noAnimationStyle.textContent = | |
194 '* {' + | |
195 ' -webkit-transition-duration: 0ms !important;' + | |
196 ' -webkit-transition-delay: 0ms !important;' + | |
197 ' -webkit-animation-duration: 0ms !important;' + | |
198 ' -webkit-animation-delay: 0ms !important;' + | |
199 '}'; | |
200 document.querySelector('head').appendChild(noAnimationStyle); | |
201 } | 191 } |
202 }; | 192 }; |
203 | 193 |
204 GEN('#include "chrome/test/data/webui/print_preview.h"'); | 194 GEN('#include "chrome/test/data/webui/print_preview.h"'); |
205 | 195 |
206 // Test some basic assumptions about the print preview WebUI. | 196 // Test some basic assumptions about the print preview WebUI. |
207 TEST_F('PrintPreviewWebUITest', 'TestPrinterList', function() { | 197 TEST_F('PrintPreviewWebUITest', 'TestPrinterList', function() { |
208 this.setInitialSettings(); | 198 this.setInitialSettings(); |
209 this.setLocalDestinations(); | 199 this.setLocalDestinations(); |
210 | 200 |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 expectEquals( | 953 expectEquals( |
964 customLocalizedMediaName, | 954 customLocalizedMediaName, |
965 mediaSelect.options[mediaSelect.selectedIndex].text); | 955 mediaSelect.options[mediaSelect.selectedIndex].text); |
966 // Check the other media item. | 956 // Check the other media item. |
967 expectEquals( | 957 expectEquals( |
968 customMediaName, | 958 customMediaName, |
969 mediaSelect.options[mediaSelect.selectedIndex == 0 ? 1 : 0].text); | 959 mediaSelect.options[mediaSelect.selectedIndex == 0 ? 1 : 0].text); |
970 | 960 |
971 this.waitForAnimationToEnd('more-settings'); | 961 this.waitForAnimationToEnd('more-settings'); |
972 }); | 962 }); |
OLD | NEW |