Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(479)

Side by Side Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 2942623003: Make WebLocalFrameImpl::Load() to reset active match (Closed)
Patch Set: 2017-06-15T14:26:20 Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698