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

Unified Diff: content/browser/find_request_manager_browsertest.cc

Issue 2316203002: Fix find box bug after navigation. (Closed)
Patch Set: Added test. Created 4 years, 3 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 | « no previous file | content/test/data/find_in_simple_page.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/find_request_manager_browsertest.cc
diff --git a/content/browser/find_request_manager_browsertest.cc b/content/browser/find_request_manager_browsertest.cc
index c0df3d705d13899e94171d529f13cadd8aeb62b0..dce46635ca2be1e9c2bfb767a1121cd05a45a4de 100644
--- a/content/browser/find_request_manager_browsertest.cc
+++ b/content/browser/find_request_manager_browsertest.cc
@@ -553,6 +553,35 @@ IN_PROC_BROWSER_TEST_F(FindRequestManagerTest, MAYBE(FindInPage_Issue627799)) {
}
}
+IN_PROC_BROWSER_TEST_F(FindRequestManagerTest, MAYBE(FindInPage_Issue644448)) {
+ TestNavigationObserver navigation_observer(contents());
+ NavigateToURL(shell(), GURL("about:blank"));
+ EXPECT_TRUE(navigation_observer.last_navigation_succeeded());
+
+ blink::WebFindOptions default_options;
+ Find("result", default_options);
+ delegate()->WaitForFinalReply();
+
+ // Initially, there are no matches on the page.
+ FindResults results = delegate()->GetFindResults();
+ EXPECT_EQ(last_request_id(), results.request_id);
+ EXPECT_EQ(0, results.number_of_matches);
+ EXPECT_EQ(0, results.active_match_ordinal);
+
+ // Load a page with matches.
+ LoadAndWait("/find_in_simple_page.html");
+
+ Find("result", default_options);
+ delegate()->WaitForFinalReply();
+
+ // There should now be matches found. When the bug was present, there were
+ // still no matches found.
+ results = delegate()->GetFindResults();
+ EXPECT_EQ(last_request_id(), results.request_id);
+ EXPECT_EQ(5, results.number_of_matches);
+ EXPECT_EQ(1, results.active_match_ordinal);
+}
+
#if defined(OS_ANDROID)
// Tests requesting find match rects.
IN_PROC_BROWSER_TEST_F(FindRequestManagerTest, MAYBE(FindMatchRects)) {
« no previous file with comments | « no previous file | content/test/data/find_in_simple_page.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698