OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/frame_host/render_widget_host_view_guest.h" | 5 #include "content/browser/frame_host/render_widget_host_view_guest.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "cc/surfaces/surface.h" | 14 #include "cc/surfaces/surface.h" |
15 #include "cc/surfaces/surface_factory.h" | 15 #include "cc/surfaces/surface_factory.h" |
16 #include "cc/surfaces/surface_manager.h" | 16 #include "cc/surfaces/surface_manager.h" |
17 #include "cc/surfaces/surface_sequence.h" | 17 #include "cc/surfaces/surface_sequence.h" |
18 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 18 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
19 #include "content/browser/compositor/test/no_transport_image_transport_factory.h
" | 19 #include "content/browser/compositor/test/no_transport_image_transport_factory.h
" |
20 #include "content/browser/gpu/compositor_util.h" | 20 #include "content/browser/gpu/compositor_util.h" |
21 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 21 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
22 #include "content/browser/renderer_host/render_widget_host_impl.h" | 22 #include "content/browser/renderer_host/render_widget_host_impl.h" |
23 #include "content/common/text_input_state.h" | |
24 #include "content/common/view_messages.h" | 23 #include "content/common/view_messages.h" |
25 #include "content/public/browser/browser_plugin_guest_delegate.h" | 24 #include "content/public/browser/browser_plugin_guest_delegate.h" |
26 #include "content/public/browser/render_widget_host_view.h" | 25 #include "content/public/browser/render_widget_host_view.h" |
27 #include "content/public/test/mock_render_process_host.h" | 26 #include "content/public/test/mock_render_process_host.h" |
28 #include "content/public/test/test_browser_context.h" | 27 #include "content/public/test/test_browser_context.h" |
29 #include "content/test/test_render_view_host.h" | 28 #include "content/test/test_render_view_host.h" |
30 #include "content/test/test_web_contents.h" | 29 #include "content/test/test_web_contents.h" |
31 #include "testing/gtest/include/gtest/gtest.h" | 30 #include "testing/gtest/include/gtest/gtest.h" |
32 | 31 |
33 namespace content { | 32 namespace content { |
34 namespace { | 33 namespace { |
35 class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate { | 34 class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate { |
36 public: | 35 public: |
37 MockRenderWidgetHostDelegate() : text_input_state_(new TextInputState()) {} | 36 MockRenderWidgetHostDelegate() {} |
38 ~MockRenderWidgetHostDelegate() override {} | 37 ~MockRenderWidgetHostDelegate() override {} |
39 | 38 |
40 const TextInputState* GetTextInputState() override { | |
41 return text_input_state_.get(); | |
42 } | |
43 | |
44 private: | 39 private: |
45 // RenderWidgetHostDelegate: | 40 // RenderWidgetHostDelegate: |
46 void Cut() override {} | 41 void Cut() override {} |
47 void Copy() override {} | 42 void Copy() override {} |
48 void Paste() override {} | 43 void Paste() override {} |
49 void SelectAll() override {} | 44 void SelectAll() override {} |
50 | |
51 scoped_ptr<TextInputState> text_input_state_; | |
52 }; | 45 }; |
53 | 46 |
54 class RenderWidgetHostViewGuestTest : public testing::Test { | 47 class RenderWidgetHostViewGuestTest : public testing::Test { |
55 public: | 48 public: |
56 RenderWidgetHostViewGuestTest() {} | 49 RenderWidgetHostViewGuestTest() {} |
57 | 50 |
58 void SetUp() override { | 51 void SetUp() override { |
59 #if !defined(OS_ANDROID) | 52 #if !defined(OS_ANDROID) |
60 ImageTransportFactory::InitializeForUnitTests( | 53 ImageTransportFactory::InitializeForUnitTests( |
61 scoped_ptr<ImageTransportFactory>( | 54 scoped_ptr<ImageTransportFactory>( |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 | 283 |
291 browser_plugin_guest_->set_attached(false); | 284 browser_plugin_guest_->set_attached(false); |
292 browser_plugin_guest_->ResetTestData(); | 285 browser_plugin_guest_->ResetTestData(); |
293 | 286 |
294 view_->OnSwapCompositorFrame( | 287 view_->OnSwapCompositorFrame( |
295 0, CreateDelegatedFrame(scale_factor, view_size, view_rect)); | 288 0, CreateDelegatedFrame(scale_factor, view_size, view_rect)); |
296 EXPECT_TRUE(surface_id().is_null()); | 289 EXPECT_TRUE(surface_id().is_null()); |
297 } | 290 } |
298 | 291 |
299 } // namespace content | 292 } // namespace content |
OLD | NEW |