Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Side by Side Diff: base/test/test_timeouts.h

Issue 2532793002: Add a TestBrowserDialog helper class for testing browser dialogs in a consistent way. (Closed)
Patch Set: Respond to comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | base/test/test_timeouts.cc » ('j') | chrome/browser/ui/test/test_browser_dialog.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/logging.h" 8 #include "base/logging.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
11 11
12 // Returns common timeouts to use in tests. Makes it possible to adjust 12 // Returns common timeouts to use in tests. Makes it possible to adjust
13 // the timeouts for different environments (like Valgrind). 13 // the timeouts for different environments (like Valgrind).
14 class TestTimeouts { 14 class TestTimeouts {
15 public: 15 public:
16 // Argument that can be passed on the command line to indicate "no timeout".
17 static const char kNoTimeoutSwitchValue[];
Peter Kasting 2016/12/15 08:12:29 Nit: Can this be declared constexpr? Maybe by mov
tapted 2016/12/16 04:21:53 Done. Although (curiously?) Clang was happy with j
Peter Kasting 2016/12/16 06:30:56 That's all very weird... when I tested something s
18
16 // Initializes the timeouts. Non thread-safe. Should be called exactly once 19 // Initializes the timeouts. Non thread-safe. Should be called exactly once
17 // by the test suite. 20 // by the test suite.
18 static void Initialize(); 21 static void Initialize();
19 22
20 // Timeout for actions that are expected to finish "almost instantly". 23 // Timeout for actions that are expected to finish "almost instantly".
21 static base::TimeDelta tiny_timeout() { 24 static base::TimeDelta tiny_timeout() {
22 DCHECK(initialized_); 25 DCHECK(initialized_);
23 return base::TimeDelta::FromMilliseconds(tiny_timeout_ms_); 26 return base::TimeDelta::FromMilliseconds(tiny_timeout_ms_);
24 } 27 }
25 28
(...skipping 24 matching lines...) Expand all
50 53
51 static int tiny_timeout_ms_; 54 static int tiny_timeout_ms_;
52 static int action_timeout_ms_; 55 static int action_timeout_ms_;
53 static int action_max_timeout_ms_; 56 static int action_max_timeout_ms_;
54 static int test_launcher_timeout_ms_; 57 static int test_launcher_timeout_ms_;
55 58
56 DISALLOW_IMPLICIT_CONSTRUCTORS(TestTimeouts); 59 DISALLOW_IMPLICIT_CONSTRUCTORS(TestTimeouts);
57 }; 60 };
58 61
59 #endif // BASE_TEST_TEST_TIMEOUTS_H_ 62 #endif // BASE_TEST_TEST_TIMEOUTS_H_
OLDNEW
« no previous file with comments | « no previous file | base/test/test_timeouts.cc » ('j') | chrome/browser/ui/test/test_browser_dialog.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698