diff options
author | Wei Li <weili@chromium.org> | 2015-11-09 12:09:55 -0800 |
---|---|---|
committer | Wei Li <weili@chromium.org> | 2015-11-09 12:09:55 -0800 |
commit | 091f7a070d58e1f8de6bbfdc5b60e1cef84e58c3 (patch) | |
tree | b1d303ad5e74be376c84bf76502d19d6290a7329 /fpdfsdk/src/fpdfview_embeddertest.cpp | |
parent | 3beeeeeb2ca45d54b34e4cc80fb137980e2f7aae (diff) | |
download | pdfium-091f7a070d58e1f8de6bbfdc5b60e1cef84e58c3.tar.xz |
Merge to XFA: Add path service to retrieve test data directory at run time so tests can be run from any directory.
Previously the tests which read test files assume the current directory is under pdfium. Running from any other directory will break the build.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1408003014 .
(cherry picked from commit c0e93a9a942fe7d99800502a61d2fbb58cf9276f)
Conflicts:
core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_embeddertest.cpp
fpdfsdk/src/fpdfdoc_embeddertest.cpp
testing/embedder_test.cpp
testing/embedder_test.h
Review URL: https://codereview.chromium.org/1411403012 .
Diffstat (limited to 'fpdfsdk/src/fpdfview_embeddertest.cpp')
-rw-r--r-- | fpdfsdk/src/fpdfview_embeddertest.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/fpdfsdk/src/fpdfview_embeddertest.cpp b/fpdfsdk/src/fpdfview_embeddertest.cpp index 2a00193a5e..35da9b6caf 100644 --- a/fpdfsdk/src/fpdfview_embeddertest.cpp +++ b/fpdfsdk/src/fpdfview_embeddertest.cpp @@ -5,9 +5,9 @@ #include <limits> #include <string> -#include "../../testing/embedder_test.h" -#include "fpdfview_c_api_test.h" +#include "fpdfsdk/src/fpdfview_c_api_test.h" #include "public/fpdfview.h" +#include "testing/embedder_test.h" #include "testing/gtest/include/gtest/gtest.h" TEST(fpdf, CApiTest) { @@ -17,7 +17,7 @@ TEST(fpdf, CApiTest) { class FPDFViewEmbeddertest : public EmbedderTest {}; TEST_F(FPDFViewEmbeddertest, Document) { - EXPECT_TRUE(OpenDocument("testing/resources/about_blank.pdf")); + EXPECT_TRUE(OpenDocument("about_blank.pdf")); EXPECT_EQ(1, GetPageCount()); EXPECT_EQ(0, GetFirstPageNum()); @@ -30,7 +30,7 @@ TEST_F(FPDFViewEmbeddertest, Document) { } TEST_F(FPDFViewEmbeddertest, Page) { - EXPECT_TRUE(OpenDocument("testing/resources/about_blank.pdf")); + EXPECT_TRUE(OpenDocument("about_blank.pdf")); FPDF_PAGE page = LoadPage(0); EXPECT_NE(nullptr, page); EXPECT_EQ(612.0, FPDF_GetPageWidth(page)); @@ -40,14 +40,14 @@ TEST_F(FPDFViewEmbeddertest, Page) { } TEST_F(FPDFViewEmbeddertest, ViewerRef) { - EXPECT_TRUE(OpenDocument("testing/resources/about_blank.pdf")); + EXPECT_TRUE(OpenDocument("about_blank.pdf")); EXPECT_TRUE(FPDF_VIEWERREF_GetPrintScaling(document())); EXPECT_EQ(1, FPDF_VIEWERREF_GetNumCopies(document())); EXPECT_EQ(DuplexUndefined, FPDF_VIEWERREF_GetDuplex(document())); } TEST_F(FPDFViewEmbeddertest, NamedDests) { - EXPECT_TRUE(OpenDocument("testing/resources/named_dests.pdf")); + EXPECT_TRUE(OpenDocument("named_dests.pdf")); long buffer_size; char fixed_buffer[512]; FPDF_DEST dest; @@ -142,7 +142,7 @@ TEST_F(FPDFViewEmbeddertest, NamedDests) { } TEST_F(FPDFViewEmbeddertest, NamedDestsByName) { - EXPECT_TRUE(OpenDocument("testing/resources/named_dests.pdf")); + EXPECT_TRUE(OpenDocument("named_dests.pdf")); // Null pointer returns NULL. FPDF_DEST dest = FPDF_GetNamedDestByName(document(), nullptr); @@ -180,16 +180,16 @@ TEST_F(FPDFViewEmbeddertest, NamedDestsByName) { // The following tests pass if the document opens without crashing. TEST_F(FPDFViewEmbeddertest, Crasher_113) { - EXPECT_TRUE(OpenDocument("testing/resources/bug_113.pdf")); + EXPECT_TRUE(OpenDocument("bug_113.pdf")); } TEST_F(FPDFViewEmbeddertest, Crasher_451830) { // Document is damaged and can't be opened. - EXPECT_FALSE(OpenDocument("testing/resources/bug_451830.pdf")); + EXPECT_FALSE(OpenDocument("bug_451830.pdf")); } TEST_F(FPDFViewEmbeddertest, Crasher_452455) { - EXPECT_TRUE(OpenDocument("testing/resources/bug_452455.pdf")); + EXPECT_TRUE(OpenDocument("bug_452455.pdf")); FPDF_PAGE page = LoadPage(0); EXPECT_NE(nullptr, page); UnloadPage(page); @@ -197,5 +197,5 @@ TEST_F(FPDFViewEmbeddertest, Crasher_452455) { TEST_F(FPDFViewEmbeddertest, Crasher_454695) { // Document is damanged and can't be opened. - EXPECT_FALSE(OpenDocument("testing/resources/bug_454695.pdf")); + EXPECT_FALSE(OpenDocument("bug_454695.pdf")); } |