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

Unified Diff: gm/gmmain.cpp

Issue 13650002: gm: report ExpectationsMismatch and RenderModeMismatch results separately (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: rename_kImageMismatch_to_kExpectationsMismatch Created 7 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 side-by-side diff with in-line comments
Download patch
Index: gm/gmmain.cpp
===================================================================
--- gm/gmmain.cpp (revision 8534)
+++ gm/gmmain.cpp (working copy)
@@ -272,7 +272,8 @@
}
// Things to do only if there is some error condition.
- SkString fullName = make_name(name.c_str(), renderModeDescriptor);
+ SkString fullName = name;
+ fullName.append(renderModeDescriptor);
for (int typeInt = 0; typeInt <= kLast_ErrorType; typeInt++) {
ErrorType type = static_cast<ErrorType>(typeInt);
if (errorCombination.includes(type)) {
@@ -704,7 +705,7 @@
if (expectations.empty()) {
errors.add(kMissingExpectations_ErrorType);
} else if (!expectations.match(actualChecksum)) {
- errors.add(kImageMismatch_ErrorType);
+ errors.add(kExpectationsMismatch_ErrorType);
// Write out the "actuals" for any mismatches, if we have
// been directed to do so.
@@ -753,7 +754,7 @@
// (where we can set ignore-failure to either true or
// false), add test cases that exercise ignored
// failures (both for kMissingExpectations_ErrorType
- // and kImageMismatch_ErrorType).
+ // and kExpectationsMismatch_ErrorType).
this->fJsonActualResults_FailureIgnored[testName] =
actualResults;
} else {
@@ -772,7 +773,7 @@
this->fJsonActualResults_NoComparison[testName] =
actualResults;
}
- if (result.includes(kImageMismatch_ErrorType)) {
+ if (result.includes(kExpectationsMismatch_ErrorType)) {
this->fJsonActualResults_Failed[testName] = actualResults;
}
}
@@ -996,9 +997,8 @@
return kEmpty_ErrorCombination;
}
- ErrorCombination test_pipe_playback(GM* gm,
- const ConfigData& gRec,
- const SkBitmap& referenceBitmap) {
+ ErrorCombination test_pipe_playback(GM* gm, const ConfigData& gRec,
+ const SkBitmap& referenceBitmap, bool simulateFailure) {
ErrorCombination errors;
for (size_t i = 0; i < SK_ARRAY_COUNT(gPipeWritingFlagCombos); ++i) {
SkBitmap bitmap;
@@ -1010,7 +1010,9 @@
SkGPipeWriter writer;
SkCanvas* pipeCanvas = writer.startRecording(
&pipeController, gPipeWritingFlagCombos[i].flags);
- invokeGM(gm, pipeCanvas, false, false);
+ if (!simulateFailure) {
+ invokeGM(gm, pipeCanvas, false, false);
+ }
complete_bitmap(&bitmap);
writer.endRecording();
SkString string("-pipe");
@@ -1177,6 +1179,7 @@
DEFINE_string2(resourcePath, i, "", "Directory that stores image resources.");
DEFINE_bool(rtree, true, "Exercise the R-Tree variant of SkPicture test pass.");
DEFINE_bool(serialize, true, "Exercise the SkPicture serialization & deserialization test pass.");
+DEFINE_bool(simulatePipePlaybackFailure, false, "Simulate a rendering failure in pipe mode only.");
DEFINE_bool(tiledPipe, false, "Exercise tiled SkGPipe replay.");
DEFINE_bool(tileGrid, true, "Exercise the tile grid variant of SkPicture.");
DEFINE_string(tileGridReplayScales, "", "Space separated list of floating-point scale "
@@ -1459,7 +1462,8 @@
ErrorCombination pipeErrors;
if (FLAGS_pipe) {
- pipeErrors.add(gmmain.test_pipe_playback(gm, compareConfig, comparisonBitmap));
+ pipeErrors.add(gmmain.test_pipe_playback(gm, compareConfig, comparisonBitmap,
+ FLAGS_simulatePipePlaybackFailure));
}
if ((pipeErrors.isEmpty()) &&

Powered by Google App Engine
This is Rietveld 408576698