| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "chrome/app/chrome_dll_resource.h" | 7 #include "chrome/app/chrome_dll_resource.h" |
| 8 #include "chrome/common/chrome_paths.h" | 8 #include "chrome/common/chrome_paths.h" |
| 9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
| 10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // Print the average and standard deviation. | 101 // Print the average and standard deviation. |
| 102 PrintResultMeanAndError("tab_switch", "", "t", | 102 PrintResultMeanAndError("tab_switch", "", "t", |
| 103 average + ", " + std_dev, "ms", | 103 average + ", " + std_dev, "ms", |
| 104 true /* important */); | 104 true /* important */); |
| 105 } | 105 } |
| 106 | 106 |
| 107 protected: | 107 protected: |
| 108 // Opens new tabs. Returns the number of tabs opened. | 108 // Opens new tabs. Returns the number of tabs opened. |
| 109 int OpenTabs() { | 109 int OpenTabs() { |
| 110 // Add tabs. | 110 // Add tabs. |
| 111 static const wchar_t* files[] = { L"espn.go.com", L"bugzilla.mozilla.org", | 111 static const char* files[] = { "espn.go.com", "bugzilla.mozilla.org", |
| 112 L"news.cnet.com", L"www.amazon.com", | 112 "news.cnet.com", "www.amazon.com", |
| 113 L"kannada.chakradeo.net", L"allegro.pl", | 113 "kannada.chakradeo.net", "allegro.pl", |
| 114 L"ml.wikipedia.org", L"www.bbc.co.uk", | 114 "ml.wikipedia.org", "www.bbc.co.uk", |
| 115 L"126.com", L"www.altavista.com"}; | 115 "126.com", "www.altavista.com"}; |
| 116 int number_of_new_tabs_opened = 0; | 116 int number_of_new_tabs_opened = 0; |
| 117 std::wstring file_name; | 117 FilePath file_name; |
| 118 for (int i = 0; i < arraysize(files); ++i) { | 118 for (int i = 0; i < arraysize(files); ++i) { |
| 119 file_name = path_prefix_; | 119 file_name = FilePath::FromWStringHack(path_prefix_); |
| 120 file_name += files[i]; | 120 file_name = file_name.AppendASCII(files[i]); |
| 121 file_name += FilePath::kSeparators[0]; | 121 file_name = file_name.AppendASCII("index.html"); |
| 122 file_name += L"index.html"; | |
| 123 browser_proxy_->AppendTab(net::FilePathToFileURL(file_name)); | 122 browser_proxy_->AppendTab(net::FilePathToFileURL(file_name)); |
| 124 number_of_new_tabs_opened++; | 123 number_of_new_tabs_opened++; |
| 125 } | 124 } |
| 126 | 125 |
| 127 return number_of_new_tabs_opened; | 126 return number_of_new_tabs_opened; |
| 128 } | 127 } |
| 129 | 128 |
| 130 std::wstring path_prefix_; | 129 std::wstring path_prefix_; |
| 131 int number_of_tabs_to_open_; | 130 int number_of_tabs_to_open_; |
| 132 scoped_ptr<BrowserProxy> browser_proxy_; | 131 scoped_ptr<BrowserProxy> browser_proxy_; |
| 133 | 132 |
| 134 private: | 133 private: |
| 135 DISALLOW_EVIL_CONSTRUCTORS(TabSwitchingUITest); | 134 DISALLOW_EVIL_CONSTRUCTORS(TabSwitchingUITest); |
| 136 }; | 135 }; |
| 137 | 136 |
| 138 } // namespace | 137 } // namespace |
| 139 | 138 |
| 140 TEST_F(TabSwitchingUITest, GenerateTabSwitchStats) { | 139 TEST_F(TabSwitchingUITest, GenerateTabSwitchStats) { |
| 141 RunTabSwitchingUITest(); | 140 RunTabSwitchingUITest(); |
| 142 } | 141 } |
| OLD | NEW |