| 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" |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 | 13 |
| 14 #ifdef ADDRESS_SANITIZER | 14 #ifdef ADDRESS_SANITIZER |
| 15 static const int kTimeoutMultiplier = 2; | 15 static const int kTimeoutMultiplier = 4; |
| 16 #else | 16 #else |
| 17 static const int kTimeoutMultiplier = 1; | 17 static const int kTimeoutMultiplier = 1; |
| 18 #endif | 18 #endif |
| 19 | 19 |
| 20 // Sets value to the greatest of: | 20 // Sets value to the greatest of: |
| 21 // 1) value's current value multiplied by kTimeoutMultiplier (assuming | 21 // 1) value's current value multiplied by kTimeoutMultiplier (assuming |
| 22 // InitializeTimeout is called only once per value). | 22 // InitializeTimeout is called only once per value). |
| 23 // 2) min_value. | 23 // 2) min_value. |
| 24 // 3) the numerical value given by switch_name on the command line multiplied | 24 // 3) the numerical value given by switch_name on the command line multiplied |
| 25 // by kTimeoutMultiplier. | 25 // by kTimeoutMultiplier. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 InitializeTimeout(switches::kUiTestActionMaxTimeout, action_timeout_ms_, | 73 InitializeTimeout(switches::kUiTestActionMaxTimeout, action_timeout_ms_, |
| 74 &action_max_timeout_ms_); | 74 &action_max_timeout_ms_); |
| 75 InitializeTimeout(switches::kTestLargeTimeout, action_max_timeout_ms_, | 75 InitializeTimeout(switches::kTestLargeTimeout, action_max_timeout_ms_, |
| 76 &large_test_timeout_ms_); | 76 &large_test_timeout_ms_); |
| 77 | 77 |
| 78 // The timeout values should be increasing in the right order. | 78 // The timeout values should be increasing in the right order. |
| 79 CHECK(tiny_timeout_ms_ <= action_timeout_ms_); | 79 CHECK(tiny_timeout_ms_ <= action_timeout_ms_); |
| 80 CHECK(action_timeout_ms_ <= action_max_timeout_ms_); | 80 CHECK(action_timeout_ms_ <= action_max_timeout_ms_); |
| 81 CHECK(action_max_timeout_ms_ <= large_test_timeout_ms_); | 81 CHECK(action_max_timeout_ms_ <= large_test_timeout_ms_); |
| 82 } | 82 } |
| OLD | NEW |