Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(517)

Side by Side Diff: trunk/src/chrome/test/perf/page_cycler_test.cc

Issue 16160006: Revert 202620 "Collect tab timing information for use in telemen..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | trunk/src/chrome/test/ui/ui_test.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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;
134 133
135 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); 134 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
136 if (parsed_command_line.HasSwitch(switches::kPageCyclerIterations)) { 135 if (parsed_command_line.HasSwitch(switches::kPageCyclerIterations)) {
137 std::string str = parsed_command_line.GetSwitchValueASCII( 136 std::string str = parsed_command_line.GetSwitchValueASCII(
138 switches::kPageCyclerIterations); 137 switches::kPageCyclerIterations);
139 base::StringToInt(str, &num_test_iterations_); 138 base::StringToInt(str, &num_test_iterations_);
140 } 139 }
141 } 140 }
142 141
143 virtual void SetLaunchSwitches() OVERRIDE { 142 virtual void SetLaunchSwitches() OVERRIDE {
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 271
273 private: 272 private:
274 void PrintMemoryHistogram(const std::string& name, 273 void PrintMemoryHistogram(const std::string& name,
275 const std::string& units) { 274 const std::string& units) {
276 scoped_refptr<TabProxy> tab(GetActiveTab()); 275 scoped_refptr<TabProxy> tab(GetActiveTab());
277 ASSERT_TRUE(tab.get()); 276 ASSERT_TRUE(tab.get());
278 std::wstring whistogram; 277 std::wstring whistogram;
279 ASSERT_TRUE(tab->ExecuteAndExtractString( 278 ASSERT_TRUE(tab->ExecuteAndExtractString(
280 std::wstring(), 279 std::wstring(),
281 L"window.domAutomationController.send(" 280 L"window.domAutomationController.send("
282 L"window.statsCollectionController.getHistogram ? " 281 L"window.domAutomationController.getHistogram ? "
283 L"window.statsCollectionController.getHistogram(\"" + 282 L"window.domAutomationController.getHistogram(\"" +
284 base::SysUTF8ToWide(name) + L"\") : '')", 283 base::SysUTF8ToWide(name) + L"\") : '')",
285 &whistogram)); 284 &whistogram));
286 std::string histogram = base::SysWideToNativeMB(whistogram); 285 std::string histogram = base::SysWideToNativeMB(whistogram);
287 printf("HISTOGRAM %s: %s = %s %s\n", 286 printf("HISTOGRAM %s: %s = %s %s\n",
288 name.c_str(), name.c_str(), histogram.c_str(), units.c_str()); 287 name.c_str(), name.c_str(), histogram.c_str(), units.c_str());
289 } 288 }
290 289
291 void PrintMemoryHistograms() { 290 void PrintMemoryHistograms() {
292 ASSERT_NO_FATAL_FAILURE(PrintMemoryHistogram( 291 ASSERT_NO_FATAL_FAILURE(PrintMemoryHistogram(
293 "V8.MemoryExternalFragmentationTotal", "percent")); 292 "V8.MemoryExternalFragmentationTotal", "percent"));
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 TEST_F(PageCyclerAccessibilityTest, MozFileWithAccessibilityEnabled) { 678 TEST_F(PageCyclerAccessibilityTest, MozFileWithAccessibilityEnabled) {
680 num_test_iterations_ = 1; 679 num_test_iterations_ = 1;
681 RunTest("times", "moz", false); 680 RunTest("times", "moz", false);
682 } 681 }
683 682
684 TEST_F(PageCyclerAccessibilityTest, MorejsFileWithAccessibilityEnabled) { 683 TEST_F(PageCyclerAccessibilityTest, MorejsFileWithAccessibilityEnabled) {
685 RunTest("times", "morejs", false); 684 RunTest("times", "morejs", false);
686 } 685 }
687 686
688 } // namespace 687 } // namespace
OLDNEW
« no previous file with comments | « no previous file | trunk/src/chrome/test/ui/ui_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698