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 "core/fxcrt/include/fx_basic.h" | 5 #include "core/fxcrt/include/fx_basic.h" |
6 #include "public/fpdf_text.h" | 6 #include "public/fpdf_text.h" |
7 #include "public/fpdfview.h" | 7 #include "public/fpdfview.h" |
8 #include "testing/embedder_test.h" | 8 #include "testing/embedder_test.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "testing/test_support.h" | 10 #include "testing/test_support.h" |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 16, 16, 16, 16, 16, 16, 16, 16, 16, 16}; | 381 16, 16, 16, 16, 16, 16, 16, 16, 16, 16}; |
382 | 382 |
383 int count = FPDFText_CountChars(textpage); | 383 int count = FPDFText_CountChars(textpage); |
384 ASSERT_EQ(FX_ArraySize(kExpectedFontsSizes), static_cast<size_t>(count)); | 384 ASSERT_EQ(FX_ArraySize(kExpectedFontsSizes), static_cast<size_t>(count)); |
385 for (int i = 0; i < count; ++i) | 385 for (int i = 0; i < count; ++i) |
386 EXPECT_EQ(kExpectedFontsSizes[i], FPDFText_GetFontSize(textpage, i)) << i; | 386 EXPECT_EQ(kExpectedFontsSizes[i], FPDFText_GetFontSize(textpage, i)) << i; |
387 | 387 |
388 FPDFText_ClosePage(textpage); | 388 FPDFText_ClosePage(textpage); |
389 UnloadPage(page); | 389 UnloadPage(page); |
390 } | 390 } |
| 391 |
| 392 TEST_F(FPDFTextEmbeddertest, ToUnicode) { |
| 393 EXPECT_TRUE(OpenDocument("bug_583.pdf")); |
| 394 FPDF_PAGE page = LoadPage(0); |
| 395 EXPECT_TRUE(page); |
| 396 |
| 397 FPDF_TEXTPAGE textpage = FPDFText_LoadPage(page); |
| 398 EXPECT_TRUE(textpage); |
| 399 |
| 400 ASSERT_EQ(1, FPDFText_CountChars(textpage)); |
| 401 EXPECT_EQ(static_cast<unsigned int>(0), FPDFText_GetUnicode(textpage, 0)); |
| 402 |
| 403 FPDFText_ClosePage(textpage); |
| 404 UnloadPage(page); |
| 405 } |
OLD | NEW |