| OLD | NEW |
| (Empty) |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "mojo/edk/system/test_utils.h" | |
| 6 | |
| 7 #include "base/test/test_timeouts.h" | |
| 8 #include "build/build_config.h" | |
| 9 | |
| 10 namespace mojo { | |
| 11 namespace system { | |
| 12 namespace test { | |
| 13 | |
| 14 base::TimeDelta EpsilonTimeout() { | |
| 15 // Originally, our epsilon timeout was 10 ms, which was mostly fine but flaky on | |
| 16 // some Windows bots. I don't recall ever seeing flakes on other bots. At 30 ms | |
| 17 // tests seem reliable on Windows bots, but not at 25 ms. We'd like this timeout | |
| 18 // to be as small as possible (see the description in the .h file). | |
| 19 // | |
| 20 // Currently, |tiny_timeout()| is usually 100 ms (possibly scaled under ASAN, | |
| 21 // etc.). Based on this, set it to (usually be) 30 ms on Windows and 20 ms | |
| 22 // elsewhere. | |
| 23 #if defined(OS_WIN) || defined(OS_ANDROID) | |
| 24 return (TestTimeouts::tiny_timeout() * 3) / 10; | |
| 25 #else | |
| 26 return (TestTimeouts::tiny_timeout() * 2) / 10; | |
| 27 #endif | |
| 28 } | |
| 29 | |
| 30 } // namespace test | |
| 31 } // namespace system | |
| 32 } // namespace mojo | |
| OLD | NEW |