| 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/environment.h" | 5 #include "base/environment.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
| 11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 12 #include "base/sys_info.h" | 12 #include "base/sys_info.h" |
| 13 #include "base/test/test_file_util.h" | 13 #include "base/test/test_file_util.h" |
| 14 #include "base/test/test_timeouts.h" |
| 14 #include "base/time.h" | 15 #include "base/time.h" |
| 15 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
| 16 #include "chrome/common/chrome_constants.h" | 17 #include "chrome/common/chrome_constants.h" |
| 17 #include "chrome/common/chrome_paths.h" | 18 #include "chrome/common/chrome_paths.h" |
| 18 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
| 19 #include "chrome/common/env_vars.h" | 20 #include "chrome/common/env_vars.h" |
| 20 #include "chrome/test/automation/automation_proxy.h" | 21 #include "chrome/test/automation/automation_proxy.h" |
| 21 #include "chrome/test/base/test_switches.h" | 22 #include "chrome/test/base/test_switches.h" |
| 22 #include "chrome/test/base/ui_test_utils.h" | 23 #include "chrome/test/base/ui_test_utils.h" |
| 23 #include "chrome/test/ui/ui_perf_test.h" | 24 #include "chrome/test/ui/ui_perf_test.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 } | 197 } |
| 197 } | 198 } |
| 198 if (num_tabs > 0) { | 199 if (num_tabs > 0) { |
| 199 float min_start; | 200 float min_start; |
| 200 float max_stop; | 201 float max_stop; |
| 201 std::vector<float> times; | 202 std::vector<float> times; |
| 202 scoped_refptr<BrowserProxy> browser_proxy( | 203 scoped_refptr<BrowserProxy> browser_proxy( |
| 203 automation()->GetBrowserWindow(0)); | 204 automation()->GetBrowserWindow(0)); |
| 204 ASSERT_TRUE(browser_proxy.get()); | 205 ASSERT_TRUE(browser_proxy.get()); |
| 205 | 206 |
| 206 if (browser_proxy->GetInitialLoadTimes(&min_start, &max_stop, ×) && | 207 if (browser_proxy->GetInitialLoadTimes( |
| 208 TestTimeouts::action_max_timeout_ms(), |
| 209 &min_start, |
| 210 &max_stop, |
| 211 ×) && |
| 207 !times.empty()) { | 212 !times.empty()) { |
| 208 ASSERT_LT(nth_timed_tab, num_tabs); | 213 ASSERT_LT(nth_timed_tab, num_tabs); |
| 209 ASSERT_EQ(times.size(), static_cast<size_t>(num_tabs)); | 214 ASSERT_EQ(times.size(), static_cast<size_t>(num_tabs)); |
| 210 timings[i].first_start_ms = min_start; | 215 timings[i].first_start_ms = min_start; |
| 211 timings[i].last_stop_ms = max_stop; | 216 timings[i].last_stop_ms = max_stop; |
| 212 timings[i].first_stop_ms = times[0]; | 217 timings[i].first_stop_ms = times[0]; |
| 213 timings[i].nth_tab_stop_ms = times[nth_timed_tab]; | 218 timings[i].nth_tab_stop_ms = times[nth_timed_tab]; |
| 214 } else { | 219 } else { |
| 215 // Browser might not support initial load times. | 220 // Browser might not support initial load times. |
| 216 // Only use end-to-end time for this test. | 221 // Only use end-to-end time for this test. |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 UITestBase::CUSTOM_FRAME, 0, 0); | 453 UITestBase::CUSTOM_FRAME, 0, 0); |
| 449 } | 454 } |
| 450 | 455 |
| 451 TEST_F(StartupTest, PerfNativeFrameGtkTheme) { | 456 TEST_F(StartupTest, PerfNativeFrameGtkTheme) { |
| 452 RunStartupTest("warm", "custom-frame-gtk-theme", WARM, NOT_IMPORTANT, | 457 RunStartupTest("warm", "custom-frame-gtk-theme", WARM, NOT_IMPORTANT, |
| 453 UITestBase::CUSTOM_FRAME_NATIVE_THEME, 0, 0); | 458 UITestBase::CUSTOM_FRAME_NATIVE_THEME, 0, 0); |
| 454 } | 459 } |
| 455 #endif | 460 #endif |
| 456 | 461 |
| 457 } // namespace | 462 } // namespace |
| OLD | NEW |