| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "blimp/client/feature/compositor/blimp_compositor_manager.h" | 5 #include "blimp/client/feature/compositor/blimp_compositor_manager.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "cc/proto/compositor_message.pb.h" | 8 #include "cc/proto/compositor_message.pb.h" |
| 9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 public: | 53 public: |
| 54 explicit BlimpCompositorManagerForTesting( | 54 explicit BlimpCompositorManagerForTesting( |
| 55 RenderWidgetFeature* render_widget_feature) | 55 RenderWidgetFeature* render_widget_feature) |
| 56 : BlimpCompositorManager(render_widget_feature, nullptr) {} | 56 : BlimpCompositorManager(render_widget_feature, nullptr) {} |
| 57 | 57 |
| 58 using BlimpCompositorManager::GetCompositor; | 58 using BlimpCompositorManager::GetCompositor; |
| 59 | 59 |
| 60 std::unique_ptr<BlimpCompositor> CreateBlimpCompositor( | 60 std::unique_ptr<BlimpCompositor> CreateBlimpCompositor( |
| 61 int render_widget_id, | 61 int render_widget_id, |
| 62 BlimpCompositorClient* client) override { | 62 BlimpCompositorClient* client) override { |
| 63 return base::WrapUnique(new MockBlimpCompositor(render_widget_id)); | 63 return base::MakeUnique<MockBlimpCompositor>(render_widget_id); |
| 64 } | 64 } |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 class BlimpCompositorManagerTest : public testing::Test { | 67 class BlimpCompositorManagerTest : public testing::Test { |
| 68 public: | 68 public: |
| 69 void SetUp() override { | 69 void SetUp() override { |
| 70 EXPECT_CALL(render_widget_feature_, SetDelegate(_, _)).Times(1); | 70 EXPECT_CALL(render_widget_feature_, SetDelegate(_, _)).Times(1); |
| 71 EXPECT_CALL(render_widget_feature_, RemoveDelegate(_)).Times(1); | 71 EXPECT_CALL(render_widget_feature_, RemoveDelegate(_)).Times(1); |
| 72 | 72 |
| 73 compositor_manager_.reset( | 73 compositor_manager_.reset( |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 // Destroy all the widgets. We should not be receiving any calls for the view | 175 // Destroy all the widgets. We should not be receiving any calls for the view |
| 176 // events forwarded after this. | 176 // events forwarded after this. |
| 177 delegate()->OnRenderWidgetDeleted(1); | 177 delegate()->OnRenderWidgetDeleted(1); |
| 178 delegate()->OnRenderWidgetDeleted(2); | 178 delegate()->OnRenderWidgetDeleted(2); |
| 179 | 179 |
| 180 compositor_manager_->SetVisible(true); | 180 compositor_manager_->SetVisible(true); |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace client | 183 } // namespace client |
| 184 } // namespace blimp | 184 } // namespace blimp |
| OLD | NEW |