| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 5320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5331 | 5331 |
| 5332 EXPECT_TRUE(frame->EnsureTextFinder().ScopingInProgress()); | 5332 EXPECT_TRUE(frame->EnsureTextFinder().ScopingInProgress()); |
| 5333 | 5333 |
| 5334 while (frame->EnsureTextFinder().ScopingInProgress()) | 5334 while (frame->EnsureTextFinder().ScopingInProgress()) |
| 5335 RunPendingTasks(); | 5335 RunPendingTasks(); |
| 5336 | 5336 |
| 5337 EXPECT_EQ(3, client.Count()); | 5337 EXPECT_EQ(3, client.Count()); |
| 5338 EXPECT_EQ(3, client.ActiveIndex()); | 5338 EXPECT_EQ(3, client.ActiveIndex()); |
| 5339 } | 5339 } |
| 5340 | 5340 |
| 5341 TEST_P(ParameterizedWebFrameTest, |
| 5342 FindInPageStopFindActionKeepSelectionInAnotherDocument) { |
| 5343 RegisterMockedHttpURLLoad("find.html"); |
| 5344 RegisterMockedHttpURLLoad("hello_world.html"); |
| 5345 FrameTestHelpers::WebViewHelper web_view_helper; |
| 5346 web_view_helper.InitializeAndLoad(base_url_ + "find.html"); |
| 5347 ASSERT_TRUE(web_view_helper.WebView()->MainFrameImpl()); |
| 5348 WebLocalFrame* frame = web_view_helper.WebView()->MainFrameImpl(); |
| 5349 const int kFindIdentifier = 12345; |
| 5350 WebFindOptions options; |
| 5351 |
| 5352 // Set active match |
| 5353 ASSERT_TRUE( |
| 5354 frame->Find(kFindIdentifier, WebString::FromUTF8("foo"), options, false)); |
| 5355 // Move to another page. |
| 5356 FrameTestHelpers::LoadFrame(frame, base_url_ + "hello_world.html"); |
| 5357 |
| 5358 // Stop Find-In-Page. |TextFinder::active_match_| still hold a |Range| in |
| 5359 // "find.html". |
| 5360 frame->StopFinding(WebLocalFrame::kStopFindActionKeepSelection); |
| 5361 |
| 5362 // Pass if not crash. See http://crbug.com/719880 for details. |
| 5363 } |
| 5364 |
| 5341 static WebPoint TopLeft(const WebRect& rect) { | 5365 static WebPoint TopLeft(const WebRect& rect) { |
| 5342 return WebPoint(rect.x, rect.y); | 5366 return WebPoint(rect.x, rect.y); |
| 5343 } | 5367 } |
| 5344 | 5368 |
| 5345 static WebPoint BottomRightMinusOne(const WebRect& rect) { | 5369 static WebPoint BottomRightMinusOne(const WebRect& rect) { |
| 5346 // FIXME: If we don't subtract 1 from the x- and y-coordinates of the | 5370 // FIXME: If we don't subtract 1 from the x- and y-coordinates of the |
| 5347 // selection bounds, selectRange() will select the *next* element. That's | 5371 // selection bounds, selectRange() will select the *next* element. That's |
| 5348 // strictly correct, as hit-testing checks the pixel to the lower-right of | 5372 // strictly correct, as hit-testing checks the pixel to the lower-right of |
| 5349 // the input coordinate, but it's a wart on the API. | 5373 // the input coordinate, but it's a wart on the API. |
| 5350 return WebPoint(rect.x + rect.width - 1, rect.y + rect.height - 1); | 5374 return WebPoint(rect.x + rect.width - 1, rect.y + rect.height - 1); |
| (...skipping 6925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12276 if (obj->IsText()) { | 12300 if (obj->IsText()) { |
| 12277 LayoutText* layout_text = ToLayoutText(obj); | 12301 LayoutText* layout_text = ToLayoutText(obj); |
| 12278 text = layout_text->GetText(); | 12302 text = layout_text->GetText(); |
| 12279 break; | 12303 break; |
| 12280 } | 12304 } |
| 12281 } | 12305 } |
| 12282 EXPECT_EQ("foo alt", text.Utf8()); | 12306 EXPECT_EQ("foo alt", text.Utf8()); |
| 12283 } | 12307 } |
| 12284 | 12308 |
| 12285 } // namespace blink | 12309 } // namespace blink |
| OLD | NEW |