Skip to content

Commit

Permalink
Update pdf browser tests to use test data from new location.
Browse files Browse the repository at this point in the history
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/289873007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271185 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
jam@chromium.org committed May 17, 2014
1 parent 6faa7f3 commit f4e2cad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ v8.log
/chrome/test/data/gpu/vt/
/chrome/test/data/layout_tests
/chrome/test/data/osdd
/chrome/test/data/pdf_private
/chrome/test/data/perf/canvas_bench
/chrome/test/data/perf/frame_rate/content
/chrome/test/data/perf/frame_rate/private
/chrome/test/data/perf/private/
/chrome/test/data/perf/third_party/
/chrome/test/data/plugin/
/chrome/test/data/pyauto_private
/chrome/test/data/webrtc/resources
/chrome/tools/memory
/chrome/tools/test/reference_build
Expand Down
16 changes: 6 additions & 10 deletions chrome/browser/ui/pdf/pdf_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ class PDFBrowserTest : public InProcessBrowserTest,
load_stop_notification_count_(0) {
base::FilePath src_dir;
EXPECT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &src_dir));
pdf_test_server_.ServeFilesFromDirectory(src_dir.AppendASCII("pdf/test"));
pdf_test_server_.ServeFilesFromDirectory(src_dir.AppendASCII(
"chrome/test/data/pdf_private"));
}

protected:
Expand All @@ -64,12 +65,6 @@ class PDFBrowserTest : public InProcessBrowserTest,
return load_stop_notification_count_;
}

base::FilePath GetPDFTestDir() {
return base::FilePath(base::FilePath::kCurrentDirectory).AppendASCII("..").
AppendASCII("..").AppendASCII("..").AppendASCII("pdf").
AppendASCII("test");
}

void Load() {
// Make sure to set the window size before rendering, as otherwise rendering
// to a smaller window and then expanding leads to slight anti-aliasing
Expand All @@ -82,7 +77,7 @@ class PDFBrowserTest : public InProcessBrowserTest,
browser()->window()->SetBounds(bounds);

GURL url(ui_test_utils::GetTestUrl(
GetPDFTestDir(),
base::FilePath(FILE_PATH_LITERAL("pdf_private")),
base::FilePath(FILE_PATH_LITERAL("pdf_browsertest.pdf"))));
ui_test_utils::NavigateToURL(browser(), url);
}
Expand Down Expand Up @@ -133,7 +128,7 @@ class PDFBrowserTest : public InProcessBrowserTest,
base::MessageLoopForUI::current()->Quit();
ASSERT_EQ(success, true);
base::FilePath reference = ui_test_utils::GetTestFilePath(
GetPDFTestDir(),
base::FilePath(FILE_PATH_LITERAL("pdf_private")),
base::FilePath().AppendASCII(expected_filename_));
base::File::Info info;
ASSERT_TRUE(base::GetFileInfo(reference, &info));
Expand Down Expand Up @@ -319,7 +314,8 @@ IN_PROC_BROWSER_TEST_P(PDFBrowserTest, MAYBE_Loading) {
std::string base_url = std::string("/");

base::FileEnumerator file_enumerator(
ui_test_utils::GetTestFilePath(GetPDFTestDir(), base::FilePath()),
ui_test_utils::GetTestFilePath(
base::FilePath(FILE_PATH_LITERAL("pdf_private")), base::FilePath()),
false,
base::FileEnumerator::FILES,
FILE_PATH_LITERAL("*.pdf"));
Expand Down

0 comments on commit f4e2cad

Please sign in to comment.