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

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

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Resolving comments and sync with ToT Created 3 years, 4 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 <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/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/test/test_mock_time_task_runner.h" 10 #include "base/test/test_mock_time_task_runner.h"
(...skipping 22 matching lines...) Expand all
33 33
34 void SetUp() override { 34 void SetUp() override {
35 ui::ContextFactory* context_factory = nullptr; 35 ui::ContextFactory* context_factory = nullptr;
36 ui::ContextFactoryPrivate* context_factory_private = nullptr; 36 ui::ContextFactoryPrivate* context_factory_private = nullptr;
37 ui::InitializeContextFactoryForTests(false, &context_factory, 37 ui::InitializeContextFactoryForTests(false, &context_factory,
38 &context_factory_private); 38 &context_factory_private);
39 39
40 compositor_.reset(new ui::Compositor( 40 compositor_.reset(new ui::Compositor(
41 context_factory_private->AllocateFrameSinkId(), context_factory, 41 context_factory_private->AllocateFrameSinkId(), context_factory,
42 context_factory_private, CreateTaskRunner(), 42 context_factory_private, CreateTaskRunner(),
43 false /* enable_surface_synchronization */)); 43 false /* enable_surface_synchronization */,
44 false /* enable_pixel_canvas */));
44 compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); 45 compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget);
45 } 46 }
46 47
47 void TearDown() override { 48 void TearDown() override {
48 compositor_.reset(); 49 compositor_.reset();
49 ui::TerminateContextFactoryForTests(); 50 ui::TerminateContextFactoryForTests();
50 } 51 }
51 52
52 void DestroyCompositor() { compositor_.reset(); } 53 void DestroyCompositor() { compositor_.reset(); }
53 54
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 EXPECT_EQ(gfx::kNullAcceleratedWidget, 470 EXPECT_EQ(gfx::kNullAcceleratedWidget,
470 compositor()->ReleaseAcceleratedWidget()); 471 compositor()->ReleaseAcceleratedWidget());
471 compositor()->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); 472 compositor()->SetAcceleratedWidget(gfx::kNullAcceleratedWidget);
472 compositor()->SetVisible(true); 473 compositor()->SetVisible(true);
473 compositor()->ScheduleDraw(); 474 compositor()->ScheduleDraw();
474 DrawWaiterForTest::WaitForCompositingEnded(compositor()); 475 DrawWaiterForTest::WaitForCompositingEnded(compositor());
475 compositor()->SetRootLayer(nullptr); 476 compositor()->SetRootLayer(nullptr);
476 } 477 }
477 478
478 } // namespace ui 479 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698