| 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" |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 test_url += "&delayTimeMS=" + base::IntToString(delay_time_us_ / 1000); | 531 test_url += "&delayTimeMS=" + base::IntToString(delay_time_us_ / 1000); |
| 532 test_url += "&y=" + base::IntToString(kMouseY); | 532 test_url += "&y=" + base::IntToString(kMouseY); |
| 533 return test_url + GetUrlModeString(flags); | 533 return test_url + GetUrlModeString(flags); |
| 534 } | 534 } |
| 535 | 535 |
| 536 void LatencyTest::GetMeanFrameTimeMicros(int* frame_time) const { | 536 void LatencyTest::GetMeanFrameTimeMicros(int* frame_time) const { |
| 537 TraceEventVector events; | 537 TraceEventVector events; |
| 538 // Search for compositor swaps (or UpdateRects in the software path). | 538 // Search for compositor swaps (or UpdateRects in the software path). |
| 539 analyzer_->FindEvents(query_swaps_, &events); | 539 analyzer_->FindEvents(query_swaps_, &events); |
| 540 RateStats stats; | 540 RateStats stats; |
| 541 ASSERT_TRUE(GetRateStats(events, &stats)); | 541 ASSERT_TRUE(GetRateStats(events, &stats, NULL)); |
| 542 | 542 |
| 543 // Check that the number of swaps is close to kNumFrames. | 543 // Check that the number of swaps is close to kNumFrames. |
| 544 EXPECT_LT(num_frames_ - num_frames_ / 4, static_cast<int>(events.size())); | 544 EXPECT_LT(num_frames_ - num_frames_ / 4, static_cast<int>(events.size())); |
| 545 *frame_time = static_cast<int>(stats.mean_us); | 545 *frame_time = static_cast<int>(stats.mean_us); |
| 546 } | 546 } |
| 547 | 547 |
| 548 void LatencyTest::SendInput() { | 548 void LatencyTest::SendInput() { |
| 549 content::RenderViewHost* rvh = browser()->GetSelectedTabContentsWrapper()-> | 549 content::RenderViewHost* rvh = browser()->GetSelectedTabContentsWrapper()-> |
| 550 web_contents()->GetRenderViewHost(); | 550 web_contents()->GetRenderViewHost(); |
| 551 WebKit::WebMouseEvent mouse_event; | 551 WebKit::WebMouseEvent mouse_event; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 INSTANTIATE_TEST_CASE_P(, LatencyTest, ::testing::Values( | 613 INSTANTIATE_TEST_CASE_P(, LatencyTest, ::testing::Values( |
| 614 0, | 614 0, |
| 615 kInputHeavy, | 615 kInputHeavy, |
| 616 kInputHeavy | kInputDirty | kRafHeavy, | 616 kInputHeavy | kInputDirty | kRafHeavy, |
| 617 kInputHeavy | kInputDirty | kRafHeavy | kPaintHeavy, | 617 kInputHeavy | kInputDirty | kRafHeavy | kPaintHeavy, |
| 618 kInputDirty | kPaintHeavy, | 618 kInputDirty | kPaintHeavy, |
| 619 kInputDirty | kRafHeavy | kPaintHeavy | 619 kInputDirty | kRafHeavy | kPaintHeavy |
| 620 )); | 620 )); |
| 621 | 621 |
| 622 } // namespace | 622 } // namespace |
| OLD | NEW |