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 #include "base/test/test_timeouts.h" | 5 #include "base/test/test_timeouts.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/test/test_switches.h" | 10 #include "base/test/test_switches.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 // The timeout values should increase in the order they appear in this block. | 43 // The timeout values should increase in the order they appear in this block. |
44 // static | 44 // static |
45 int TestTimeouts::tiny_timeout_ms_ = 100; | 45 int TestTimeouts::tiny_timeout_ms_ = 100; |
46 int TestTimeouts::action_timeout_ms_ = 2000; | 46 int TestTimeouts::action_timeout_ms_ = 2000; |
47 int TestTimeouts::action_max_timeout_ms_ = 25000; | 47 int TestTimeouts::action_max_timeout_ms_ = 25000; |
48 int TestTimeouts::large_test_timeout_ms_ = 3 * 60 * 1000; | 48 int TestTimeouts::large_test_timeout_ms_ = 3 * 60 * 1000; |
49 int TestTimeouts::huge_test_timeout_ms_ = 10 * 60 * 1000; | 49 int TestTimeouts::huge_test_timeout_ms_ = 10 * 60 * 1000; |
50 | 50 |
51 // static | 51 // static |
52 int TestTimeouts::wait_for_terminate_timeout_ms_ = 15000; | |
53 | |
54 // static | |
55 int TestTimeouts::live_operation_timeout_ms_ = 45000; | 52 int TestTimeouts::live_operation_timeout_ms_ = 45000; |
56 | 53 |
57 // static | 54 // static |
58 void TestTimeouts::Initialize() { | 55 void TestTimeouts::Initialize() { |
59 if (initialized_) { | 56 if (initialized_) { |
60 NOTREACHED(); | 57 NOTREACHED(); |
61 return; | 58 return; |
62 } | 59 } |
63 initialized_ = true; | 60 initialized_ = true; |
64 | 61 |
65 // Note that these timeouts MUST be initialized in the correct order as | 62 // Note that these timeouts MUST be initialized in the correct order as |
66 // per the CHECKS below. | 63 // per the CHECKS below. |
67 InitializeTimeout(switches::kTestTinyTimeout, &tiny_timeout_ms_); | 64 InitializeTimeout(switches::kTestTinyTimeout, &tiny_timeout_ms_); |
68 InitializeTimeout(switches::kUiTestActionTimeout, tiny_timeout_ms_, | 65 InitializeTimeout(switches::kUiTestActionTimeout, tiny_timeout_ms_, |
69 &action_timeout_ms_); | 66 &action_timeout_ms_); |
70 InitializeTimeout(switches::kUiTestActionMaxTimeout, action_timeout_ms_, | 67 InitializeTimeout(switches::kUiTestActionMaxTimeout, action_timeout_ms_, |
71 &action_max_timeout_ms_); | 68 &action_max_timeout_ms_); |
72 InitializeTimeout(switches::kTestLargeTimeout, action_max_timeout_ms_, | 69 InitializeTimeout(switches::kTestLargeTimeout, action_max_timeout_ms_, |
73 &large_test_timeout_ms_); | 70 &large_test_timeout_ms_); |
74 InitializeTimeout(switches::kUiTestTimeout, large_test_timeout_ms_, | 71 InitializeTimeout(switches::kUiTestTimeout, large_test_timeout_ms_, |
75 &huge_test_timeout_ms_); | 72 &huge_test_timeout_ms_); |
76 | 73 |
77 // The timeout values should be increasing in the right order. | 74 // The timeout values should be increasing in the right order. |
78 CHECK(tiny_timeout_ms_ <= action_timeout_ms_); | 75 CHECK(tiny_timeout_ms_ <= action_timeout_ms_); |
79 CHECK(action_timeout_ms_ <= action_max_timeout_ms_); | 76 CHECK(action_timeout_ms_ <= action_max_timeout_ms_); |
80 CHECK(action_max_timeout_ms_ <= large_test_timeout_ms_); | 77 CHECK(action_max_timeout_ms_ <= large_test_timeout_ms_); |
81 CHECK(large_test_timeout_ms_ <= huge_test_timeout_ms_); | 78 CHECK(large_test_timeout_ms_ <= huge_test_timeout_ms_); |
82 | 79 |
83 InitializeTimeout(switches::kUiTestTerminateTimeout, | |
84 &wait_for_terminate_timeout_ms_); | |
85 | |
86 InitializeTimeout(switches::kLiveOperationTimeout, | 80 InitializeTimeout(switches::kLiveOperationTimeout, |
87 &live_operation_timeout_ms_); | 81 &live_operation_timeout_ms_); |
88 } | 82 } |
OLD | NEW |