| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome_frame/test/perf/chrome_frame_perftest.h" | 4 #include "chrome_frame/test/perf/chrome_frame_perftest.h" |
| 5 | 5 |
| 6 #include <atlwin.h> | 6 #include <atlwin.h> |
| 7 #include <atlhost.h> | 7 #include <atlhost.h> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "base/scoped_comptr_win.h" | 23 #include "base/scoped_comptr_win.h" |
| 24 #include "base/scoped_variant_win.h" | 24 #include "base/scoped_variant_win.h" |
| 25 #include "base/string_util.h" | 25 #include "base/string_util.h" |
| 26 #include "base/time.h" | 26 #include "base/time.h" |
| 27 #include "base/trace_event_win.h" | 27 #include "base/trace_event_win.h" |
| 28 #include "base/utf_string_conversions.h" | 28 #include "base/utf_string_conversions.h" |
| 29 #include "chrome/common/chrome_constants.h" | 29 #include "chrome/common/chrome_constants.h" |
| 30 #include "chrome/common/chrome_paths.h" | 30 #include "chrome/common/chrome_paths.h" |
| 31 #include "chrome/common/chrome_paths_internal.h" | 31 #include "chrome/common/chrome_paths_internal.h" |
| 32 #include "chrome/test/chrome_process_util.h" | 32 #include "chrome/test/chrome_process_util.h" |
| 33 #include "chrome/test/ui/ui_test.h" | 33 #include "chrome/test/ui/ui_perf_test.h" |
| 34 | 34 |
| 35 #include "chrome_frame/test_utils.h" | 35 #include "chrome_frame/test_utils.h" |
| 36 #include "chrome_frame/utils.h" | 36 #include "chrome_frame/utils.h" |
| 37 | 37 |
| 38 const wchar_t kSilverlightControlKey[] = | 38 const wchar_t kSilverlightControlKey[] = |
| 39 L"CLSID\\{DFEAF541-F3E1-4c24-ACAC-99C30715084A}\\InprocServer32"; | 39 L"CLSID\\{DFEAF541-F3E1-4c24-ACAC-99C30715084A}\\InprocServer32"; |
| 40 | 40 |
| 41 const wchar_t kFlashControlKey[] = | 41 const wchar_t kFlashControlKey[] = |
| 42 L"CLSID\\{D27CDB6E-AE6D-11cf-96B8-444553540000}\\InprocServer32"; | 42 L"CLSID\\{D27CDB6E-AE6D-11cf-96B8-444553540000}\\InprocServer32"; |
| 43 | 43 |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 test_name += url; | 268 test_name += url; |
| 269 perf_navigate_.reset(new PerfTimeLogger(test_name.c_str())); | 269 perf_navigate_.reset(new PerfTimeLogger(test_name.c_str())); |
| 270 } | 270 } |
| 271 | 271 |
| 272 scoped_ptr<PerfTimeLogger> perf_initialize_; | 272 scoped_ptr<PerfTimeLogger> perf_initialize_; |
| 273 scoped_ptr<PerfTimeLogger> perf_navigate_; | 273 scoped_ptr<PerfTimeLogger> perf_navigate_; |
| 274 }; | 274 }; |
| 275 | 275 |
| 276 // This class provides common functionality which can be used for most of the | 276 // This class provides common functionality which can be used for most of the |
| 277 // ChromeFrame/Tab performance tests. | 277 // ChromeFrame/Tab performance tests. |
| 278 class ChromeFramePerfTestBase : public UITest { | 278 class ChromeFramePerfTestBase : public UIPerfTest { |
| 279 public: | 279 public: |
| 280 ChromeFramePerfTestBase() {} | 280 ChromeFramePerfTestBase() {} |
| 281 protected: | 281 protected: |
| 282 scoped_ptr<ScopedChromeFrameRegistrar> chrome_frame_registrar_; | 282 scoped_ptr<ScopedChromeFrameRegistrar> chrome_frame_registrar_; |
| 283 }; | 283 }; |
| 284 | 284 |
| 285 class ChromeFrameStartupTest : public ChromeFramePerfTestBase { | 285 class ChromeFrameStartupTest : public ChromeFramePerfTestBase { |
| 286 public: | 286 public: |
| 287 ChromeFrameStartupTest() {} | 287 ChromeFrameStartupTest() {} |
| 288 | 288 |
| (...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1305 reinterpret_cast<FILETIME&>(event->Header.TimeStamp)); | 1305 reinterpret_cast<FILETIME&>(event->Header.TimeStamp)); |
| 1306 } | 1306 } |
| 1307 } | 1307 } |
| 1308 | 1308 |
| 1309 virtual void OnTraceEventEnd(EVENT_TRACE* event) {} | 1309 virtual void OnTraceEventEnd(EVENT_TRACE* event) {} |
| 1310 | 1310 |
| 1311 base::StringPiece event_start_; | 1311 base::StringPiece event_start_; |
| 1312 base::StringPiece event_end_; | 1312 base::StringPiece event_end_; |
| 1313 }; | 1313 }; |
| 1314 | 1314 |
| 1315 // The very same as UITestBase::PrintResultXXXX without the need to | 1315 // The very same as UIPerfTest::PrintResultXXXX without the need to |
| 1316 // create an UITestBase instance. | 1316 // create an UIPerfTest instance. |
| 1317 void PrintResultsImpl(const std::string& measurement, | 1317 void PrintResultsImpl(const std::string& measurement, |
| 1318 const std::string& modifier, | 1318 const std::string& modifier, |
| 1319 const std::string& trace, | 1319 const std::string& trace, |
| 1320 const std::string& values, | 1320 const std::string& values, |
| 1321 const std::string& prefix, | 1321 const std::string& prefix, |
| 1322 const std::string& suffix, | 1322 const std::string& suffix, |
| 1323 const std::string& units, | 1323 const std::string& units, |
| 1324 bool important) { | 1324 bool important) { |
| 1325 // <*>RESULT <graph_name>: <trace_name>= <value> <units> | 1325 // <*>RESULT <graph_name>: <trace_name>= <value> <units> |
| 1326 // <*>RESULT <graph_name>: <trace_name>= {<mean>, <std deviation>} <units> | 1326 // <*>RESULT <graph_name>: <trace_name>= {<mean>, <std deviation>} <units> |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1454 PrintPerfTestResults(automation_provider_connect_monitor, kNumCycles, | 1454 PrintPerfTestResults(automation_provider_connect_monitor, kNumCycles, |
| 1455 "automationproviderconnect"); | 1455 "automationproviderconnect"); |
| 1456 PrintPerfTestResults(external_tab_navigate_monitor, kNumCycles, | 1456 PrintPerfTestResults(external_tab_navigate_monitor, kNumCycles, |
| 1457 "externaltabnavigate"); | 1457 "externaltabnavigate"); |
| 1458 PrintPerfTestResults(renderer_main_monitor, kNumCycles, | 1458 PrintPerfTestResults(renderer_main_monitor, kNumCycles, |
| 1459 "beginrenderermain"); | 1459 "beginrenderermain"); |
| 1460 #ifdef NDEBUG | 1460 #ifdef NDEBUG |
| 1461 PrintPerfTestResults(pre_read_chrome_monitor, kNumCycles, "PreReadImage"); | 1461 PrintPerfTestResults(pre_read_chrome_monitor, kNumCycles, "PreReadImage"); |
| 1462 #endif // NDEBUG | 1462 #endif // NDEBUG |
| 1463 } | 1463 } |
| OLD | NEW |