Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: ui/compositor/compositor_unittest.cc

Issue 1391893003: NOT FOR REVIEW: Aura on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/run_loop.h" 5 #include "base/run_loop.h"
6 #include "base/thread_task_runner_handle.h" 6 #include "base/thread_task_runner_handle.h"
7 #include "cc/output/begin_frame_args.h" 7 #include "cc/output/begin_frame_args.h"
8 #include "cc/test/begin_frame_args_test.h" 8 #include "cc/test/begin_frame_args_test.h"
9 #include "testing/gmock/include/gmock/gmock.h" 9 #include "testing/gmock/include/gmock/gmock.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 17 matching lines...) Expand all
28 public: 28 public:
29 CompositorTest() {} 29 CompositorTest() {}
30 ~CompositorTest() override {} 30 ~CompositorTest() override {}
31 31
32 void SetUp() override { 32 void SetUp() override {
33 task_runner_ = base::ThreadTaskRunnerHandle::Get(); 33 task_runner_ = base::ThreadTaskRunnerHandle::Get();
34 34
35 ui::ContextFactory* context_factory = 35 ui::ContextFactory* context_factory =
36 ui::InitializeContextFactoryForTests(false); 36 ui::InitializeContextFactoryForTests(false);
37 37
38 compositor_.reset(new ui::Compositor(gfx::kNullAcceleratedWidget, 38 compositor_.reset(new ui::Compositor(context_factory, task_runner_));
39 context_factory, task_runner_)); 39 compositor_->OnAcceleratedWidgetAvailable(gfx::kNullAcceleratedWidget);
40 } 40 }
41 void TearDown() override { 41 void TearDown() override {
42 compositor_.reset(); 42 compositor_.reset();
43 ui::TerminateContextFactoryForTests(); 43 ui::TerminateContextFactoryForTests();
44 } 44 }
45 45
46 protected: 46 protected:
47 base::SingleThreadTaskRunner* task_runner() { return task_runner_.get(); } 47 base::SingleThreadTaskRunner* task_runner() { return task_runner_.get(); }
48 ui::Compositor* compositor() { return compositor_.get(); } 48 ui::Compositor* compositor() { return compositor_.get(); }
49 49
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 EXPECT_CALL(test_observer2, OnSendBeginFrame(_)).Times(0); 119 EXPECT_CALL(test_observer2, OnSendBeginFrame(_)).Times(0);
120 compositor()->RemoveBeginFrameObserver(&test_observer); 120 compositor()->RemoveBeginFrameObserver(&test_observer);
121 compositor()->RemoveBeginFrameObserver(&test_observer2); 121 compositor()->RemoveBeginFrameObserver(&test_observer2);
122 compositor()->AddBeginFrameObserver(&test_observer2); 122 compositor()->AddBeginFrameObserver(&test_observer2);
123 Mock::VerifyAndClearExpectations(&test_observer2); 123 Mock::VerifyAndClearExpectations(&test_observer2);
124 124
125 compositor()->RemoveBeginFrameObserver(&test_observer2); 125 compositor()->RemoveBeginFrameObserver(&test_observer2);
126 } 126 }
127 127
128 } // namespace ui 128 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698