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

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

Issue 2209113002: Change wildcard source expression matching to conform latest spec (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test to ensure PDF loads from URL with `file:` scheme Created 4 years, 4 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 | chrome/browser/resources/feedback/manifest.json » ('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 dca4eb548b3dc23d9bee072b00e834213c2fa205..d5a35dd96d0fa5700cdf53775774c8138eb8c2b8 100644
--- a/chrome/browser/pdf/pdf_extension_test.cc
+++ b/chrome/browser/pdf/pdf_extension_test.cc
@@ -464,6 +464,20 @@ 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_dir;
+ ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &test_dir));
Lei Zhang 2016/08/08 23:16:24 You can do PathService::Get(chrome::DIR_TEST_DATA,
Sergey Shekyan 2016/08/08 23:55:42 I assumed so too, but unfortunately, path set by P
Lei Zhang 2016/08/08 23:57:16 Really? Because we use just that in several places
+ test_dir = test_dir.AppendASCII("chrome");
+ test_dir = test_dir.AppendASCII("test");
+ test_dir = test_dir.AppendASCII("data");
+ test_dir = test_dir.AppendASCII("pdf");
+ test_dir = test_dir.AppendASCII("test.pdf");
Lei Zhang 2016/08/08 23:16:24 Please sanity check and make sure the final FilePa
Sergey Shekyan 2016/08/08 23:55:42 Acknowledged.
+ GURL test_pdf_url("file://" + test_dir.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"));
« no previous file with comments | « no previous file | chrome/browser/resources/feedback/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698