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

Side by Side Diff: tests/DashPathEffectTest.cpp

Issue 189373008: Add reg test for http://crbug.com/348821 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: REPORTER_ASSERT Created 6 years, 9 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
« no previous file with comments | « gyp/tests.gypi ('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 #include "Test.h"
2
3 #include "SkDashPathEffect.h"
4 #include "SkWriteBuffer.h"
5
6 // crbug.com/348821 was rooted in SkDashPathEffect refusing to flatten and unfla tten itself when
7 // fInitialDashLength < 0 (a signal the effect is nonsense). Here we test that it flattens.
8
9 DEF_TEST(DashPathEffectTest_crbug_348821, r) {
10 SkScalar intervals[] = { 1.76934361e+36f, 2.80259693e-45f }; // Values from bug.
11 const int count = 2;
12 SkScalar phase = SK_ScalarInfinity; // Used to force the bad fInitialDashLe ngth = -1 path.
13 SkAutoTUnref<SkDashPathEffect> dash(SkDashPathEffect::Create(intervals, coun t, phase));
14
15 // NULL -> refuses to work with flattening framework.
16 REPORTER_ASSERT(r, dash->getFactory() != NULL);
17
18 SkWriteBuffer buffer;
19 buffer.writeFlattenable(dash);
20 REPORTER_ASSERT(r, buffer.bytesWritten() > 12); // We'd write 12 if broken, >=40 if not.
21 }
OLDNEW
« no previous file with comments | « gyp/tests.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698