| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 #include "Test.h" | 8 #include "Test.h" |
| 9 #include "TestClassDef.h" | |
| 10 #include "SkAnnotation.h" | 9 #include "SkAnnotation.h" |
| 11 #include "SkData.h" | 10 #include "SkData.h" |
| 12 #include "SkCanvas.h" | 11 #include "SkCanvas.h" |
| 13 #include "SkPDFDevice.h" | 12 #include "SkPDFDevice.h" |
| 14 #include "SkPDFDocument.h" | 13 #include "SkPDFDocument.h" |
| 15 | 14 |
| 16 /** Returns true if data (may contain null characters) contains needle (null | 15 /** Returns true if data (may contain null characters) contains needle (null |
| 17 * terminated). */ | 16 * terminated). */ |
| 18 static bool ContainsString(const char* data, size_t dataSize, const char* needle
) { | 17 static bool ContainsString(const char* data, size_t dataSize, const char* needle
) { |
| 19 size_t nSize = strlen(needle); | 18 size_t nSize = strlen(needle); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 SkPDFDocument doc; | 87 SkPDFDocument doc; |
| 89 doc.appendPage(&device); | 88 doc.appendPage(&device); |
| 90 SkDynamicMemoryWStream outStream; | 89 SkDynamicMemoryWStream outStream; |
| 91 doc.emitPDF(&outStream); | 90 doc.emitPDF(&outStream); |
| 92 SkAutoDataUnref out(outStream.copyToData()); | 91 SkAutoDataUnref out(outStream.copyToData()); |
| 93 const char* rawOutput = (const char*)out->data(); | 92 const char* rawOutput = (const char*)out->data(); |
| 94 | 93 |
| 95 REPORTER_ASSERT(reporter, | 94 REPORTER_ASSERT(reporter, |
| 96 ContainsString(rawOutput, out->size(), "/example ")); | 95 ContainsString(rawOutput, out->size(), "/example ")); |
| 97 } | 96 } |
| OLD | NEW |