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" |
23 #include "content/common/view_messages.h" | 24 #include "content/common/view_messages.h" |
24 #include "content/public/browser/browser_plugin_guest_delegate.h" | 25 #include "content/public/browser/browser_plugin_guest_delegate.h" |
25 #include "content/public/browser/render_widget_host_view.h" | 26 #include "content/public/browser/render_widget_host_view.h" |
26 #include "content/public/test/mock_render_process_host.h" | 27 #include "content/public/test/mock_render_process_host.h" |
27 #include "content/public/test/test_browser_context.h" | 28 #include "content/public/test/test_browser_context.h" |
28 #include "content/test/test_render_view_host.h" | 29 #include "content/test/test_render_view_host.h" |
29 #include "content/test/test_web_contents.h" | 30 #include "content/test/test_web_contents.h" |
30 #include "testing/gtest/include/gtest/gtest.h" | 31 #include "testing/gtest/include/gtest/gtest.h" |
31 | 32 |
32 namespace content { | 33 namespace content { |
33 namespace { | 34 namespace { |
34 class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate { | 35 class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate { |
35 public: | 36 public: |
36 MockRenderWidgetHostDelegate() {} | 37 MockRenderWidgetHostDelegate() : text_input_state_(new TextInputState()) {} |
37 ~MockRenderWidgetHostDelegate() override {} | 38 ~MockRenderWidgetHostDelegate() override {} |
38 | 39 |
| 40 const TextInputState* GetTextInputState() override { |
| 41 return text_input_state_.get(); |
| 42 } |
| 43 |
39 private: | 44 private: |
40 // RenderWidgetHostDelegate: | 45 // RenderWidgetHostDelegate: |
41 void Cut() override {} | 46 void Cut() override {} |
42 void Copy() override {} | 47 void Copy() override {} |
43 void Paste() override {} | 48 void Paste() override {} |
44 void SelectAll() override {} | 49 void SelectAll() override {} |
| 50 |
| 51 scoped_ptr<TextInputState> text_input_state_; |
45 }; | 52 }; |
46 | 53 |
47 class RenderWidgetHostViewGuestTest : public testing::Test { | 54 class RenderWidgetHostViewGuestTest : public testing::Test { |
48 public: | 55 public: |
49 RenderWidgetHostViewGuestTest() {} | 56 RenderWidgetHostViewGuestTest() {} |
50 | 57 |
51 void SetUp() override { | 58 void SetUp() override { |
52 #if !defined(OS_ANDROID) | 59 #if !defined(OS_ANDROID) |
53 ImageTransportFactory::InitializeForUnitTests( | 60 ImageTransportFactory::InitializeForUnitTests( |
54 scoped_ptr<ImageTransportFactory>( | 61 scoped_ptr<ImageTransportFactory>( |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 | 290 |
284 browser_plugin_guest_->set_attached(false); | 291 browser_plugin_guest_->set_attached(false); |
285 browser_plugin_guest_->ResetTestData(); | 292 browser_plugin_guest_->ResetTestData(); |
286 | 293 |
287 view_->OnSwapCompositorFrame( | 294 view_->OnSwapCompositorFrame( |
288 0, CreateDelegatedFrame(scale_factor, view_size, view_rect)); | 295 0, CreateDelegatedFrame(scale_factor, view_size, view_rect)); |
289 EXPECT_TRUE(surface_id().is_null()); | 296 EXPECT_TRUE(surface_id().is_null()); |
290 } | 297 } |
291 | 298 |
292 } // namespace content | 299 } // namespace content |
OLD | NEW |