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

Side by Side Diff: ui/compositor/layer_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/layer_owner_unittest.cc ('k') | ui/compositor/test/context_factories_for_test.h » ('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 (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 "ui/compositor/layer.h" 5 #include "ui/compositor/layer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 } else { 161 } else {
162 LOG(ERROR) << "Could not open test data directory."; 162 LOG(ERROR) << "Could not open test data directory.";
163 } 163 }
164 gfx::FontList::SetDefaultFontDescription("Arial, Times New Roman, 15px"); 164 gfx::FontList::SetDefaultFontDescription("Arial, Times New Roman, 15px");
165 } 165 }
166 ~LayerWithRealCompositorTest() override {} 166 ~LayerWithRealCompositorTest() override {}
167 167
168 // Overridden from testing::Test: 168 // Overridden from testing::Test:
169 void SetUp() override { 169 void SetUp() override {
170 bool enable_pixel_output = true; 170 bool enable_pixel_output = true;
171 ui::ContextFactory* context_factory = 171 ui::ContextFactory* context_factory = nullptr;
172 InitializeContextFactoryForTests(enable_pixel_output); 172 ui::ContextFactoryPrivate* context_factory_private = nullptr;
173 InitializeContextFactoryForTests(enable_pixel_output, &context_factory,
174 &context_factory_private);
173 175
174 const gfx::Rect host_bounds(10, 10, 500, 500); 176 const gfx::Rect host_bounds(10, 10, 500, 500);
175 compositor_host_.reset( 177 compositor_host_.reset(TestCompositorHost::Create(
176 TestCompositorHost::Create(host_bounds, context_factory)); 178 host_bounds, context_factory, context_factory_private));
177 compositor_host_->Show(); 179 compositor_host_->Show();
178 } 180 }
179 181
180 void TearDown() override { 182 void TearDown() override {
181 ResetCompositor(); 183 ResetCompositor();
182 TerminateContextFactoryForTests(); 184 TerminateContextFactoryForTests();
183 } 185 }
184 186
185 Compositor* GetCompositor() { return compositor_host_->GetCompositor(); } 187 Compositor* GetCompositor() { return compositor_host_->GetCompositor(); }
186 188
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 } 497 }
496 498
497 class LayerWithDelegateTest : public testing::Test { 499 class LayerWithDelegateTest : public testing::Test {
498 public: 500 public:
499 LayerWithDelegateTest() {} 501 LayerWithDelegateTest() {}
500 ~LayerWithDelegateTest() override {} 502 ~LayerWithDelegateTest() override {}
501 503
502 // Overridden from testing::Test: 504 // Overridden from testing::Test:
503 void SetUp() override { 505 void SetUp() override {
504 bool enable_pixel_output = false; 506 bool enable_pixel_output = false;
505 ui::ContextFactory* context_factory = 507 ui::ContextFactory* context_factory = nullptr;
506 InitializeContextFactoryForTests(enable_pixel_output); 508 ui::ContextFactoryPrivate* context_factory_private = nullptr;
509
510 InitializeContextFactoryForTests(enable_pixel_output, &context_factory,
511 &context_factory_private);
507 512
508 const gfx::Rect host_bounds(1000, 1000); 513 const gfx::Rect host_bounds(1000, 1000);
509 compositor_host_.reset(TestCompositorHost::Create(host_bounds, 514 compositor_host_.reset(TestCompositorHost::Create(
510 context_factory)); 515 host_bounds, context_factory, context_factory_private));
511 compositor_host_->Show(); 516 compositor_host_->Show();
512 } 517 }
513 518
514 void TearDown() override { 519 void TearDown() override {
515 compositor_host_.reset(); 520 compositor_host_.reset();
516 TerminateContextFactoryForTests(); 521 TerminateContextFactoryForTests();
517 } 522 }
518 523
519 Compositor* compositor() { return compositor_host_->GetCompositor(); } 524 Compositor* compositor() { return compositor_host_->GetCompositor(); }
520 525
(...skipping 1733 matching lines...) Expand 10 before | Expand all | Expand 10 after
2254 layer.set_name("foo"); 2259 layer.set_name("foo");
2255 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> debug_info = 2260 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> debug_info =
2256 layer.TakeDebugInfo(nullptr); 2261 layer.TakeDebugInfo(nullptr);
2257 std::string trace_format("bar,"); 2262 std::string trace_format("bar,");
2258 debug_info->AppendAsTraceFormat(&trace_format); 2263 debug_info->AppendAsTraceFormat(&trace_format);
2259 std::string expected("bar,{\"layer_name\":\"foo\"}"); 2264 std::string expected("bar,{\"layer_name\":\"foo\"}");
2260 EXPECT_EQ(expected, trace_format); 2265 EXPECT_EQ(expected, trace_format);
2261 } 2266 }
2262 2267
2263 } // namespace ui 2268 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/layer_owner_unittest.cc ('k') | ui/compositor/test/context_factories_for_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698