| OLD | NEW |
| (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 } |
| OLD | NEW |