Parse icc profiles and exif orientation from jpeg markers

New resources should be fine to add since they are already
checked into chromium.

BUG=skia:3834
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1813273002

Review URL: https://codereview.chromium.org/1813273002
diff --git a/tests/ExifTest.cpp b/tests/ExifTest.cpp
new file mode 100644
index 0000000..c49de0f
--- /dev/null
+++ b/tests/ExifTest.cpp
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "Resources.h"
+#include "SkCodec.h"
+#include "Test.h"
+
+static SkStreamAsset* resource(const char path[]) {
+    SkString fullPath = GetResourcePath(path);
+    return SkStream::NewFromFile(fullPath.c_str());
+}
+
+DEF_TEST(ExifOrientation, r) {
+    SkAutoTDelete<SkStream> stream(resource("exif-orientation-2-ur.jpg"));
+    REPORTER_ASSERT(r, nullptr != stream);
+    SkAutoTDelete<SkCodec> codec(SkCodec::NewFromStream(stream.release()));
+    REPORTER_ASSERT(r, nullptr != codec);
+    SkCodec::Origin origin = codec->getOrigin();
+    REPORTER_ASSERT(r, SkCodec::kTopRight_Origin == origin);
+
+    stream.reset(resource("mandrill_512_q075.jpg"));
+    codec.reset(SkCodec::NewFromStream(stream.release()));
+    REPORTER_ASSERT(r, nullptr != codec);
+    origin = codec->getOrigin();
+    REPORTER_ASSERT(r, SkCodec::kTopLeft_Origin == origin);
+}