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 "base/mac/mac_util.h" | 7 #include "base/mac/mac_util.h" |
8 #include "base/mac/scoped_nsautorelease_pool.h" | 8 #include "base/mac/scoped_nsautorelease_pool.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "content/browser/browser_thread_impl.h" | 10 #include "content/browser/browser_thread_impl.h" |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 // Command-ESC will destroy the view, while the window is still in | 317 // Command-ESC will destroy the view, while the window is still in |
318 // |-performKeyEquivalent:|. There are other cases where this can | 318 // |-performKeyEquivalent:|. There are other cases where this can |
319 // happen, Command-ESC is the easiest to trigger. | 319 // happen, Command-ESC is the easiest to trigger. |
320 [[view->cocoa_view() window] performKeyEquivalent: | 320 [[view->cocoa_view() window] performKeyEquivalent: |
321 cocoa_test_event_utils::KeyEventWithKeyCode( | 321 cocoa_test_event_utils::KeyEventWithKeyCode( |
322 53, 27, NSKeyDown, NSCommandKeyMask)]; | 322 53, 27, NSKeyDown, NSCommandKeyMask)]; |
323 observer.Wait(); | 323 observer.Wait(); |
324 } | 324 } |
325 | 325 |
326 TEST_F(RenderWidgetHostViewMacTest, GetFirstRectForCharacterRangeCaretCase) { | 326 TEST_F(RenderWidgetHostViewMacTest, GetFirstRectForCharacterRangeCaretCase) { |
327 const base::string16 kDummyString = UTF8ToUTF16("hogehoge"); | 327 const base::string16 kDummyString = base::UTF8ToUTF16("hogehoge"); |
328 const size_t kDummyOffset = 0; | 328 const size_t kDummyOffset = 0; |
329 | 329 |
330 gfx::Rect caret_rect(10, 11, 0, 10); | 330 gfx::Rect caret_rect(10, 11, 0, 10); |
331 gfx::Range caret_range(0, 0); | 331 gfx::Range caret_range(0, 0); |
332 ViewHostMsg_SelectionBounds_Params params; | 332 ViewHostMsg_SelectionBounds_Params params; |
333 | 333 |
334 NSRect rect; | 334 NSRect rect; |
335 NSRange actual_range; | 335 NSRange actual_range; |
336 rwhv_mac_->SelectionChanged(kDummyString, kDummyOffset, caret_range); | 336 rwhv_mac_->SelectionChanged(kDummyString, kDummyOffset, caret_range); |
337 params.anchor_rect = params.focus_rect = caret_rect; | 337 params.anchor_rect = params.focus_rect = caret_rect; |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 host->OnMessageReceived(*response2); | 782 host->OnMessageReceived(*response2); |
783 | 783 |
784 // Check that the view delegate ignored the empty unhandled wheel event. | 784 // Check that the view delegate ignored the empty unhandled wheel event. |
785 ASSERT_EQ(NO, view_delegate.get().unhandledWheelEventReceived); | 785 ASSERT_EQ(NO, view_delegate.get().unhandledWheelEventReceived); |
786 | 786 |
787 // Clean up. | 787 // Clean up. |
788 host->Shutdown(); | 788 host->Shutdown(); |
789 } | 789 } |
790 | 790 |
791 } // namespace content | 791 } // namespace content |
OLD | NEW |