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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/WebFrameTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
index 0ec5d4048c01a200cecb1ce31525bd9cd96541ce..0c64f0e87a8be23291e2c41241f7dda6923fc023 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -5338,6 +5338,30 @@ TEST_P(ParameterizedWebFrameTest, FindInPageJavaScriptUpdatesDOMProperOrdinal) {
EXPECT_EQ(3, client.ActiveIndex());
}
+TEST_P(ParameterizedWebFrameTest,
+ FindInPageStopFindActionKeepSelectionInAnotherDocument) {
+ RegisterMockedHttpURLLoad("find.html");
+ RegisterMockedHttpURLLoad("hello_world.html");
+ FrameTestHelpers::WebViewHelper web_view_helper;
+ web_view_helper.InitializeAndLoad(base_url_ + "find.html");
+ ASSERT_TRUE(web_view_helper.WebView()->MainFrameImpl());
+ WebLocalFrame* frame = web_view_helper.WebView()->MainFrameImpl();
+ const int kFindIdentifier = 12345;
+ WebFindOptions options;
+
+ // Set active match
+ ASSERT_TRUE(
+ frame->Find(kFindIdentifier, WebString::FromUTF8("foo"), options, false));
+ // Move to another page.
+ FrameTestHelpers::LoadFrame(frame, base_url_ + "hello_world.html");
+
+ // Stop Find-In-Page. |TextFinder::active_match_| still hold a |Range| in
+ // "find.html".
+ frame->StopFinding(WebLocalFrame::kStopFindActionKeepSelection);
+
+ // Pass if not crash. See http://crbug.com/719880 for details.
+}
+
static WebPoint TopLeft(const WebRect& rect) {
return WebPoint(rect.x, rect.y);
}
« 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