OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 } | 123 } |
124 VLOG(1) << "Buffer cache should be primed with " << loaded << " files."; | 124 VLOG(1) << "Buffer cache should be primed with " << loaded << " files."; |
125 } | 125 } |
126 | 126 |
127 class PageCyclerTest : public UIPerfTest { | 127 class PageCyclerTest : public UIPerfTest { |
128 public: | 128 public: |
129 PageCyclerTest() : print_times_only_(false), | 129 PageCyclerTest() : print_times_only_(false), |
130 num_test_iterations_(kTestIterations) { | 130 num_test_iterations_(kTestIterations) { |
131 show_window_ = true; | 131 show_window_ = true; |
132 dom_automation_enabled_ = true; | 132 dom_automation_enabled_ = true; |
| 133 stats_collection_controller_enabled_ = true; |
133 | 134 |
134 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 135 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
135 if (parsed_command_line.HasSwitch(switches::kPageCyclerIterations)) { | 136 if (parsed_command_line.HasSwitch(switches::kPageCyclerIterations)) { |
136 std::string str = parsed_command_line.GetSwitchValueASCII( | 137 std::string str = parsed_command_line.GetSwitchValueASCII( |
137 switches::kPageCyclerIterations); | 138 switches::kPageCyclerIterations); |
138 base::StringToInt(str, &num_test_iterations_); | 139 base::StringToInt(str, &num_test_iterations_); |
139 } | 140 } |
140 } | 141 } |
141 | 142 |
142 virtual void SetLaunchSwitches() OVERRIDE { | 143 virtual void SetLaunchSwitches() OVERRIDE { |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 | 272 |
272 private: | 273 private: |
273 void PrintMemoryHistogram(const std::string& name, | 274 void PrintMemoryHistogram(const std::string& name, |
274 const std::string& units) { | 275 const std::string& units) { |
275 scoped_refptr<TabProxy> tab(GetActiveTab()); | 276 scoped_refptr<TabProxy> tab(GetActiveTab()); |
276 ASSERT_TRUE(tab.get()); | 277 ASSERT_TRUE(tab.get()); |
277 std::wstring whistogram; | 278 std::wstring whistogram; |
278 ASSERT_TRUE(tab->ExecuteAndExtractString( | 279 ASSERT_TRUE(tab->ExecuteAndExtractString( |
279 std::wstring(), | 280 std::wstring(), |
280 L"window.domAutomationController.send(" | 281 L"window.domAutomationController.send(" |
281 L"window.domAutomationController.getHistogram ? " | 282 L"window.statsCollectionController.getHistogram ? " |
282 L"window.domAutomationController.getHistogram(\"" + | 283 L"window.statsCollectionController.getHistogram(\"" + |
283 base::SysUTF8ToWide(name) + L"\") : '')", | 284 base::SysUTF8ToWide(name) + L"\") : '')", |
284 &whistogram)); | 285 &whistogram)); |
285 std::string histogram = base::SysWideToNativeMB(whistogram); | 286 std::string histogram = base::SysWideToNativeMB(whistogram); |
286 printf("HISTOGRAM %s: %s = %s %s\n", | 287 printf("HISTOGRAM %s: %s = %s %s\n", |
287 name.c_str(), name.c_str(), histogram.c_str(), units.c_str()); | 288 name.c_str(), name.c_str(), histogram.c_str(), units.c_str()); |
288 } | 289 } |
289 | 290 |
290 void PrintMemoryHistograms() { | 291 void PrintMemoryHistograms() { |
291 ASSERT_NO_FATAL_FAILURE(PrintMemoryHistogram( | 292 ASSERT_NO_FATAL_FAILURE(PrintMemoryHistogram( |
292 "V8.MemoryExternalFragmentationTotal", "percent")); | 293 "V8.MemoryExternalFragmentationTotal", "percent")); |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 TEST_F(PageCyclerAccessibilityTest, MozFileWithAccessibilityEnabled) { | 679 TEST_F(PageCyclerAccessibilityTest, MozFileWithAccessibilityEnabled) { |
679 num_test_iterations_ = 1; | 680 num_test_iterations_ = 1; |
680 RunTest("times", "moz", false); | 681 RunTest("times", "moz", false); |
681 } | 682 } |
682 | 683 |
683 TEST_F(PageCyclerAccessibilityTest, MorejsFileWithAccessibilityEnabled) { | 684 TEST_F(PageCyclerAccessibilityTest, MorejsFileWithAccessibilityEnabled) { |
684 RunTest("times", "morejs", false); | 685 RunTest("times", "morejs", false); |
685 } | 686 } |
686 | 687 |
687 } // namespace | 688 } // namespace |
OLD | NEW |