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

Side by Side Diff: fpdfsdk/src/fpdfview_embeddertest.cpp

Issue 857483005: Follow-on to pdfium_embeddertests. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fix copyright. 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 unified diff | Download patch
« no previous file with comments | « no previous file | pdfium.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "../../testing/embedder_test.h"
6 #include "testing/gtest/include/gtest/gtest.h"
7
8 class FPDFViewEmbeddertest : public EmbedderTest {
9 };
10
11 TEST_F(FPDFViewEmbeddertest, Document) {
12 EXPECT_TRUE(OpenDocument("testing/resources/about_blank.pdf"));
13 EXPECT_EQ(1, GetPageCount());
14 EXPECT_EQ(0, GetFirstPageNum());
15
16 int version;
17 EXPECT_TRUE(FPDF_GetFileVersion(document(), &version));
18 EXPECT_EQ(14, version);
19
20 EXPECT_EQ(0xFFFFFFFF, FPDF_GetDocPermissions(document()));
21 EXPECT_EQ(-1, FPDF_GetSecurityHandlerRevision(document()));
22 }
23
24 TEST_F(FPDFViewEmbeddertest, Page) {
25 EXPECT_TRUE(OpenDocument("testing/resources/about_blank.pdf"));
26 FPDF_FORMHANDLE form_handle = SetFormFillEnvironment();
27 FPDF_PAGE page = LoadPage(0, form_handle);
28 EXPECT_NE(nullptr, page);
29 EXPECT_EQ(612.0, FPDF_GetPageWidth(page));
30 EXPECT_EQ(792.0, FPDF_GetPageHeight(page));
31 UnloadPage(page, form_handle);
32 EXPECT_EQ(nullptr, LoadPage(1, form_handle));
33 ClearFormFillEnvironment(form_handle);
34 }
35
36 TEST_F(FPDFViewEmbeddertest, ViewerRef) {
37 EXPECT_TRUE(OpenDocument("testing/resources/about_blank.pdf"));
38 EXPECT_TRUE(FPDF_VIEWERREF_GetPrintScaling(document()));
39 EXPECT_EQ(1, FPDF_VIEWERREF_GetNumCopies(document()));
40 EXPECT_EQ(DuplexUndefined, FPDF_VIEWERREF_GetDuplex(document()));
41 }
42
OLDNEW
« no previous file with comments | « no previous file | pdfium.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698