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