OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <algorithm> | 5 #include <algorithm> |
6 #include <list> | 6 #include <list> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 class BeginFrameObserverProxyTest : public testing::Test { | 31 class BeginFrameObserverProxyTest : public testing::Test { |
32 public: | 32 public: |
33 BeginFrameObserverProxyTest() {} | 33 BeginFrameObserverProxyTest() {} |
34 ~BeginFrameObserverProxyTest() override {} | 34 ~BeginFrameObserverProxyTest() override {} |
35 | 35 |
36 void SetUp() override { | 36 void SetUp() override { |
37 bool enable_pixel_output = false; | 37 bool enable_pixel_output = false; |
38 ui::ContextFactory* context_factory = | 38 ui::ContextFactory* context_factory = |
39 ui::InitializeContextFactoryForTests(enable_pixel_output); | 39 ui::InitializeContextFactoryForTests(enable_pixel_output); |
40 compositor_task_runner_ = new base::TestSimpleTaskRunner(); | 40 compositor_task_runner_ = new base::TestSimpleTaskRunner(); |
41 compositor_.reset(new ui::Compositor(gfx::kNullAcceleratedWidget, | 41 compositor_.reset( |
42 context_factory, | 42 new ui::Compositor(context_factory, compositor_task_runner_)); |
43 compositor_task_runner_)); | 43 compositor_->OnAcceleratedWidgetAvailable(gfx::kNullAcceleratedWidget); |
44 } | 44 } |
45 | 45 |
46 void TearDown() override { | 46 void TearDown() override { |
47 compositor_.reset(); | 47 compositor_.reset(); |
48 ui::TerminateContextFactoryForTests(); | 48 ui::TerminateContextFactoryForTests(); |
49 } | 49 } |
50 | 50 |
51 ui::Compositor* compositor() { return compositor_.get(); } | 51 ui::Compositor* compositor() { return compositor_.get(); } |
52 | 52 |
53 private: | 53 private: |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 begin_frame_observer.ResetCompositor(); | 88 begin_frame_observer.ResetCompositor(); |
89 cc::BeginFrameArgs args3 = | 89 cc::BeginFrameArgs args3 = |
90 cc::CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, | 90 cc::CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, |
91 base::TimeTicks::FromInternalValue(99)); | 91 base::TimeTicks::FromInternalValue(99)); |
92 EXPECT_CALL(client, SendBeginFrame(_)).Times(0); | 92 EXPECT_CALL(client, SendBeginFrame(_)).Times(0); |
93 compositor()->SendBeginFramesToChildren(args3); | 93 compositor()->SendBeginFramesToChildren(args3); |
94 Mock::VerifyAndClearExpectations(&client); | 94 Mock::VerifyAndClearExpectations(&client); |
95 } | 95 } |
96 | 96 |
97 } // namespace content | 97 } // namespace content |
OLD | NEW |