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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/debugger.h" | 10 #include "base/debug/debugger.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "base/test/test_switches.h" | 13 #include "base/test/test_switches.h" |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 // ASan and TSan instrument each memory access. This may slow the execution | 17 // ASan and TSan instrument each memory access. This may slow the execution |
18 // down significantly. | 18 // down significantly. |
19 #if defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER) | 19 #if defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER) || defined(SYZYASAN) |
20 static const int kTimeoutMultiplier = 2; | 20 static const int kTimeoutMultiplier = 2; |
21 #else | 21 #else |
22 static const int kTimeoutMultiplier = 1; | 22 static const int kTimeoutMultiplier = 1; |
23 #endif | 23 #endif |
24 | 24 |
25 const int kAlmostInfiniteTimeoutMs = 100000000; | 25 const int kAlmostInfiniteTimeoutMs = 100000000; |
26 | 26 |
27 // Sets value to the greatest of: | 27 // Sets value to the greatest of: |
28 // 1) value's current value multiplied by kTimeoutMultiplier (assuming | 28 // 1) value's current value multiplied by kTimeoutMultiplier (assuming |
29 // InitializeTimeout is called only once per value). | 29 // InitializeTimeout is called only once per value). |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 InitializeTimeout(switches::kTestLauncherTimeout, action_timeout_ms_, | 99 InitializeTimeout(switches::kTestLauncherTimeout, action_timeout_ms_, |
100 &test_launcher_timeout_ms_); | 100 &test_launcher_timeout_ms_); |
101 | 101 |
102 // The timeout values should be increasing in the right order. | 102 // The timeout values should be increasing in the right order. |
103 CHECK(tiny_timeout_ms_ <= action_timeout_ms_); | 103 CHECK(tiny_timeout_ms_ <= action_timeout_ms_); |
104 CHECK(action_timeout_ms_ <= action_max_timeout_ms_); | 104 CHECK(action_timeout_ms_ <= action_max_timeout_ms_); |
105 CHECK(action_max_timeout_ms_ <= large_test_timeout_ms_); | 105 CHECK(action_max_timeout_ms_ <= large_test_timeout_ms_); |
106 | 106 |
107 CHECK(action_timeout_ms_ <= test_launcher_timeout_ms_); | 107 CHECK(action_timeout_ms_ <= test_launcher_timeout_ms_); |
108 } | 108 } |
OLD | NEW |