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 * @fileoverview Library providing basic test framework functionality. | 6 * @fileoverview Library providing basic test framework functionality. |
7 */ | 7 */ |
8 | 8 |
9 /** | 9 /** |
10 * Namespace for |Test|. | 10 * Namespace for |Test|. |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
213 }, | 213 }, |
214 | 214 |
215 /** | 215 /** |
216 * Don't run accessibility checks after this test completes. | 216 * Don't run accessibility checks after this test completes. |
217 */ | 217 */ |
218 disableAccessibilityChecks: function() { | 218 disableAccessibilityChecks: function() { |
219 this.runAccessibilityChecks = false; | 219 this.runAccessibilityChecks = false; |
220 }, | 220 }, |
221 | 221 |
222 /** | 222 /** |
223 * Make all transitions and animations take 0ms. | |
224 * Any animations will still happen and webkit-animation-end should be | |
225 * listened to. | |
226 */ | |
227 disableAnimationsAndTransitions: function() { | |
Dan Beam
2015/04/27 18:29:58
make this static
hcarmona
2015/04/29 19:12:32
Done.
| |
228 var noAnimationStyle = document.createElement('style'); | |
229 noAnimationStyle.textContent = | |
230 '* {' + | |
231 ' -webkit-transition-duration: 0ms !important;' + | |
232 ' -webkit-transition-delay: 0ms !important;' + | |
233 ' -webkit-animation-duration: 0ms !important;' + | |
234 ' -webkit-animation-delay: 0ms !important;' + | |
235 '}'; | |
236 document.querySelector('head').appendChild(noAnimationStyle); | |
237 }, | |
238 | |
239 /** | |
223 * Create a new class to handle |messageNames|, assign it to | 240 * Create a new class to handle |messageNames|, assign it to |
224 * |this.mockHandler|, register its messages and return it. | 241 * |this.mockHandler|, register its messages and return it. |
225 * @return {Mock} Mock handler class assigned to |this.mockHandler|. | 242 * @return {Mock} Mock handler class assigned to |this.mockHandler|. |
226 */ | 243 */ |
227 makeAndRegisterMockHandler: function(messageNames) { | 244 makeAndRegisterMockHandler: function(messageNames) { |
228 var MockClass = makeMockClass(messageNames); | 245 var MockClass = makeMockClass(messageNames); |
229 this.mockHandler = mock(MockClass); | 246 this.mockHandler = mock(MockClass); |
230 registerMockMessageCallbacks(this.mockHandler, MockClass); | 247 registerMockMessageCallbacks(this.mockHandler, MockClass); |
231 return this.mockHandler; | 248 return this.mockHandler; |
232 }, | 249 }, |
(...skipping 1572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1805 exports.TEST = TEST; | 1822 exports.TEST = TEST; |
1806 exports.TEST_F = TEST_F; | 1823 exports.TEST_F = TEST_F; |
1807 exports.RUNTIME_TEST_F = TEST_F; | 1824 exports.RUNTIME_TEST_F = TEST_F; |
1808 exports.GEN = GEN; | 1825 exports.GEN = GEN; |
1809 exports.GEN_INCLUDE = GEN_INCLUDE; | 1826 exports.GEN_INCLUDE = GEN_INCLUDE; |
1810 exports.WhenTestDone = WhenTestDone; | 1827 exports.WhenTestDone = WhenTestDone; |
1811 | 1828 |
1812 // Import the Mock4JS helpers. | 1829 // Import the Mock4JS helpers. |
1813 Mock4JS.addMockSupport(exports); | 1830 Mock4JS.addMockSupport(exports); |
1814 })(this); | 1831 })(this); |
OLD | NEW |