| 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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 }; | 310 }; |
| 311 | 311 |
| 312 TEST_F(RenderWidgetHostViewMacTest, Basic) { | 312 TEST_F(RenderWidgetHostViewMacTest, Basic) { |
| 313 } | 313 } |
| 314 | 314 |
| 315 TEST_F(RenderWidgetHostViewMacTest, AcceptsFirstResponder) { | 315 TEST_F(RenderWidgetHostViewMacTest, AcceptsFirstResponder) { |
| 316 // The RWHVCocoa should normally accept first responder status. | 316 // The RWHVCocoa should normally accept first responder status. |
| 317 EXPECT_TRUE([rwhv_cocoa_.get() acceptsFirstResponder]); | 317 EXPECT_TRUE([rwhv_cocoa_.get() acceptsFirstResponder]); |
| 318 } | 318 } |
| 319 | 319 |
| 320 // This test verifies that RenderWidgetHostViewCocoa's implementation of |
| 321 // NSTextInputClientConformance conforms to requirements. |
| 322 TEST_F(RenderWidgetHostViewMacTest, NSTextInputClientConformance) { |
| 323 NSRange selectedRange = [rwhv_cocoa_ selectedRange]; |
| 324 EXPECT_EQ(0u, selectedRange.location); |
| 325 EXPECT_EQ(0u, selectedRange.length); |
| 326 |
| 327 NSRange actualRange = NSMakeRange(1u, 2u); |
| 328 NSAttributedString* actualString = [rwhv_cocoa_ |
| 329 attributedSubstringForProposedRange:NSMakeRange(NSNotFound, 0u) |
| 330 actualRange:&actualRange]; |
| 331 EXPECT_EQ(nil, actualString); |
| 332 EXPECT_EQ(NSNotFound, actualRange.location); |
| 333 EXPECT_EQ(0u, actualRange.length); |
| 334 |
| 335 actualString = [rwhv_cocoa_ |
| 336 attributedSubstringForProposedRange:NSMakeRange(NSNotFound, 15u) |
| 337 actualRange:&actualRange]; |
| 338 EXPECT_EQ(nil, actualString); |
| 339 EXPECT_EQ(NSNotFound, actualRange.location); |
| 340 EXPECT_EQ(0u, actualRange.length); |
| 341 } |
| 342 |
| 320 TEST_F(RenderWidgetHostViewMacTest, Fullscreen) { | 343 TEST_F(RenderWidgetHostViewMacTest, Fullscreen) { |
| 321 rwhv_mac_->InitAsFullscreen(NULL); | 344 rwhv_mac_->InitAsFullscreen(NULL); |
| 322 EXPECT_TRUE(rwhv_mac_->pepper_fullscreen_window()); | 345 EXPECT_TRUE(rwhv_mac_->pepper_fullscreen_window()); |
| 323 | 346 |
| 324 // Break the reference cycle caused by pepper_fullscreen_window() without | 347 // Break the reference cycle caused by pepper_fullscreen_window() without |
| 325 // an <esc> event. See comment in | 348 // an <esc> event. See comment in |
| 326 // release_pepper_fullscreen_window_for_testing(). | 349 // release_pepper_fullscreen_window_for_testing(). |
| 327 rwhv_mac_->release_pepper_fullscreen_window_for_testing(); | 350 rwhv_mac_->release_pepper_fullscreen_window_for_testing(); |
| 328 } | 351 } |
| 329 | 352 |
| (...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1582 // Verify that this IPC is asking for no monitoring or immediate updates. | 1605 // Verify that this IPC is asking for no monitoring or immediate updates. |
| 1583 InputMsg_RequestCompositionUpdate::Read(composition_request_msg_for_child, | 1606 InputMsg_RequestCompositionUpdate::Read(composition_request_msg_for_child, |
| 1584 &child_msg_params); | 1607 &child_msg_params); |
| 1585 is_child_msg_for_immediate_request = std::get<0>(child_msg_params); | 1608 is_child_msg_for_immediate_request = std::get<0>(child_msg_params); |
| 1586 is_child_msg_for_monitor_request = std::get<1>(child_msg_params); | 1609 is_child_msg_for_monitor_request = std::get<1>(child_msg_params); |
| 1587 EXPECT_FALSE(is_child_msg_for_immediate_request); | 1610 EXPECT_FALSE(is_child_msg_for_immediate_request); |
| 1588 EXPECT_FALSE(is_child_msg_for_monitor_request); | 1611 EXPECT_FALSE(is_child_msg_for_monitor_request); |
| 1589 } | 1612 } |
| 1590 | 1613 |
| 1591 } // namespace content | 1614 } // namespace content |
| OLD | NEW |