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

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

Issue 2563783002: ui + mus: Split ContextFactory into ContextFactory(Client) and ContextFactoryPrivate (Closed)
Patch Set: Restore mash Created 4 years 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
« no previous file with comments | « ui/compositor/compositor.cc ('k') | ui/compositor/layer_animator_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
10 #include "cc/output/begin_frame_args.h" 10 #include "cc/output/begin_frame_args.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // Test fixture for tests that require a ui::Compositor with a real task 63 // Test fixture for tests that require a ui::Compositor with a real task
64 // runner. 64 // runner.
65 class CompositorTest : public testing::Test { 65 class CompositorTest : public testing::Test {
66 public: 66 public:
67 CompositorTest() {} 67 CompositorTest() {}
68 ~CompositorTest() override {} 68 ~CompositorTest() override {}
69 69
70 void SetUp() override { 70 void SetUp() override {
71 task_runner_ = base::ThreadTaskRunnerHandle::Get(); 71 task_runner_ = base::ThreadTaskRunnerHandle::Get();
72 72
73 ui::ContextFactory* context_factory = 73 ui::ContextFactory* context_factory = nullptr;
74 ui::InitializeContextFactoryForTests(false); 74 ui::ContextFactoryPrivate* context_factory_private = nullptr;
75 ui::InitializeContextFactoryForTests(false, &context_factory,
76 &context_factory_private);
75 77
76 compositor_.reset(new ui::Compositor(context_factory, task_runner_)); 78 compositor_.reset(new ui::Compositor(
79 context_factory, context_factory_private, task_runner_));
77 compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); 80 compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget);
78 } 81 }
79 void TearDown() override { 82 void TearDown() override {
80 compositor_.reset(); 83 compositor_.reset();
81 ui::TerminateContextFactoryForTests(); 84 ui::TerminateContextFactoryForTests();
82 } 85 }
83 86
84 protected: 87 protected:
85 base::SingleThreadTaskRunner* task_runner() { return task_runner_.get(); } 88 base::SingleThreadTaskRunner* task_runner() { return task_runner_.get(); }
86 ui::Compositor* compositor() { return compositor_.get(); } 89 ui::Compositor* compositor() { return compositor_.get(); }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 EXPECT_EQ(gfx::kNullAcceleratedWidget, 152 EXPECT_EQ(gfx::kNullAcceleratedWidget,
150 compositor()->ReleaseAcceleratedWidget()); 153 compositor()->ReleaseAcceleratedWidget());
151 compositor()->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); 154 compositor()->SetAcceleratedWidget(gfx::kNullAcceleratedWidget);
152 compositor()->SetVisible(true); 155 compositor()->SetVisible(true);
153 compositor()->ScheduleDraw(); 156 compositor()->ScheduleDraw();
154 DrawWaiterForTest::WaitForCompositingEnded(compositor()); 157 DrawWaiterForTest::WaitForCompositingEnded(compositor());
155 compositor()->SetRootLayer(nullptr); 158 compositor()->SetRootLayer(nullptr);
156 } 159 }
157 160
158 } // namespace ui 161 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/compositor.cc ('k') | ui/compositor/layer_animator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698