| 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 "content/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| (...skipping 2413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2424 EXPECT_EQ(2, callback_count_); | 2424 EXPECT_EQ(2, callback_count_); |
| 2425 EXPECT_FALSE(result_); | 2425 EXPECT_FALSE(result_); |
| 2426 } | 2426 } |
| 2427 | 2427 |
| 2428 TEST_F(RenderWidgetHostViewAuraCopyRequestTest, PresentTime) { | 2428 TEST_F(RenderWidgetHostViewAuraCopyRequestTest, PresentTime) { |
| 2429 InitializeView(); | 2429 InitializeView(); |
| 2430 InstallFakeTickClock(); | 2430 InstallFakeTickClock(); |
| 2431 | 2431 |
| 2432 // Verify our initial state. | 2432 // Verify our initial state. |
| 2433 EXPECT_EQ(base::TimeTicks(), frame_subscriber_->last_present_time()); | 2433 EXPECT_EQ(base::TimeTicks(), frame_subscriber_->last_present_time()); |
| 2434 EXPECT_EQ(base::TimeTicks(), tick_clock_->NowTicks()); | 2434 // SimpleTestTickClock starts at 1 microsecond |
| 2435 EXPECT_EQ(base::TimeTicks() + base::TimeDelta::FromMicroseconds(1), |
| 2436 tick_clock_->NowTicks()); |
| 2435 | 2437 |
| 2436 // Start our fake clock from a non-zero, but not an even multiple of the | 2438 // Start our fake clock from a non-zero, but not an even multiple of the |
| 2437 // interval, value to differentiate it from our initialization state. | 2439 // interval, value to differentiate it from our initialization state. |
| 2438 const base::TimeDelta kDefaultInterval = | 2440 const base::TimeDelta kDefaultInterval = |
| 2439 cc::BeginFrameArgs::DefaultInterval(); | 2441 cc::BeginFrameArgs::DefaultInterval(); |
| 2440 tick_clock_->Advance(kDefaultInterval / 3); | 2442 tick_clock_->Advance(kDefaultInterval / 3); |
| 2441 | 2443 |
| 2442 // Swap the first frame without any vsync information. | 2444 // Swap the first frame without any vsync information. |
| 2443 ASSERT_EQ(base::TimeTicks(), vsync_timebase()); | 2445 ASSERT_EQ(base::TimeTicks(), vsync_timebase()); |
| 2444 ASSERT_EQ(base::TimeDelta(), vsync_interval()); | 2446 ASSERT_EQ(base::TimeDelta(), vsync_interval()); |
| (...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3632 ViewMsg_SetSurfaceIdNamespace::Read(msg, ¶ms); | 3634 ViewMsg_SetSurfaceIdNamespace::Read(msg, ¶ms); |
| 3633 view_->InitAsChild(NULL); | 3635 view_->InitAsChild(NULL); |
| 3634 view_->Show(); | 3636 view_->Show(); |
| 3635 view_->SetSize(size); | 3637 view_->SetSize(size); |
| 3636 view_->OnSwapCompositorFrame(0, | 3638 view_->OnSwapCompositorFrame(0, |
| 3637 MakeDelegatedFrame(1.f, size, gfx::Rect(size))); | 3639 MakeDelegatedFrame(1.f, size, gfx::Rect(size))); |
| 3638 EXPECT_EQ(view_->GetSurfaceIdNamespace(), base::get<0>(params)); | 3640 EXPECT_EQ(view_->GetSurfaceIdNamespace(), base::get<0>(params)); |
| 3639 } | 3641 } |
| 3640 | 3642 |
| 3641 } // namespace content | 3643 } // namespace content |
| OLD | NEW |