| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <tuple> | 10 #include <tuple> |
| (...skipping 3837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3848 // a WebContents instance. | 3848 // a WebContents instance. |
| 3849 class RenderWidgetHostViewAuraWithViewHarnessTest | 3849 class RenderWidgetHostViewAuraWithViewHarnessTest |
| 3850 : public RenderViewHostImplTestHarness { | 3850 : public RenderViewHostImplTestHarness { |
| 3851 public: | 3851 public: |
| 3852 RenderWidgetHostViewAuraWithViewHarnessTest() | 3852 RenderWidgetHostViewAuraWithViewHarnessTest() |
| 3853 : view_(nullptr) {} | 3853 : view_(nullptr) {} |
| 3854 ~RenderWidgetHostViewAuraWithViewHarnessTest() override {} | 3854 ~RenderWidgetHostViewAuraWithViewHarnessTest() override {} |
| 3855 | 3855 |
| 3856 protected: | 3856 protected: |
| 3857 void SetUp() override { | 3857 void SetUp() override { |
| 3858 ImageTransportFactory::InitializeForUnitTests( | |
| 3859 std::unique_ptr<ImageTransportFactory>( | |
| 3860 new NoTransportImageTransportFactory)); | |
| 3861 RenderViewHostImplTestHarness::SetUp(); | 3858 RenderViewHostImplTestHarness::SetUp(); |
| 3862 // Delete the current RenderWidgetHostView instance before setting | 3859 // Delete the current RenderWidgetHostView instance before setting |
| 3863 // the RWHVA as the view. | 3860 // the RWHVA as the view. |
| 3864 delete contents()->GetRenderViewHost()->GetWidget()->GetView(); | 3861 delete contents()->GetRenderViewHost()->GetWidget()->GetView(); |
| 3865 // This instance is destroyed in the TearDown method below. | 3862 // This instance is destroyed in the TearDown method below. |
| 3866 view_ = new RenderWidgetHostViewAura( | 3863 view_ = new RenderWidgetHostViewAura( |
| 3867 contents()->GetRenderViewHost()->GetWidget(), | 3864 contents()->GetRenderViewHost()->GetWidget(), |
| 3868 false); | 3865 false); |
| 3869 } | 3866 } |
| 3870 | 3867 |
| 3871 void TearDown() override { | 3868 void TearDown() override { |
| 3872 view_->Destroy(); | 3869 view_->Destroy(); |
| 3873 RenderViewHostImplTestHarness::TearDown(); | 3870 RenderViewHostImplTestHarness::TearDown(); |
| 3874 ImageTransportFactory::Terminate(); | |
| 3875 } | 3871 } |
| 3876 | 3872 |
| 3877 RenderWidgetHostViewAura* view() { | 3873 RenderWidgetHostViewAura* view() { |
| 3878 return view_; | 3874 return view_; |
| 3879 } | 3875 } |
| 3880 | 3876 |
| 3881 private: | 3877 private: |
| 3882 RenderWidgetHostViewAura* view_; | 3878 RenderWidgetHostViewAura* view_; |
| 3883 | 3879 |
| 3884 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAuraWithViewHarnessTest); | 3880 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAuraWithViewHarnessTest); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3992 view()->OnGestureEvent(&gesture_event); | 3988 view()->OnGestureEvent(&gesture_event); |
| 3993 | 3989 |
| 3994 EXPECT_TRUE(delegate->context_menu_request_received()); | 3990 EXPECT_TRUE(delegate->context_menu_request_received()); |
| 3995 EXPECT_EQ(delegate->context_menu_source_type(), ui::MENU_SOURCE_TOUCH); | 3991 EXPECT_EQ(delegate->context_menu_source_type(), ui::MENU_SOURCE_TOUCH); |
| 3996 #endif | 3992 #endif |
| 3997 | 3993 |
| 3998 RenderViewHostFactory::set_is_real_render_view_host(false); | 3994 RenderViewHostFactory::set_is_real_render_view_host(false); |
| 3999 } | 3995 } |
| 4000 | 3996 |
| 4001 } // namespace content | 3997 } // namespace content |
| OLD | NEW |