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

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

Issue 7744004: Avoid long test_server timeouts by using action_timeout_ms (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 3 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 25 matching lines...) Expand all
36 } 36 }
37 37
38 } // namespace 38 } // namespace
39 39
40 // static 40 // static
41 bool TestTimeouts::initialized_ = false; 41 bool TestTimeouts::initialized_ = false;
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_ = 10000;
47 int TestTimeouts::action_max_timeout_ms_ = 45000; 47 int TestTimeouts::action_max_timeout_ms_ = 45000;
48 int TestTimeouts::large_test_timeout_ms_ = 10 * 60 * 1000; 48 int TestTimeouts::large_test_timeout_ms_ = 10 * 60 * 1000;
49 49
50 // static 50 // static
51 void TestTimeouts::Initialize() { 51 void TestTimeouts::Initialize() {
52 if (initialized_) { 52 if (initialized_) {
53 NOTREACHED(); 53 NOTREACHED();
54 return; 54 return;
55 } 55 }
56 initialized_ = true; 56 initialized_ = true;
57 57
58 // Note that these timeouts MUST be initialized in the correct order as 58 // Note that these timeouts MUST be initialized in the correct order as
59 // per the CHECKS below. 59 // per the CHECKS below.
60 InitializeTimeout(switches::kTestTinyTimeout, &tiny_timeout_ms_); 60 InitializeTimeout(switches::kTestTinyTimeout, &tiny_timeout_ms_);
61 InitializeTimeout(switches::kUiTestActionTimeout, tiny_timeout_ms_, 61 InitializeTimeout(switches::kUiTestActionTimeout, tiny_timeout_ms_,
62 &action_timeout_ms_); 62 &action_timeout_ms_);
63 InitializeTimeout(switches::kUiTestActionMaxTimeout, action_timeout_ms_, 63 InitializeTimeout(switches::kUiTestActionMaxTimeout, action_timeout_ms_,
64 &action_max_timeout_ms_); 64 &action_max_timeout_ms_);
65 InitializeTimeout(switches::kTestLargeTimeout, action_max_timeout_ms_, 65 InitializeTimeout(switches::kTestLargeTimeout, action_max_timeout_ms_,
66 &large_test_timeout_ms_); 66 &large_test_timeout_ms_);
67 67
68 // The timeout values should be increasing in the right order. 68 // The timeout values should be increasing in the right order.
69 CHECK(tiny_timeout_ms_ <= action_timeout_ms_); 69 CHECK(tiny_timeout_ms_ <= action_timeout_ms_);
70 CHECK(action_timeout_ms_ <= action_max_timeout_ms_); 70 CHECK(action_timeout_ms_ <= action_max_timeout_ms_);
71 CHECK(action_max_timeout_ms_ <= large_test_timeout_ms_); 71 CHECK(action_max_timeout_ms_ <= large_test_timeout_ms_);
72 } 72 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/safe_browsing_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698