| 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_mac.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
| 6 | 6 |
| 7 #include <Cocoa/Cocoa.h> | 7 #include <Cocoa/Cocoa.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <tuple> | 10 #include <tuple> |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 [(NSEvent*)[[event stub] andReturnValue:OCMOCK_VALUE(timestamp)] timestamp]; | 137 [(NSEvent*)[[event stub] andReturnValue:OCMOCK_VALUE(timestamp)] timestamp]; |
| 138 [(NSEvent*)[[event stub] | 138 [(NSEvent*)[[event stub] |
| 139 andReturnValue:OCMOCK_VALUE(modifierFlags)] modifierFlags]; | 139 andReturnValue:OCMOCK_VALUE(modifierFlags)] modifierFlags]; |
| 140 [(NSEvent*)[[event stub] | 140 [(NSEvent*)[[event stub] |
| 141 andReturnValue:OCMOCK_VALUE(magnification)] magnification]; | 141 andReturnValue:OCMOCK_VALUE(magnification)] magnification]; |
| 142 return event; | 142 return event; |
| 143 } | 143 } |
| 144 | 144 |
| 145 class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate { | 145 class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate { |
| 146 public: | 146 public: |
| 147 MockRenderWidgetHostDelegate() {} | 147 MockRenderWidgetHostDelegate() |
| 148 : text_input_manager_(new TextInputManager()) {} |
| 148 ~MockRenderWidgetHostDelegate() override {} | 149 ~MockRenderWidgetHostDelegate() override {} |
| 149 | 150 |
| 151 TextInputManager* GetTextInputManager() override { |
| 152 return text_input_manager_.get(); |
| 153 } |
| 154 |
| 150 private: | 155 private: |
| 151 void Cut() override {} | 156 void Cut() override {} |
| 152 void Copy() override {} | 157 void Copy() override {} |
| 153 void Paste() override {} | 158 void Paste() override {} |
| 154 void SelectAll() override {} | 159 void SelectAll() override {} |
| 160 |
| 161 std::unique_ptr<TextInputManager> text_input_manager_; |
| 155 }; | 162 }; |
| 156 | 163 |
| 157 class MockRenderWidgetHostImpl : public RenderWidgetHostImpl { | 164 class MockRenderWidgetHostImpl : public RenderWidgetHostImpl { |
| 158 public: | 165 public: |
| 159 MockRenderWidgetHostImpl(RenderWidgetHostDelegate* delegate, | 166 MockRenderWidgetHostImpl(RenderWidgetHostDelegate* delegate, |
| 160 RenderProcessHost* process, | 167 RenderProcessHost* process, |
| 161 int32_t routing_id) | 168 int32_t routing_id) |
| 162 : RenderWidgetHostImpl(delegate, process, routing_id, false) { | 169 : RenderWidgetHostImpl(delegate, process, routing_id, false) { |
| 163 set_renderer_initialized(true); | 170 set_renderer_initialized(true); |
| 164 lastWheelEventLatencyInfo = ui::LatencyInfo(); | 171 lastWheelEventLatencyInfo = ui::LatencyInfo(); |
| (...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1451 // Repeat for the tab's view. | 1458 // Repeat for the tab's view. |
| 1452 [rwhv_cocoa_ setMarkedText:text | 1459 [rwhv_cocoa_ setMarkedText:text |
| 1453 selectedRange:selectedRange | 1460 selectedRange:selectedRange |
| 1454 replacementRange:replacementRange]; | 1461 replacementRange:replacementRange]; |
| 1455 EXPECT_TRUE([rwhv_cocoa_ hasMarkedText]); | 1462 EXPECT_TRUE([rwhv_cocoa_ hasMarkedText]); |
| 1456 rwhv_mac_->ImeCancelComposition(); | 1463 rwhv_mac_->ImeCancelComposition(); |
| 1457 EXPECT_FALSE([rwhv_cocoa_ hasMarkedText]); | 1464 EXPECT_FALSE([rwhv_cocoa_ hasMarkedText]); |
| 1458 } | 1465 } |
| 1459 | 1466 |
| 1460 } // namespace content | 1467 } // namespace content |
| OLD | NEW |