Chromium Code Reviews| OLD | NEW |
|---|---|
| (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(); | |
|
mtklein
2013/09/11 15:15:28
This is just a suggestion. We're assuming result
dsinclair
2013/09/11 15:20:44
Done.
| |
| 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) | |
| OLD | NEW |