| 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 <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 Loading... |
| 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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 EXPECT_EQ(gfx::kNullAcceleratedWidget, | 502 EXPECT_EQ(gfx::kNullAcceleratedWidget, |
| 502 compositor()->ReleaseAcceleratedWidget()); | 503 compositor()->ReleaseAcceleratedWidget()); |
| 503 compositor()->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); | 504 compositor()->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); |
| 504 compositor()->SetVisible(true); | 505 compositor()->SetVisible(true); |
| 505 compositor()->ScheduleDraw(); | 506 compositor()->ScheduleDraw(); |
| 506 DrawWaiterForTest::WaitForCompositingEnded(compositor()); | 507 DrawWaiterForTest::WaitForCompositingEnded(compositor()); |
| 507 compositor()->SetRootLayer(nullptr); | 508 compositor()->SetRootLayer(nullptr); |
| 508 } | 509 } |
| 509 | 510 |
| 510 } // namespace ui | 511 } // namespace ui |
| OLD | NEW |