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

Unified Diff: chrome/browser/pdf/pdf_extension_test.cc

Issue 2650513002: Fix buffer overrun in PDF accessibility code. (Closed)
Patch Set: Depend on pdf_private Created 3 years, 11 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 | pdf/pdfium/pdfium_page.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/pdf/pdf_extension_test.cc
diff --git a/chrome/browser/pdf/pdf_extension_test.cc b/chrome/browser/pdf/pdf_extension_test.cc
index b63a7bbd46f26361b2d44c443a7b5394e7ab45c1..9e10b26b9010118d691a799da144036c42c5bf01 100644
--- a/chrome/browser/pdf/pdf_extension_test.cc
+++ b/chrome/browser/pdf/pdf_extension_test.cc
@@ -727,6 +727,31 @@ IN_PROC_BROWSER_TEST_F(PDFExtensionTest, PdfAccessibilityInOOPIF) {
ASSERT_MULTILINE_STREQ(kExpectedPDFAXTree, ax_tree_dump);
}
+#if defined(GOOGLE_CHROME_BUILD)
+// Test a particular PDF encountered in the wild that encountered a crash
raymes 2017/01/30 18:57:25 nit: encountered a crash->triggered a crash
+// when accessibility is enabled. (http://crbug.com/668724)
+IN_PROC_BROWSER_TEST_F(PDFExtensionTest, PdfAccessibilityTextRunCrash) {
+ content::BrowserAccessibilityState::GetInstance()->EnableAccessibility();
+ GURL test_pdf_url(embedded_test_server()->GetURL(
+ "/pdf_private/accessibility_crash_2.pdf"));
+
+ content::WebContents* guest_contents = LoadPdfGetGuestContents(test_pdf_url);
+ ASSERT_TRUE(guest_contents);
+
+ WaitForAccessibilityTreeToContainNodeWithName(guest_contents, "Page 1");
+}
+#endif
+
+IN_PROC_BROWSER_TEST_F(PDFExtensionTest, PdfAccessibilityCrash) {
+ content::BrowserAccessibilityState::GetInstance()->EnableAccessibility();
+
+ GURL test_pdf_url(embedded_test_server()->GetURL("/pdf/test-crash.pdf"));
+ content::WebContents* guest_contents = LoadPdfGetGuestContents(test_pdf_url);
+ ASSERT_TRUE(guest_contents);
+
+ WaitForAccessibilityTreeToContainNodeWithName(guest_contents, "Page 1");
+}
raymes 2017/01/30 18:57:25 Hmm is this meant to be here?
+
IN_PROC_BROWSER_TEST_F(PDFExtensionTest, LinkCtrlLeftClick) {
host_resolver()->AddRule("www.example.com", "127.0.0.1");
GURL test_pdf_url(embedded_test_server()->GetURL("/pdf/test-link.pdf"));
« no previous file with comments | « no previous file | pdf/pdfium/pdfium_page.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698