OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef BASE_TEST_TEST_TIMEOUTS_H_ | 5 #ifndef BASE_TEST_TEST_TIMEOUTS_H_ |
6 #define BASE_TEST_TEST_TIMEOUTS_H_ | 6 #define BASE_TEST_TEST_TIMEOUTS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 | 9 |
10 // Returns common timeouts to use in tests. Makes it possible to adjust | 10 // Returns common timeouts to use in tests. Makes it possible to adjust |
11 // the timeouts for different environments (like Valgrind). | 11 // the timeouts for different environments (like Valgrind). |
12 class TestTimeouts { | 12 class TestTimeouts { |
13 public: | 13 public: |
14 // Initializes the timeouts. Non thread-safe. Should be called exactly once | 14 // Initializes the timeouts. Non thread-safe. Should be called exactly once |
15 // by the test suite. | 15 // by the test suite. |
16 static void Initialize(); | 16 static void Initialize(); |
17 | 17 |
18 // Timeout for very short wait times, such and resource loading. | |
Paweł Hajdan Jr.
2010/12/13 18:54:32
nit: "such and" -> typo?
Please don't mention res
annacc
2010/12/13 20:14:21
Done.
| |
19 static int short_timeout_ms() { return short_timeout_ms_; } | |
Paweł Hajdan Jr.
2010/12/13 18:54:32
nit: Rename to tiny_timeout_ms.
annacc
2010/12/13 20:14:21
Done.
| |
20 | |
18 // Timeout to wait for something to happen. If you are not sure | 21 // Timeout to wait for something to happen. If you are not sure |
19 // which timeout to use, this is the one you want. | 22 // which timeout to use, this is the one you want. |
20 static int action_timeout_ms() { return action_timeout_ms_; } | 23 static int action_timeout_ms() { return action_timeout_ms_; } |
21 | 24 |
22 // Timeout longer than the above, but still suitable to use | 25 // Timeout longer than the above, but still suitable to use |
23 // multiple times in a single test. Use if the timeout above | 26 // multiple times in a single test. Use if the timeout above |
24 // is not sufficient. | 27 // is not sufficient. |
25 static int action_max_timeout_ms() { return action_max_timeout_ms_; } | 28 static int action_max_timeout_ms() { return action_max_timeout_ms_; } |
26 | 29 |
27 // Timeout for a large test that may take a few minutes to run. | 30 // Timeout for a large test that may take a few minutes to run. |
(...skipping 17 matching lines...) Expand all Loading... | |
45 | 48 |
46 // Timeout to wait for a live operation to complete. Used by tests that access | 49 // Timeout to wait for a live operation to complete. Used by tests that access |
47 // external services. | 50 // external services. |
48 static int live_operation_timeout_ms() { | 51 static int live_operation_timeout_ms() { |
49 return live_operation_timeout_ms_; | 52 return live_operation_timeout_ms_; |
50 } | 53 } |
51 | 54 |
52 private: | 55 private: |
53 static bool initialized_; | 56 static bool initialized_; |
54 | 57 |
58 static int short_timeout_ms_; | |
55 static int action_timeout_ms_; | 59 static int action_timeout_ms_; |
56 static int action_max_timeout_ms_; | 60 static int action_max_timeout_ms_; |
57 static int large_test_timeout_ms_; | 61 static int large_test_timeout_ms_; |
58 static int huge_test_timeout_ms_; | 62 static int huge_test_timeout_ms_; |
59 static int command_execution_timeout_ms_; | 63 static int command_execution_timeout_ms_; |
60 static int wait_for_terminate_timeout_ms_; | 64 static int wait_for_terminate_timeout_ms_; |
61 static int live_operation_timeout_ms_; | 65 static int live_operation_timeout_ms_; |
62 | 66 |
63 DISALLOW_IMPLICIT_CONSTRUCTORS(TestTimeouts); | 67 DISALLOW_IMPLICIT_CONSTRUCTORS(TestTimeouts); |
64 }; | 68 }; |
65 | 69 |
66 #endif // BASE_TEST_TEST_TIMEOUTS_H_ | 70 #endif // BASE_TEST_TEST_TIMEOUTS_H_ |
OLD | NEW |