| 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 "base/macros.h" | 5 #include "base/macros.h" |
| 6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
| 7 #include "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
| 8 #include "cc/output/begin_frame_args.h" | 8 #include "cc/output/begin_frame_args.h" |
| 9 #include "cc/test/begin_frame_args_test.h" | 9 #include "cc/test/begin_frame_args_test.h" |
| 10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 } | 87 } |
| 88 | 88 |
| 89 TEST_F(CompositorTest, ReleaseWidgetWithOutputSurfaceNeverCreated) { | 89 TEST_F(CompositorTest, ReleaseWidgetWithOutputSurfaceNeverCreated) { |
| 90 compositor()->SetVisible(false); | 90 compositor()->SetVisible(false); |
| 91 EXPECT_EQ(gfx::kNullAcceleratedWidget, | 91 EXPECT_EQ(gfx::kNullAcceleratedWidget, |
| 92 compositor()->ReleaseAcceleratedWidget()); | 92 compositor()->ReleaseAcceleratedWidget()); |
| 93 compositor()->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); | 93 compositor()->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); |
| 94 compositor()->SetVisible(true); | 94 compositor()->SetVisible(true); |
| 95 } | 95 } |
| 96 | 96 |
| 97 TEST_F(CompositorTest, CreateAndReleaseOutputSurface) { | 97 #if defined(OS_WIN) |
| 98 // TODO(crbug.com/608436): Flaky on windows trybots |
| 99 #define MAYBE_CreateAndReleaseOutputSurface \ |
| 100 DISABLED_CreateAndReleaseOutputSurface |
| 101 #else |
| 102 #define MAYBE_CreateAndReleaseOutputSurface CreateAndReleaseOutputSurface |
| 103 #endif |
| 104 TEST_F(CompositorTest, MAYBE_CreateAndReleaseOutputSurface) { |
| 98 std::unique_ptr<Layer> root_layer(new Layer(ui::LAYER_SOLID_COLOR)); | 105 std::unique_ptr<Layer> root_layer(new Layer(ui::LAYER_SOLID_COLOR)); |
| 99 root_layer->SetBounds(gfx::Rect(10, 10)); | 106 root_layer->SetBounds(gfx::Rect(10, 10)); |
| 100 compositor()->SetRootLayer(root_layer.get()); | 107 compositor()->SetRootLayer(root_layer.get()); |
| 101 compositor()->SetScaleAndSize(1.0f, gfx::Size(10, 10)); | 108 compositor()->SetScaleAndSize(1.0f, gfx::Size(10, 10)); |
| 102 DCHECK(compositor()->IsVisible()); | 109 DCHECK(compositor()->IsVisible()); |
| 103 compositor()->ScheduleDraw(); | 110 compositor()->ScheduleDraw(); |
| 104 DrawWaiterForTest::WaitForCompositingEnded(compositor()); | 111 DrawWaiterForTest::WaitForCompositingEnded(compositor()); |
| 105 compositor()->SetVisible(false); | 112 compositor()->SetVisible(false); |
| 106 EXPECT_EQ(gfx::kNullAcceleratedWidget, | 113 EXPECT_EQ(gfx::kNullAcceleratedWidget, |
| 107 compositor()->ReleaseAcceleratedWidget()); | 114 compositor()->ReleaseAcceleratedWidget()); |
| 108 compositor()->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); | 115 compositor()->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); |
| 109 compositor()->SetVisible(true); | 116 compositor()->SetVisible(true); |
| 110 compositor()->ScheduleDraw(); | 117 compositor()->ScheduleDraw(); |
| 111 DrawWaiterForTest::WaitForCompositingEnded(compositor()); | 118 DrawWaiterForTest::WaitForCompositingEnded(compositor()); |
| 112 compositor()->SetRootLayer(nullptr); | 119 compositor()->SetRootLayer(nullptr); |
| 113 } | 120 } |
| 114 | 121 |
| 115 } // namespace ui | 122 } // namespace ui |
| OLD | NEW |