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

Side by Side Diff: tests/DebugCanvasTest.cpp

Issue 23589007: Add infrastructure for testing the debugger code. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 months 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 | « gyp/tests.gyp ('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
(Empty)
1 /*
2 * Copyright 2013 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "Test.h"
9 #include "debugger/SkDebugCanvas.h"
10
11 static void test_debugRect(skiatest::Reporter* reporter) {
12 SkDebugCanvas canvas(100, 100);
13 canvas.drawRect(SkRect::MakeWH(100, 100), SkPaint());
14
15 const SkTDArray<SkDrawCommand*> cmds = canvas.getDrawCommands();
16 REPORTER_ASSERT(reporter, cmds.count() > 0);
17
18 const SkTDArray<SkString*>& result = *cmds[0]->Info();
19 REPORTER_ASSERT(reporter, result.count() > 0);
20
21 SkString expected("SkRect: (0, 0, 100, 100)");
22 REPORTER_ASSERT(reporter, expected == *result[0]);
23 }
24
25 static void TestDebugCanvas(skiatest::Reporter* reporter) {
26 test_debugRect(reporter);
27 }
28
29 #include "TestClassDef.h"
30 DEFINE_TESTCLASS("DebugCanvas", TestDebugCanvasClass, TestDebugCanvas)
OLDNEW
« no previous file with comments | « gyp/tests.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698