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/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/perftimer.h" | 7 #include "base/perftimer.h" |
8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 base::StringAppendF(×, "%.2f,", timings[i].InMillisecondsF()); | 39 base::StringAppendF(×, "%.2f,", timings[i].InMillisecondsF()); |
40 PrintResultList("new_tab", "", label, times, "ms", important); | 40 PrintResultList("new_tab", "", label, times, "ms", important); |
41 } | 41 } |
42 | 42 |
43 void InitProfile(UITestBase::ProfileType profile_type) { | 43 void InitProfile(UITestBase::ProfileType profile_type) { |
44 profile_type_ = profile_type; | 44 profile_type_ = profile_type; |
45 | 45 |
46 // Install the location of the test profile file. | 46 // Install the location of the test profile file. |
47 set_template_user_data(UITest::ComputeTypicalUserDataSource( | 47 set_template_user_data(UITest::ComputeTypicalUserDataSource( |
48 profile_type)); | 48 profile_type)); |
49 | |
50 // Disable the first run notification because it has an animation which | |
51 // masks any real performance regressions. | |
52 launch_arguments_.AppendSwitch(switches::kDisableNewTabFirstRun); | |
53 } | 49 } |
54 | 50 |
55 // Run the test, by bringing up a browser and timing the new tab startup. | 51 // Run the test, by bringing up a browser and timing the new tab startup. |
56 // |want_warm| is true if we should output warm-disk timings, false if | 52 // |want_warm| is true if we should output warm-disk timings, false if |
57 // we should report cold timings. | 53 // we should report cold timings. |
58 void RunStartupTest(const char* label, bool want_warm, bool important, | 54 void RunStartupTest(const char* label, bool want_warm, bool important, |
59 UITestBase::ProfileType profile_type) { | 55 UITestBase::ProfileType profile_type) { |
60 InitProfile(profile_type); | 56 InitProfile(profile_type); |
61 | 57 |
62 TimeDelta timings[kNumCycles]; | 58 TimeDelta timings[kNumCycles]; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 } | 209 } |
214 | 210 |
215 TEST_F(NewTabUIStartupTest, NativeFrameGtkThemeCold) { | 211 TEST_F(NewTabUIStartupTest, NativeFrameGtkThemeCold) { |
216 RunStartupTest("tab_custom_frame_gtk_theme_cold", false /* cold */, | 212 RunStartupTest("tab_custom_frame_gtk_theme_cold", false /* cold */, |
217 false /* not important */, | 213 false /* not important */, |
218 UITestBase::CUSTOM_FRAME_NATIVE_THEME); | 214 UITestBase::CUSTOM_FRAME_NATIVE_THEME); |
219 } | 215 } |
220 #endif | 216 #endif |
221 | 217 |
222 } // namespace | 218 } // namespace |
OLD | NEW |