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

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

Issue 838723003: Testcases for nameddests and navigate for PDF (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per review comments. Created 5 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 | « chrome/browser/resources/pdf/pdf.js ('k') | chrome/test/data/pdf/navigator_test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/pdf/pdf_extension_test.cc
diff --git a/chrome/browser/resources/pdf/pdf_extension_test.cc b/chrome/browser/resources/pdf/pdf_extension_test.cc
index 699669f7d19daedddec62fe6ef6bd9ce72d8ed11..6a56a91427ab276bba543c0cfcfa4b916ac05b79 100644
--- a/chrome/browser/resources/pdf/pdf_extension_test.cc
+++ b/chrome/browser/resources/pdf/pdf_extension_test.cc
@@ -73,11 +73,16 @@ class PDFExtensionTest : public ExtensionApiTest {
PathService::Get(base::DIR_SOURCE_ROOT, &test_data_dir);
test_data_dir = test_data_dir.Append(
FILE_PATH_LITERAL("chrome/test/data/pdf"));
- test_data_dir = test_data_dir.AppendASCII(filename);
+ base::FilePath test_util_path = test_data_dir.AppendASCII("test_util.js");
+ std::string test_util_js;
+ ASSERT_TRUE(base::ReadFileToString(test_util_path, &test_util_js));
+ base::FilePath test_file_path = test_data_dir.AppendASCII(filename);
std::string test_js;
- ASSERT_TRUE(base::ReadFileToString(test_data_dir, &test_js));
- ASSERT_TRUE(content::ExecuteScript(contents, test_js));
+ ASSERT_TRUE(base::ReadFileToString(test_file_path, &test_js));
+
+ test_util_js.append(test_js);
+ ASSERT_TRUE(content::ExecuteScript(contents, test_util_js));
if (!catcher.GetNextResult())
FAIL() << catcher.message();
@@ -99,3 +104,11 @@ IN_PROC_BROWSER_TEST_F(PDFExtensionTest, Viewport) {
IN_PROC_BROWSER_TEST_F(PDFExtensionTest, Bookmark) {
RunTestsInFile("bookmarks_test.js", "test-bookmarks.pdf");
}
+
+IN_PROC_BROWSER_TEST_F(PDFExtensionTest, Navigator) {
+ RunTestsInFile("navigator_test.js", "test.pdf");
+}
+
+IN_PROC_BROWSER_TEST_F(PDFExtensionTest, ParamsParser) {
+ RunTestsInFile("params_parser_test.js", "test.pdf");
+}
« no previous file with comments | « chrome/browser/resources/pdf/pdf.js ('k') | chrome/test/data/pdf/navigator_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698