| OLD | NEW |
| 1 // Copyright 2015 PDFium Authors. All rights reserved. | 1 // Copyright 2015 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <limits> | 5 #include <limits> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "../../testing/embedder_test.h" | 8 #include "../../testing/embedder_test.h" |
| 9 #include "../../fpdfsdk/include/fpdfview.h" | 9 #include "../../fpdfsdk/include/fpdfview.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 // Bad value type for item from Dests NameTree array. | 170 // Bad value type for item from Dests NameTree array. |
| 171 dest = FPDF_GetNamedDestByName(document(), "WrongType"); | 171 dest = FPDF_GetNamedDestByName(document(), "WrongType"); |
| 172 EXPECT_EQ(nullptr, dest); | 172 EXPECT_EQ(nullptr, dest); |
| 173 | 173 |
| 174 // No such destination in either Dest NameTree or dictionary. | 174 // No such destination in either Dest NameTree or dictionary. |
| 175 dest = FPDF_GetNamedDestByName(document(), "Bogus"); | 175 dest = FPDF_GetNamedDestByName(document(), "Bogus"); |
| 176 EXPECT_EQ(nullptr, dest); | 176 EXPECT_EQ(nullptr, dest); |
| 177 } | 177 } |
| 178 | 178 |
| 179 // The following tests pass if the document opens without crashing. | 179 // The following tests pass if the document opens without crashing. |
| 180 TEST_F(FPDFViewEmbeddertest, Crasher1) { | 180 TEST_F(FPDFViewEmbeddertest, Crasher_113) { |
| 181 EXPECT_TRUE(OpenDocument("testing/resources/bug_113.pdf")); |
| 182 } |
| 183 |
| 184 TEST_F(FPDFViewEmbeddertest, Crasher_451830) { |
| 181 EXPECT_TRUE(OpenDocument("testing/resources/bug_451830.pdf")); | 185 EXPECT_TRUE(OpenDocument("testing/resources/bug_451830.pdf")); |
| 182 } | 186 } |
| 183 | 187 |
| 184 TEST_F(FPDFViewEmbeddertest, Crasher2) { | 188 TEST_F(FPDFViewEmbeddertest, Crasher_452455) { |
| 185 EXPECT_TRUE(OpenDocument("testing/resources/bug_452455.pdf")); | 189 EXPECT_TRUE(OpenDocument("testing/resources/bug_452455.pdf")); |
| 186 FPDF_PAGE page = LoadPage(0); | 190 FPDF_PAGE page = LoadPage(0); |
| 187 EXPECT_NE(nullptr, page); | 191 EXPECT_NE(nullptr, page); |
| 188 } | 192 } |
| OLD | NEW |