Fix run_decoding_tests on xoom.

Builder Test-Android-Xoom-Tegra2-Arm7-Debug fails run_decoding_tests
due to a couple of images. Add a way in skimage to ignore failures
if an image is expected to fail. Add an expectations file for xoom
that includes ignore-failure for the two files which are failing.

I have created https://code.google.com/p/skia/issues/detail?id=1382
to track the fact that these images fail to decode, despite the bot
showing green.

R=borenet@google.com

Review URL: https://codereview.chromium.org/18023008

git-svn-id: http://skia.googlecode.com/svn/trunk@9797 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tools/skimage_main.cpp b/tools/skimage_main.cpp
index 01dbc46..572f9f5 100644
--- a/tools/skimage_main.cpp
+++ b/tools/skimage_main.cpp
@@ -164,6 +164,18 @@
 }
 
 /**
+ *  Return true if this filename is a known failure, and therefore a failure
+ *  to decode should be ignored.
+ */
+static bool expect_to_fail(const char* filename) {
+    if (NULL == gJsonExpectations.get()) {
+        return false;
+    }
+    skiagm::Expectations jsExpectations = gJsonExpectations->get(filename);
+    return jsExpectations.ignoreFailure();
+}
+
+/**
  *  Compare against an expectation for this filename, if there is one.
  *  @param bitmap SkBitmap to compare to the expected value.
  *  @param filename String used to find the expected value.
@@ -299,16 +311,22 @@
     SkAutoTDelete<SkImageDecoder> ad(codec);
 
     stream.rewind();
-    if (!codec->decode(&stream, &bitmap, SkBitmap::kARGB_8888_Config,
-                       SkImageDecoder::kDecodePixels_Mode)) {
-        gDecodeFailures.push_back().set(srcPath);
-        return;
-    }
 
     // Create a string representing just the filename itself, for use in json expectations.
     SkString basename = SkOSPath::SkBasename(srcPath);
     const char* filename = basename.c_str();
 
+    if (!codec->decode(&stream, &bitmap, SkBitmap::kARGB_8888_Config,
+                       SkImageDecoder::kDecodePixels_Mode)) {
+        if (expect_to_fail(filename)) {
+            gSuccessfulDecodes.push_back().appendf(
+                "failed to decode %s, which is a known failure.", srcPath);
+        } else {
+            gDecodeFailures.push_back().set(srcPath);
+        }
+        return;
+    }
+
     if (compare_to_expectations_if_necessary(bitmap, filename, &gDecodeFailures)) {
         gSuccessfulDecodes.push_back().printf("%s [%d %d]", srcPath, bitmap.width(),
                                               bitmap.height());