| 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 "fpdfsdk/src/fpdfview_c_api_test.h" | 8 #include "fpdfsdk/src/fpdfview_c_api_test.h" |
| 9 #include "public/fpdfview.h" | 9 #include "public/fpdfview.h" |
| 10 #include "testing/embedder_test.h" | 10 #include "testing/embedder_test.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 } | 189 } |
| 190 | 190 |
| 191 TEST_F(FPDFViewEmbeddertest, Crasher_452455) { | 191 TEST_F(FPDFViewEmbeddertest, Crasher_452455) { |
| 192 EXPECT_TRUE(OpenDocument("bug_452455.pdf")); | 192 EXPECT_TRUE(OpenDocument("bug_452455.pdf")); |
| 193 FPDF_PAGE page = LoadPage(0); | 193 FPDF_PAGE page = LoadPage(0); |
| 194 EXPECT_NE(nullptr, page); | 194 EXPECT_NE(nullptr, page); |
| 195 UnloadPage(page); | 195 UnloadPage(page); |
| 196 } | 196 } |
| 197 | 197 |
| 198 TEST_F(FPDFViewEmbeddertest, Crasher_454695) { | 198 TEST_F(FPDFViewEmbeddertest, Crasher_454695) { |
| 199 // Document is damanged and can't be opened. | 199 // Document is damaged and can't be opened. |
| 200 EXPECT_FALSE(OpenDocument("bug_454695.pdf")); | 200 EXPECT_FALSE(OpenDocument("bug_454695.pdf")); |
| 201 } | 201 } |
| 202 | 202 |
| 203 TEST_F(FPDFViewEmbeddertest, Crasher_572871) { |
| 204 EXPECT_TRUE(OpenDocument("bug_572871.pdf")); |
| 205 } |
| 206 |
| 203 // The following tests pass if the document opens without infinite looping. | 207 // The following tests pass if the document opens without infinite looping. |
| 204 TEST_F(FPDFViewEmbeddertest, Hang_298) { | 208 TEST_F(FPDFViewEmbeddertest, Hang_298) { |
| 205 EXPECT_FALSE(OpenDocument("bug_298.pdf")); | 209 EXPECT_FALSE(OpenDocument("bug_298.pdf")); |
| 206 } | 210 } |
| 207 | 211 |
| 208 // Test if the document opens without infinite looping. | 212 // Test if the document opens without infinite looping. |
| 209 // Previously this test will hang in a loop inside LoadAllCrossRefV4. After | 213 // Previously this test will hang in a loop inside LoadAllCrossRefV4. After |
| 210 // the fix, LoadAllCrossRefV4 will return false after detecting a cross | 214 // the fix, LoadAllCrossRefV4 will return false after detecting a cross |
| 211 // reference loop. Cross references will be rebuilt successfully. | 215 // reference loop. Cross references will be rebuilt successfully. |
| 212 TEST_F(FPDFViewEmbeddertest, CrossRefV4Loop) { | 216 TEST_F(FPDFViewEmbeddertest, CrossRefV4Loop) { |
| 213 EXPECT_TRUE(OpenDocument("bug_xrefv4_loop.pdf")); | 217 EXPECT_TRUE(OpenDocument("bug_xrefv4_loop.pdf")); |
| 214 } | 218 } |
| OLD | NEW |