| 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(NSNotFound, 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 | |
| 343 TEST_F(RenderWidgetHostViewMacTest, Fullscreen) { | 320 TEST_F(RenderWidgetHostViewMacTest, Fullscreen) { |
| 344 rwhv_mac_->InitAsFullscreen(NULL); | 321 rwhv_mac_->InitAsFullscreen(NULL); |
| 345 EXPECT_TRUE(rwhv_mac_->pepper_fullscreen_window()); | 322 EXPECT_TRUE(rwhv_mac_->pepper_fullscreen_window()); |
| 346 | 323 |
| 347 // Break the reference cycle caused by pepper_fullscreen_window() without | 324 // Break the reference cycle caused by pepper_fullscreen_window() without |
| 348 // an <esc> event. See comment in | 325 // an <esc> event. See comment in |
| 349 // release_pepper_fullscreen_window_for_testing(). | 326 // release_pepper_fullscreen_window_for_testing(). |
| 350 rwhv_mac_->release_pepper_fullscreen_window_for_testing(); | 327 rwhv_mac_->release_pepper_fullscreen_window_for_testing(); |
| 351 } | 328 } |
| 352 | 329 |
| (...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1601 // Verify that this IPC is asking for no monitoring or immediate updates. | 1578 // Verify that this IPC is asking for no monitoring or immediate updates. |
| 1602 InputMsg_RequestCompositionUpdate::Read(composition_request_msg_for_child, | 1579 InputMsg_RequestCompositionUpdate::Read(composition_request_msg_for_child, |
| 1603 &child_msg_params); | 1580 &child_msg_params); |
| 1604 is_child_msg_for_immediate_request = std::get<0>(child_msg_params); | 1581 is_child_msg_for_immediate_request = std::get<0>(child_msg_params); |
| 1605 is_child_msg_for_monitor_request = std::get<1>(child_msg_params); | 1582 is_child_msg_for_monitor_request = std::get<1>(child_msg_params); |
| 1606 EXPECT_FALSE(is_child_msg_for_immediate_request); | 1583 EXPECT_FALSE(is_child_msg_for_immediate_request); |
| 1607 EXPECT_FALSE(is_child_msg_for_monitor_request); | 1584 EXPECT_FALSE(is_child_msg_for_monitor_request); |
| 1608 } | 1585 } |
| 1609 | 1586 |
| 1610 } // namespace content | 1587 } // namespace content |
| OLD | NEW |