Commit 7460eb77 authored by hbono@chromium.org's avatar hbono@chromium.org

Revert 86258 - Add a unit test for Motion JPEG frames.

This change adds a new unit test that verifies we can decode a JPEG image that does not have DHT markers. (This is a unit test for r85600 <http://crrev.com/85600>.)

BUG=none
TEST=JPEGCodec.DecodeMotionJPEG
Review URL: http://codereview.chromium.org/7012034

TBR=hbono@chromium.org
Review URL: http://codereview.chromium.org/7059009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86261 0039d316-1c4b-4281-b951-d872f2087c98
parent 25460665
...@@ -214,7 +214,7 @@ deps = { ...@@ -214,7 +214,7 @@ deps = {
"/trunk/deps/third_party/yasm/patched-yasm@73761", "/trunk/deps/third_party/yasm/patched-yasm@73761",
"src/third_party/libjpeg_turbo": "src/third_party/libjpeg_turbo":
"/trunk/deps/third_party/libjpeg_turbo@85600", "/trunk/deps/third_party/libjpeg_turbo@83675",
"src/third_party/flac": "src/third_party/flac":
"/trunk/deps/third_party/flac@75901", "/trunk/deps/third_party/flac@75901",
......
...@@ -54,26 +54,6 @@ const uint8 kTopSitesMigrationTestImage[] = ...@@ -54,26 +54,6 @@ const uint8 kTopSitesMigrationTestImage[] =
"\xfa\xff\xda\x00\x0c\x03\x01\x00\x02\x11\x03\x11\x00\x3f\x00\xf9" "\xfa\xff\xda\x00\x0c\x03\x01\x00\x02\x11\x03\x11\x00\x3f\x00\xf9"
"\xd2\x8a\x28\xaf\xc3\x0f\xf5\x4c\xff\xd9"; "\xd2\x8a\x28\xaf\xc3\x0f\xf5\x4c\xff\xd9";
// A typical Motion JPEG frame which do not have DHT markers.
const uint8 kMotionJPEGFrame[] =
"\xff\xd8\xff\xe0\x00\x10\x4a\x46\x49\x46\x00\x01\x01\x01\x00\x60"
"\x00\x60\x00\x00\xff\xdb\x00\x43\x00\x02\x01\x01\x02\x01\x01\x02"
"\x02\x02\x02\x02\x02\x02\x02\x03\x05\x03\x03\x03\x03\x03\x06\x04"
"\x04\x03\x05\x07\x06\x07\x07\x07\x06\x07\x07\x08\x09\x0b\x09\x08"
"\x08\x0a\x08\x07\x07\x0a\x0d\x0a\x0a\x0b\x0c\x0c\x0c\x0c\x07\x09"
"\x0e\x0f\x0d\x0c\x0e\x0b\x0c\x0c\x0c\xff\xdb\x00\x43\x01\x02\x02"
"\x02\x03\x03\x03\x06\x03\x03\x06\x0c\x08\x07\x08\x0c\x0c\x0c\x0c"
"\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
"\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c"
"\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\xff\xc0"
"\x00\x11\x08\x00\x40\x00\x40\x03\x01\x22\x00\x02\x11\x01\x03\x11"
"\x01\xff\xda\x00\x0c\x03\x01\x00\x02\x11\x03\x11\x00\x3f\x00\xf8"
"\xbe\x8a\x28\xaf\xe5\x33\xfd\xfc\x0a\x28\xa2\x80\x0a\x28\xa2\x80"
"\x0a\x28\xa2\x80\x0a\x28\xa2\x80\x0a\x28\xa2\x80\x0a\x28\xa2\x80"
"\x0a\x28\xa2\x80\x0a\x28\xa2\x80\x0a\x28\xa2\x80\x0a\x28\xa2\x80"
"\x0a\x28\xa2\x80\x0a\x28\xa2\x80\x0a\x28\xa2\x80\x0a\x28\xa2\x80"
"\x0a\x28\xa2\x80\x3f\xff\xd9";
} // namespace } // namespace
namespace gfx { namespace gfx {
...@@ -234,23 +214,4 @@ TEST(JPEGCodec, InvalidRead) { ...@@ -234,23 +214,4 @@ TEST(JPEGCodec, InvalidRead) {
&outw, &outh); &outw, &outh);
} }
// Test that we can decode a motion JPEG frame.
TEST(JPEGCodec, DecodeMotionJPEG) {
std::vector<unsigned char> output;
int outw, outh;
ASSERT_TRUE(JPEGCodec::Decode(kMotionJPEGFrame,
arraysize(kMotionJPEGFrame),
JPEGCodec::FORMAT_RGB, &output,
&outw, &outh));
EXPECT_EQ(64, outw);
EXPECT_EQ(64, outh);
ASSERT_TRUE(JPEGCodec::Decode(kMotionJPEGFrame,
arraysize(kMotionJPEGFrame),
JPEGCodec::FORMAT_RGBA, &output,
&outw, &outh));
EXPECT_EQ(64, outw);
EXPECT_EQ(64, outh);
}
} // namespace gfx } // namespace gfx
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment