From c0376febfc855870a0e109d39ee62e82f0ab2139 Mon Sep 17 00:00:00 2001 From: "vandebo@chromium.org" Date: Mon, 5 Mar 2012 18:44:33 +0000 Subject: [PDF] Fix name objects containing characters > 0x80 and add a test. This fixes chrome bug http://crbug.com/115258 Review URL: https://codereview.appspot.com/5726048 git-svn-id: http://skia.googlecode.com/svn/trunk@3319 2bbb7eff-a529-9590-31e7-b0007b416f81 --- tests/PDFPrimitivesTest.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/PDFPrimitivesTest.cpp b/tests/PDFPrimitivesTest.cpp index 82686eff87..1aed3ad981 100644 --- a/tests/PDFPrimitivesTest.cpp +++ b/tests/PDFPrimitivesTest.cpp @@ -275,6 +275,14 @@ static void TestPDFPrimitives(skiatest::Reporter* reporter) { CheckObjectOutput(reporter, name.get(), expectedResult, strlen(expectedResult), false, false); + // Test that we correctly handle characters with the high-bit set. + char highBitCString[] = {0xDE, 0xAD, 'b', 'e', 0xEF, 0}; + SkRefPtr highBitName = new SkPDFName(highBitCString); + name->unref(); // SkRefPtr and new both took a reference. + const char highBitExpectedResult[] = "/#DE#ADbe#EF"; + CheckObjectOutput(reporter, highBitName.get(), highBitExpectedResult, + strlen(highBitExpectedResult), false, false); + SkRefPtr array = new SkPDFArray; array->unref(); // SkRefPtr and new both took a reference. SimpleCheckObjectOutput(reporter, array.get(), "[]"); -- cgit v1.2.3