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 | 8 |
9 #include "base/mac/mac_util.h" | 9 #include "base/mac/mac_util.h" |
10 #include "base/mac/scoped_nsautorelease_pool.h" | 10 #include "base/mac/scoped_nsautorelease_pool.h" |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 params.focus_rect = gfx::Rect(30, 11, 0, 10); | 393 params.focus_rect = gfx::Rect(30, 11, 0, 10); |
394 rwhv_mac_->SelectionBoundsChanged(params); | 394 rwhv_mac_->SelectionBoundsChanged(params); |
395 EXPECT_FALSE(rwhv_mac_->GetCachedFirstRectForCharacterRange( | 395 EXPECT_FALSE(rwhv_mac_->GetCachedFirstRectForCharacterRange( |
396 gfx::Range(0, 0).ToNSRange(), | 396 gfx::Range(0, 0).ToNSRange(), |
397 &rect, | 397 &rect, |
398 &actual_range)); | 398 &actual_range)); |
399 EXPECT_FALSE(rwhv_mac_->GetCachedFirstRectForCharacterRange( | 399 EXPECT_FALSE(rwhv_mac_->GetCachedFirstRectForCharacterRange( |
400 gfx::Range(0, 1).ToNSRange(), | 400 gfx::Range(0, 1).ToNSRange(), |
401 &rect, | 401 &rect, |
402 &actual_range)); | 402 &actual_range)); |
403 EXPECT_FALSE(rwhv_mac_->GetCachedFirstRectForCharacterRange( | 403 EXPECT_TRUE(rwhv_mac_->GetCachedFirstRectForCharacterRange( |
404 gfx::Range(1, 1).ToNSRange(), | 404 gfx::Range(1, 1).ToNSRange(), |
405 &rect, | 405 &rect, |
406 &actual_range)); | 406 &actual_range)); |
407 EXPECT_FALSE(rwhv_mac_->GetCachedFirstRectForCharacterRange( | 407 EXPECT_TRUE(rwhv_mac_->GetCachedFirstRectForCharacterRange( |
408 gfx::Range(1, 2).ToNSRange(), | 408 gfx::Range(1, 2).ToNSRange(), |
409 &rect, | 409 &rect, |
410 &actual_range)); | 410 &actual_range)); |
411 EXPECT_FALSE(rwhv_mac_->GetCachedFirstRectForCharacterRange( | 411 EXPECT_TRUE(rwhv_mac_->GetCachedFirstRectForCharacterRange( |
412 gfx::Range(2, 2).ToNSRange(), | 412 gfx::Range(2, 2).ToNSRange(), |
413 &rect, | 413 &rect, |
414 &actual_range)); | 414 &actual_range)); |
415 } | 415 } |
416 | 416 |
417 TEST_F(RenderWidgetHostViewMacTest, UpdateCompositionSinglelineCase) { | 417 TEST_F(RenderWidgetHostViewMacTest, UpdateCompositionSinglelineCase) { |
418 const gfx::Point kOrigin(10, 11); | 418 const gfx::Point kOrigin(10, 11); |
419 const gfx::Size kBoundsUnit(10, 20); | 419 const gfx::Size kBoundsUnit(10, 20); |
420 | 420 |
421 NSRect rect; | 421 NSRect rect; |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 EXPECT_EQ(1U, process_host_->sink().message_count()); | 1019 EXPECT_EQ(1U, process_host_->sink().message_count()); |
1020 process_host_->sink().ClearMessages(); | 1020 process_host_->sink().ClearMessages(); |
1021 } | 1021 } |
1022 | 1022 |
1023 // Clean up. | 1023 // Clean up. |
1024 host->Shutdown(); | 1024 host->Shutdown(); |
1025 } | 1025 } |
1026 | 1026 |
1027 | 1027 |
1028 } // namespace content | 1028 } // namespace content |
OLD | NEW |