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

Unified Diff: chrome/browser/chrome_find_request_manager_browsertest.cc

Issue 2700613003: Enable find-in-page across GuestViews. (Closed)
Patch Set: Small fix. Created 3 years, 8 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
Index: chrome/browser/chrome_find_request_manager_browsertest.cc
diff --git a/chrome/browser/chrome_find_request_manager_browsertest.cc b/chrome/browser/chrome_find_request_manager_browsertest.cc
index 73bfe94002f6ae659a2dd3a3a330d28c192cebc4..2d9e3f0bcf394c262bbaed42df4441d3bf986aad 100644
--- a/chrome/browser/chrome_find_request_manager_browsertest.cc
+++ b/chrome/browser/chrome_find_request_manager_browsertest.cc
@@ -9,6 +9,8 @@
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
+#include "content/public/browser/browser_context.h"
+#include "content/public/browser/browser_plugin_guest_manager.h"
#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/find_test_utils.h"
@@ -83,7 +85,7 @@ class ChromeFindRequestManagerTest : public InProcessBrowserTest {
// Tests searching in a full-page PDF.
IN_PROC_BROWSER_TEST_F(ChromeFindRequestManagerTest, FindInPDF) {
LoadAndWait("/find_in_pdf_page.pdf");
- pdf_extension_test_util::EnsurePDFHasLoaded(contents());
+ ASSERT_TRUE(pdf_extension_test_util::EnsurePDFHasLoaded(contents()));
blink::WebFindOptions options;
Find("result", options);
@@ -98,4 +100,31 @@ IN_PROC_BROWSER_TEST_F(ChromeFindRequestManagerTest, FindInPDF) {
EXPECT_EQ(3, results.active_match_ordinal);
}
+// Tests searching in a page with embedded PDFs. Note that this test, the
+// FindInPDF test, and the find tests in web_view_browsertest.cc ensure that
+// find-in-page works across GuestViews.
+//
+// TODO(paulmeyer): Note that this is left disabled for now since
+// EnsurePDFHasLoaded() currently does not work for embedded PDFs. This will be
+// fixed and enabled in a subsequent patch.
+IN_PROC_BROWSER_TEST_F(ChromeFindRequestManagerTest,
+ DISABLED_FindInEmbeddedPDFs) {
+ LoadAndWait("/find_in_embedded_pdf_page.html");
+ ASSERT_TRUE(pdf_extension_test_util::EnsurePDFHasLoaded(contents()));
+
+ blink::WebFindOptions options;
+ Find("result", options);
+ options.findNext = true;
+ options.forward = false;
+ Find("result", options);
+ Find("result", options);
+ Find("result", options);
+ delegate()->WaitForFinalReply();
+
+ FindResults results = delegate()->GetFindResults();
+ EXPECT_EQ(last_request_id(), results.request_id);
+ EXPECT_EQ(13, results.number_of_matches);
+ EXPECT_EQ(11, results.active_match_ordinal);
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698