Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(766)

Side by Side Diff: tests/DocumentTest.cpp

Issue 72833002: Fix DocumentTest/SkDocument memory leaks (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Added comment Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/doc/SkDocument_PDF.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "Test.h" 1 #include "Test.h"
2 #include "TestClassDef.h" 2 #include "TestClassDef.h"
3 3
4 #include "SkCanvas.h" 4 #include "SkCanvas.h"
5 #include "SkDocument.h" 5 #include "SkDocument.h"
6 #include "SkOSFile.h" 6 #include "SkOSFile.h"
7 #include "SkStream.h" 7 #include "SkStream.h"
8 8
9 static void test_empty(skiatest::Reporter* reporter) { 9 static void test_empty(skiatest::Reporter* reporter) {
10 SkDynamicMemoryWStream stream; 10 SkDynamicMemoryWStream stream;
11 11
12 SkDocument* doc = SkDocument::CreatePDF(&stream); 12 SkAutoTUnref<SkDocument> doc(SkDocument::CreatePDF(&stream));
13 13
14 doc->close(); 14 doc->close();
15 15
16 REPORTER_ASSERT(reporter, stream.bytesWritten() == 0); 16 REPORTER_ASSERT(reporter, stream.bytesWritten() == 0);
17 } 17 }
18 18
19 static void test_abort(skiatest::Reporter* reporter) { 19 static void test_abort(skiatest::Reporter* reporter) {
20 SkDynamicMemoryWStream stream; 20 SkDynamicMemoryWStream stream;
21 SkAutoTUnref<SkDocument> doc(SkDocument::CreatePDF(&stream)); 21 SkAutoTUnref<SkDocument> doc(SkDocument::CreatePDF(&stream));
22 22
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 REPORTER_ASSERT(reporter, stream.bytesWritten() != 0); 97 REPORTER_ASSERT(reporter, stream.bytesWritten() != 0);
98 } 98 }
99 99
100 DEF_TEST(document_tests, reporter) { 100 DEF_TEST(document_tests, reporter) {
101 test_empty(reporter); 101 test_empty(reporter);
102 test_abort(reporter); 102 test_abort(reporter);
103 test_abortWithFile(reporter); 103 test_abortWithFile(reporter);
104 test_file(reporter); 104 test_file(reporter);
105 test_close(reporter); 105 test_close(reporter);
106 } 106 }
OLDNEW
« no previous file with comments | « src/doc/SkDocument_PDF.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698