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 26 matching lines...) Expand all Loading... |
37 | 37 |
38 /** | 38 /** |
39 * This class will be exported as testing.Test, and is provided to hold the | 39 * This class will be exported as testing.Test, and is provided to hold the |
40 * fixture's configuration and callback methods for the various phases of | 40 * fixture's configuration and callback methods for the various phases of |
41 * invoking a test. It is called "Test" rather than TestFixture to roughly | 41 * invoking a test. It is called "Test" rather than TestFixture to roughly |
42 * mimic the gtest's class names. | 42 * mimic the gtest's class names. |
43 * @constructor | 43 * @constructor |
44 */ | 44 */ |
45 function Test() {}; | 45 function Test() {}; |
46 | 46 |
| 47 /** |
| 48 * Make all transitions and animations take 0ms. |
| 49 * Any animations will still happen and webkit-animation-end should be |
| 50 * listened to. |
| 51 */ |
| 52 Test.disableAnimationsAndTransitions = function() { |
| 53 var noAnimationStyle = document.createElement('style'); |
| 54 noAnimationStyle.textContent = |
| 55 '* {' + |
| 56 ' -webkit-transition-duration: 0ms !important;' + |
| 57 ' -webkit-transition-delay: 0ms !important;' + |
| 58 ' -webkit-animation-duration: 0ms !important;' + |
| 59 ' -webkit-animation-delay: 0ms !important;' + |
| 60 '}'; |
| 61 document.querySelector('head').appendChild(noAnimationStyle); |
| 62 }; |
| 63 |
47 Test.prototype = { | 64 Test.prototype = { |
48 /** | 65 /** |
49 * The name of the test. | 66 * The name of the test. |
50 */ | 67 */ |
51 name: null, | 68 name: null, |
52 | 69 |
53 /** | 70 /** |
54 * When set to a string value representing a url, generate BrowsePreload | 71 * When set to a string value representing a url, generate BrowsePreload |
55 * call, which will browse to the url and call fixture.preLoad of the | 72 * call, which will browse to the url and call fixture.preLoad of the |
56 * currentTestCase. | 73 * currentTestCase. |
(...skipping 1748 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 |