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

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

Issue 812933004: Add API tests for NamedDestsByName, DestGetPageIndex. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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 | fpdfsdk/src/fpdfview_embeddertest.cpp » ('j') | testing/resources/named_dests.pdf » ('J')
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 <limits>
6 #include <string>
7
8 #include "../../testing/embedder_test.h"
9 #include "../../fpdfsdk/include/fpdfview.h"
10 #include "../../fpdfsdk/include/fpdfdoc.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12
13 class FPDFDocEmbeddertest : public EmbedderTest {
14 };
15
16 TEST_F(FPDFDocEmbeddertest, DestGetPageIndex) {
17 EXPECT_TRUE(OpenDocument("testing/resources/named_dests.pdf"));
18
19 // NULL FPDF_DEST case.
20 EXPECT_EQ(0, FPDFDest_GetPageIndex(document(), nullptr));
21
22 // Item from Names array.
23 FPDF_DEST dest = FPDF_GetNamedDestByName(document(), "First");
24 EXPECT_EQ(1, FPDFDest_GetPageIndex(document(), dest));
25
26 // Item from alternate Dests dict.
27 dest = FPDF_GetNamedDestByName(document(), "FirstAlternate");
28 EXPECT_EQ(11, FPDFDest_GetPageIndex(document(), dest));
29 }
OLDNEW
« no previous file with comments | « no previous file | fpdfsdk/src/fpdfview_embeddertest.cpp » ('j') | testing/resources/named_dests.pdf » ('J')

Powered by Google App Engine
This is Rietveld 408576698