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

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: Correcting Indentation. 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 | « no previous file | chrome/test/data/pdf/common_file.js » ('j') | chrome/test/data/pdf/common_file.js » ('J')
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..b5423f2db7fa06c9d9e1993df6928721dd870671 100644
--- a/chrome/browser/resources/pdf/pdf_extension_test.cc
+++ b/chrome/browser/resources/pdf/pdf_extension_test.cc
@@ -40,7 +40,9 @@ class PDFExtensionTest : public ExtensionApiTest {
ExtensionApiTest::TearDownOnMainThread();
}
- void RunTestsInFile(std::string filename, std::string pdf_filename) {
+ void RunTestsInFile(std::string filename,
+ std::string pdf_filename,
+ std::string commonfile) {
raymes 2015/01/28 01:33:45 Let's not pass this as a param. Instead let's just
Deepak 2015/01/28 05:57:23 Done.
Deepak 2015/01/28 05:57:24 Done.
base::FilePath pdf_path;
ASSERT_TRUE(PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf_path));
ASSERT_TRUE(
@@ -73,10 +75,19 @@ 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 file_test_data_dir = test_data_dir.AppendASCII(filename);
std::string test_js;
- ASSERT_TRUE(base::ReadFileToString(test_data_dir, &test_js));
+ ASSERT_TRUE(base::ReadFileToString(file_test_data_dir, &test_js));
+
+ if (!commonfile.empty()) {
+ std::string test_common_js;
+ test_data_dir = test_data_dir.AppendASCII(commonfile);
+ ASSERT_TRUE(base::ReadFileToString(test_data_dir, &test_common_js));
+ test_js.append(test_common_js);
+ }
+
ASSERT_TRUE(content::ExecuteScript(contents, test_js));
if (!catcher.GetNextResult())
@@ -85,17 +96,21 @@ class PDFExtensionTest : public ExtensionApiTest {
};
IN_PROC_BROWSER_TEST_F(PDFExtensionTest, Basic) {
- RunTestsInFile("basic_test.js", "test.pdf");
+ RunTestsInFile("basic_test.js", "test.pdf", "");
}
IN_PROC_BROWSER_TEST_F(PDFExtensionTest, BasicPlugin) {
- RunTestsInFile("basic_plugin_test.js", "test.pdf");
+ RunTestsInFile("basic_plugin_test.js", "test.pdf", "");
}
IN_PROC_BROWSER_TEST_F(PDFExtensionTest, Viewport) {
- RunTestsInFile("viewport_test.js", "test.pdf");
+ RunTestsInFile("viewport_test.js", "test.pdf", "common_file.js");
}
IN_PROC_BROWSER_TEST_F(PDFExtensionTest, Bookmark) {
- RunTestsInFile("bookmarks_test.js", "test-bookmarks.pdf");
+ RunTestsInFile("bookmarks_test.js", "test-bookmarks.pdf", "");
+}
+
+IN_PROC_BROWSER_TEST_F(PDFExtensionTest, NamedDestionations) {
+ RunTestsInFile("nameddestinations_test.js", "test.pdf", "common_file.js");
}
« no previous file with comments | « no previous file | chrome/test/data/pdf/common_file.js » ('j') | chrome/test/data/pdf/common_file.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698