OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/environment.h" | 6 #include "base/environment.h" |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/platform_thread.h" | 10 #include "base/platform_thread.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // Run the rest of the UITest initialization. | 59 // Run the rest of the UITest initialization. |
60 UITest::SetUp(); | 60 UITest::SetUp(); |
61 } | 61 } |
62 | 62 |
63 static const int kNumCycles = 5; | 63 static const int kNumCycles = 5; |
64 | 64 |
65 void PrintTimings(const char* label, TimeDelta timings[kNumCycles], | 65 void PrintTimings(const char* label, TimeDelta timings[kNumCycles], |
66 bool important) { | 66 bool important) { |
67 std::string times; | 67 std::string times; |
68 for (int i = 0; i < kNumCycles; ++i) | 68 for (int i = 0; i < kNumCycles; ++i) |
69 StringAppendF(×, "%.2f,", timings[i].InMillisecondsF()); | 69 base::StringAppendF(×, "%.2f,", timings[i].InMillisecondsF()); |
70 PrintResultList("times", "", label, times, "ms", important); | 70 PrintResultList("times", "", label, times, "ms", important); |
71 } | 71 } |
72 | 72 |
73 void RunTabSwitchingUITest(const char* label, bool important) { | 73 void RunTabSwitchingUITest(const char* label, bool important) { |
74 // Shut down from window UITest sets up automatically. | 74 // Shut down from window UITest sets up automatically. |
75 UITest::TearDown(); | 75 UITest::TearDown(); |
76 | 76 |
77 TimeDelta timings[kNumCycles]; | 77 TimeDelta timings[kNumCycles]; |
78 for (int i = 0; i < kNumCycles; ++i) { | 78 for (int i = 0; i < kNumCycles; ++i) { |
79 // Prepare for this test run. | 79 // Prepare for this test run. |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 TEST_F(TabSwitchingUITest, TabSwitch) { | 186 TEST_F(TabSwitchingUITest, TabSwitch) { |
187 RunTabSwitchingUITest("t", true); | 187 RunTabSwitchingUITest("t", true); |
188 } | 188 } |
189 | 189 |
190 TEST_F(TabSwitchingUITest, TabSwitchRef) { | 190 TEST_F(TabSwitchingUITest, TabSwitchRef) { |
191 UseReferenceBuild(); | 191 UseReferenceBuild(); |
192 RunTabSwitchingUITest("t_ref", true); | 192 RunTabSwitchingUITest("t_ref", true); |
193 } | 193 } |
194 | 194 |
195 } // namespace | 195 } // namespace |
OLD | NEW |