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 dca4eb548b3dc23d9bee072b00e834213c2fa205..74d1061f5b7285bfabda0c91c72e34cc1a16e2b0 100644 |
--- a/chrome/browser/pdf/pdf_extension_test.cc |
+++ b/chrome/browser/pdf/pdf_extension_test.cc |
@@ -464,6 +464,18 @@ IN_PROC_BROWSER_TEST_F(PDFExtensionTest, EnsureSameOriginRepliesAllowed) { |
true); |
} |
+// This test ensures that PDF can be loaded from local file |
+IN_PROC_BROWSER_TEST_F(PDFExtensionTest, EnsurePDFFromLocalFileLoads) { |
+ base::FilePath test_data_dir; |
+ ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir)); |
+ test_data_dir = test_data_dir.Append(FILE_PATH_LITERAL("pdf")); |
+ base::FilePath test_data_file = test_data_dir.AppendASCII("test.pdf"); |
+ ASSERT_TRUE(PathExists(test_data_file)); |
+ GURL test_pdf_url("file://" + test_data_file.MaybeAsASCII()); |
+ content::WebContents* guest_contents = LoadPdfGetGuestContents(test_pdf_url); |
+ ASSERT_TRUE(guest_contents); |
+} |
+ |
// This test ensures that link permissions are enforced properly in PDFs. |
IN_PROC_BROWSER_TEST_F(PDFExtensionTest, LinkPermissions) { |
GURL test_pdf_url(embedded_test_server()->GetURL("/pdf/test.pdf")); |