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

Unified Diff: content/browser/find_request_manager_browsertest.cc

Issue 2723253002: Fix beep when navigating/closing a page with find bar open
Patch Set: android Created 3 years, 10 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 | « content/browser/find_request_manager.cc ('k') | content/browser/web_contents/web_contents_impl.h » ('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 3e34167e92e4486913ab3fd30ccb44702cb6b14d..313367ba8132cf59e670d1e3e8565a132bd5500e 100644
--- a/content/browser/find_request_manager_browsertest.cc
+++ b/content/browser/find_request_manager_browsertest.cc
@@ -319,6 +319,35 @@ IN_PROC_BROWSER_TEST_P(FindRequestManagerTest, DISABLED_AddFrame) {
EXPECT_EQ(5, results.active_match_ordinal);
}
+IN_PROC_BROWSER_TEST_F(FindRequestManagerTest, MAYBE(RemoveFrame)) {
+ LoadAndWait("/find_with_frame_removal.html");
+
+ blink::WebFindOptions options;
+ Find("hello", options);
+ delegate()->WaitForFinalReply();
+ FindResults results = delegate()->GetFindResults();
+
+ EXPECT_EQ(last_request_id(), results.request_id);
+ EXPECT_EQ(2, results.number_of_matches);
+ EXPECT_EQ(1, results.active_match_ordinal);
+
+ // Remove the iframe. Make sure search results are updated, but that it's
+ // noted that the update was due to a frame removal so that we don't beep.
+ // See https://crbug.com/682299.
+ std::string script(
+ "var iframes = document.getElementsByTagName('iframe');\n"
+ "for (var i = 0; i < iframes.length; i++)\n"
+ " iframes[i].parentNode.removeChild(iframes[i]);");
+ delegate()->MarkNextReply();
+ ASSERT_TRUE(ExecuteScript(shell(), script));
+ delegate()->WaitForNextReply();
+
+ results = delegate()->GetFindResults();
+ EXPECT_EQ(1, results.number_of_matches);
+ EXPECT_EQ(1, results.active_match_ordinal);
+ EXPECT_TRUE(results.was_frame_removal);
+}
+
// Tests adding a frame during a find session where there were previously no
// matches.
IN_PROC_BROWSER_TEST_F(FindRequestManagerTest, MAYBE(AddFrameAfterNoMatches)) {
« no previous file with comments | « content/browser/find_request_manager.cc ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698