| 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" |
| 11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 #include "base/time.h" | 12 #include "base/time.h" |
| 13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 14 #include "chrome/app/chrome_dll_resource.h" | 14 #include "chrome/app/chrome_dll_resource.h" |
| 15 #include "chrome/common/chrome_paths.h" | 15 #include "chrome/common/chrome_paths.h" |
| 16 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
| 17 #include "chrome/common/env_vars.h" | 17 #include "chrome/common/env_vars.h" |
| 18 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 19 #include "chrome/test/automation/tab_proxy.h" | 19 #include "chrome/test/automation/tab_proxy.h" |
| 20 #include "chrome/test/automation/browser_proxy.h" | 20 #include "chrome/test/automation/browser_proxy.h" |
| 21 #include "chrome/test/ui/ui_test.h" | 21 #include "chrome/test/ui/ui_perf_test.h" |
| 22 #include "googleurl/src/gurl.h" | 22 #include "googleurl/src/gurl.h" |
| 23 #include "net/base/net_util.h" | 23 #include "net/base/net_util.h" |
| 24 | 24 |
| 25 using base::TimeDelta; | 25 using base::TimeDelta; |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 // This Automated UI test opens static files in different tabs in a proxy | 29 // This Automated UI test opens static files in different tabs in a proxy |
| 30 // browser. After all the tabs have opened, it switches between tabs, and notes | 30 // browser. After all the tabs have opened, it switches between tabs, and notes |
| 31 // time taken for each switch. It then prints out the times on the console, | 31 // time taken for each switch. It then prints out the times on the console, |
| 32 // with the aim that the page cycler parser can interpret these numbers to | 32 // with the aim that the page cycler parser can interpret these numbers to |
| 33 // draw graphs for page cycler Tab Switching Performance. | 33 // draw graphs for page cycler Tab Switching Performance. |
| 34 class TabSwitchingUITest : public UITest { | 34 class TabSwitchingUITest : public UIPerfTest { |
| 35 public: | 35 public: |
| 36 TabSwitchingUITest() { | 36 TabSwitchingUITest() { |
| 37 PathService::Get(base::DIR_SOURCE_ROOT, &path_prefix_); | 37 PathService::Get(base::DIR_SOURCE_ROOT, &path_prefix_); |
| 38 path_prefix_ = path_prefix_.AppendASCII("data"); | 38 path_prefix_ = path_prefix_.AppendASCII("data"); |
| 39 path_prefix_ = path_prefix_.AppendASCII("tab_switching"); | 39 path_prefix_ = path_prefix_.AppendASCII("tab_switching"); |
| 40 | 40 |
| 41 show_window_ = true; | 41 show_window_ = true; |
| 42 } | 42 } |
| 43 | 43 |
| 44 void SetUp() { | 44 void SetUp() { |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 TEST_F(TabSwitchingUITest, TabSwitch) { | 185 TEST_F(TabSwitchingUITest, TabSwitch) { |
| 186 RunTabSwitchingUITest("t", true); | 186 RunTabSwitchingUITest("t", true); |
| 187 } | 187 } |
| 188 | 188 |
| 189 TEST_F(TabSwitchingUITest, TabSwitchRef) { | 189 TEST_F(TabSwitchingUITest, TabSwitchRef) { |
| 190 UseReferenceBuild(); | 190 UseReferenceBuild(); |
| 191 RunTabSwitchingUITest("t_ref", true); | 191 RunTabSwitchingUITest("t_ref", true); |
| 192 } | 192 } |
| 193 | 193 |
| 194 } // namespace | 194 } // namespace |
| OLD | NEW |