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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
11 #include "base/test/test_switches.h" | 11 #include "base/test/test_switches.h" |
12 #include "base/test/trace_event_analyzer.h" | 12 #include "base/test/trace_event_analyzer.h" |
13 #include "base/threading/platform_thread.h" | 13 #include "base/threading/platform_thread.h" |
14 #include "base/timer.h" | 14 #include "base/timer.h" |
15 #include "base/version.h" | 15 #include "base/version.h" |
16 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
17 #include "chrome/browser/ui/browser_tabstrip.h" | 17 #include "chrome/browser/ui/browser_tabstrip.h" |
18 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 18 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
19 #include "chrome/common/chrome_paths.h" | 19 #include "chrome/common/chrome_paths.h" |
20 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
21 #include "chrome/test/base/tracing.h" | 21 #include "chrome/test/base/tracing.h" |
22 #include "chrome/test/base/ui_test_utils.h" | 22 #include "chrome/test/base/ui_test_utils.h" |
23 #include "chrome/test/perf/browser_perf_test.h" | 23 #include "chrome/test/perf/browser_perf_test.h" |
24 #include "chrome/test/perf/perf_test.h" | 24 #include "chrome/test/perf/perf_test.h" |
25 #include "content/public/browser/render_view_host.h" | 25 #include "content/public/browser/render_view_host.h" |
26 #include "content/public/browser/web_contents.h" | 26 #include "content/public/browser/web_contents.h" |
27 #include "content/public/common/content_switches.h" | 27 #include "content/public/common/content_switches.h" |
| 28 #include "content/public/test/browser_test_utils.h" |
28 #include "content/test/gpu/gpu_test_config.h" | 29 #include "content/test/gpu/gpu_test_config.h" |
29 #include "net/base/net_util.h" | 30 #include "net/base/net_util.h" |
30 #include "testing/gtest/include/gtest/gtest.h" | 31 #include "testing/gtest/include/gtest/gtest.h" |
31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
32 | 33 |
33 #if defined(OS_WIN) | 34 #if defined(OS_WIN) |
34 #include "base/win/windows_version.h" | 35 #include "base/win/windows_version.h" |
35 #endif | 36 #endif |
36 | 37 |
37 // Run with --vmodule=latency_tests=1 to print verbose latency info. | 38 // Run with --vmodule=latency_tests=1 to print verbose latency info. |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 if (send_inputs) { | 426 if (send_inputs) { |
426 // Round input_delay_us down to nearest milliseconds. The rounding in timer | 427 // Round input_delay_us down to nearest milliseconds. The rounding in timer |
427 // code rounds up from us to ms, so we need to do our own rounding here. | 428 // code rounds up from us to ms, so we need to do our own rounding here. |
428 int input_delay_ms = input_delay_us / 1000; | 429 int input_delay_ms = input_delay_us / 1000; |
429 input_delay_ms = (input_delay_ms <= 0) ? 1 : input_delay_ms; | 430 input_delay_ms = (input_delay_ms <= 0) ? 1 : input_delay_ms; |
430 timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(input_delay_ms), | 431 timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(input_delay_ms), |
431 this, &LatencyTest::SendInput); | 432 this, &LatencyTest::SendInput); |
432 } | 433 } |
433 | 434 |
434 // Wait for message indicating the test has finished running. | 435 // Wait for message indicating the test has finished running. |
435 ui_test_utils::DOMMessageQueue message_queue; | 436 content::DOMMessageQueue message_queue; |
436 ASSERT_TRUE(message_queue.WaitForMessage(NULL)); | 437 ASSERT_TRUE(message_queue.WaitForMessage(NULL)); |
437 | 438 |
438 timer_.Stop(); | 439 timer_.Stop(); |
439 | 440 |
440 std::string json_events; | 441 std::string json_events; |
441 ASSERT_TRUE(tracing::EndTracing(&json_events)); | 442 ASSERT_TRUE(tracing::EndTracing(&json_events)); |
442 | 443 |
443 analyzer_.reset(TraceAnalyzer::Create(json_events)); | 444 analyzer_.reset(TraceAnalyzer::Create(json_events)); |
444 analyzer_->AssociateBeginEndEvents(); | 445 analyzer_->AssociateBeginEndEvents(); |
445 analyzer_->MergeAssociatedEventArgs(); | 446 analyzer_->MergeAssociatedEventArgs(); |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 kInputHeavy | kInputDirty | kRafHeavy, \ | 721 kInputHeavy | kInputDirty | kRafHeavy, \ |
721 kInputHeavy | kInputDirty | kRafHeavy | kPaintHeavy, \ | 722 kInputHeavy | kInputDirty | kRafHeavy | kPaintHeavy, \ |
722 kInputDirty | kPaintHeavy, \ | 723 kInputDirty | kPaintHeavy, \ |
723 kInputDirty | kRafHeavy | kPaintHeavy) | 724 kInputDirty | kRafHeavy | kPaintHeavy) |
724 | 725 |
725 INSTANTIATE_TEST_CASE_P(, LatencyTestWebGL, LATENCY_SUITE_MODES()); | 726 INSTANTIATE_TEST_CASE_P(, LatencyTestWebGL, LATENCY_SUITE_MODES()); |
726 INSTANTIATE_TEST_CASE_P(, LatencyTestWebGLThread, LATENCY_SUITE_MODES()); | 727 INSTANTIATE_TEST_CASE_P(, LatencyTestWebGLThread, LATENCY_SUITE_MODES()); |
727 INSTANTIATE_TEST_CASE_P(, LatencyTestSW, LATENCY_SUITE_MODES()); | 728 INSTANTIATE_TEST_CASE_P(, LatencyTestSW, LATENCY_SUITE_MODES()); |
728 | 729 |
729 } // namespace | 730 } // namespace |
OLD | NEW |