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_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/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 | 262 |
263 perf_test::PrintResultList(graph, "", trace_name, timings, "ms", | 263 perf_test::PrintResultList(graph, "", trace_name, timings, "ms", |
264 true /* important */); | 264 true /* important */); |
265 } | 265 } |
266 | 266 |
267 void RunTest(const char* graph, const char* name, bool use_http) { | 267 void RunTest(const char* graph, const char* name, bool use_http) { |
268 RunTestWithSuffix(graph, name, use_http, ""); | 268 RunTestWithSuffix(graph, name, use_http, ""); |
269 } | 269 } |
270 | 270 |
271 private: | 271 private: |
272 void PrintMemoryHistogram(const std::string& name, | 272 void PrintMemoryHistogram(const std::string& name) { |
273 const std::string& units) { | |
274 scoped_refptr<TabProxy> tab(GetActiveTab()); | 273 scoped_refptr<TabProxy> tab(GetActiveTab()); |
275 ASSERT_TRUE(tab.get()); | 274 ASSERT_TRUE(tab.get()); |
276 std::wstring whistogram; | 275 std::wstring whistogram; |
277 ASSERT_TRUE(tab->ExecuteAndExtractString( | 276 ASSERT_TRUE(tab->ExecuteAndExtractString( |
278 L"", | 277 L"", |
279 L"window.domAutomationController.send(" | 278 L"window.domAutomationController.send(" |
280 L"window.domAutomationController.getHistogram ? " | 279 L"window.domAutomationController.getHistogram ? " |
281 L"window.domAutomationController.getHistogram(\"" + | 280 L"window.domAutomationController.getHistogram(\"" + |
282 base::SysUTF8ToWide(name) + L"\") : '')", | 281 base::SysUTF8ToWide(name) + L"\") : '')", |
283 &whistogram)); | 282 &whistogram)); |
284 std::string histogram = base::SysWideToNativeMB(whistogram); | 283 std::string histogram = base::SysWideToNativeMB(whistogram); |
285 printf("HISTOGRAM %s: %s = %s %s\n", | 284 printf("HISTOGRAM %s: %s = %s\n", |
286 name.c_str(), name.c_str(), histogram.c_str(), units.c_str()); | 285 name.c_str(), name.c_str(), histogram.c_str()); |
287 } | 286 } |
288 | 287 |
289 void PrintMemoryHistograms() { | 288 void PrintMemoryHistograms() { |
290 ASSERT_NO_FATAL_FAILURE(PrintMemoryHistogram( | 289 ASSERT_NO_FATAL_FAILURE(PrintMemoryHistogram( |
291 "V8.MemoryExternalFragmentationTotal", "percent")); | 290 "V8.MemoryExternalFragmentationTotal")); |
292 ASSERT_NO_FATAL_FAILURE(PrintMemoryHistogram( | 291 ASSERT_NO_FATAL_FAILURE(PrintMemoryHistogram( |
293 "V8.MemoryHeapSampleTotalCommitted", "kb")); | 292 "V8.MemoryHeapSampleTotalCommitted")); |
294 ASSERT_NO_FATAL_FAILURE(PrintMemoryHistogram( | 293 ASSERT_NO_FATAL_FAILURE(PrintMemoryHistogram( |
295 "V8.MemoryHeapSampleTotalUsed", "kb")); | 294 "V8.MemoryHeapSampleTotalUsed")); |
296 } | 295 } |
297 | 296 |
298 protected: | 297 protected: |
299 bool print_times_only_; | 298 bool print_times_only_; |
300 | 299 |
301 private: | 300 private: |
302 int num_test_iterations_; | 301 int num_test_iterations_; |
303 }; | 302 }; |
304 | 303 |
305 class PageCyclerReferenceTest : public PageCyclerTest { | 304 class PageCyclerReferenceTest : public PageCyclerTest { |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 PAGE_CYCLER_DATABASE_TESTS("delete-transactions", | 657 PAGE_CYCLER_DATABASE_TESTS("delete-transactions", |
659 DeleteTransactions); | 658 DeleteTransactions); |
660 PAGE_CYCLER_DATABASE_TESTS("pseudo-random-transactions", | 659 PAGE_CYCLER_DATABASE_TESTS("pseudo-random-transactions", |
661 PseudoRandomTransactions); | 660 PseudoRandomTransactions); |
662 #endif | 661 #endif |
663 | 662 |
664 // Indexed DB tests. | 663 // Indexed DB tests. |
665 PAGE_CYCLER_IDB_TESTS("basic_insert", BasicInsert); | 664 PAGE_CYCLER_IDB_TESTS("basic_insert", BasicInsert); |
666 | 665 |
667 } // namespace | 666 } // namespace |
OLD | NEW |