| 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/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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 #else | 107 #else |
| 108 #define MAYBE_CreateAndReleaseOutputSurface CreateAndReleaseOutputSurface | 108 #define MAYBE_CreateAndReleaseOutputSurface CreateAndReleaseOutputSurface |
| 109 #endif | 109 #endif |
| 110 TEST_F(CompositorTest, MAYBE_CreateAndReleaseOutputSurface) { | 110 TEST_F(CompositorTest, MAYBE_CreateAndReleaseOutputSurface) { |
| 111 std::unique_ptr<Layer> root_layer(new Layer(ui::LAYER_SOLID_COLOR)); | 111 std::unique_ptr<Layer> root_layer(new Layer(ui::LAYER_SOLID_COLOR)); |
| 112 root_layer->SetBounds(gfx::Rect(10, 10)); | 112 root_layer->SetBounds(gfx::Rect(10, 10)); |
| 113 compositor()->SetRootLayer(root_layer.get()); | 113 compositor()->SetRootLayer(root_layer.get()); |
| 114 compositor()->SetScaleAndSize(1.0f, gfx::Size(10, 10)); | 114 compositor()->SetScaleAndSize(1.0f, gfx::Size(10, 10)); |
| 115 DCHECK(compositor()->IsVisible()); | 115 DCHECK(compositor()->IsVisible()); |
| 116 compositor()->ScheduleDraw(); | 116 compositor()->ScheduleDraw(); |
| 117 DrawWaiterForTest::WaitForCompositingEnded(compositor()); | 117 DrawWaiterForTest::WaitForCompositingStarted(compositor()); |
| 118 compositor()->SetVisible(false); | 118 compositor()->SetVisible(false); |
| 119 EXPECT_EQ(gfx::kNullAcceleratedWidget, | 119 EXPECT_EQ(gfx::kNullAcceleratedWidget, |
| 120 compositor()->ReleaseAcceleratedWidget()); | 120 compositor()->ReleaseAcceleratedWidget()); |
| 121 compositor()->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); | 121 compositor()->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); |
| 122 compositor()->SetVisible(true); | 122 compositor()->SetVisible(true); |
| 123 compositor()->ScheduleDraw(); | 123 compositor()->ScheduleDraw(); |
| 124 DrawWaiterForTest::WaitForCompositingEnded(compositor()); | 124 DrawWaiterForTest::WaitForCompositingStarted(compositor()); |
| 125 compositor()->SetRootLayer(nullptr); | 125 compositor()->SetRootLayer(nullptr); |
| 126 } | 126 } |
| 127 | 127 |
| 128 } // namespace ui | 128 } // namespace ui |
| OLD | NEW |