Bug 1315554 - Part 10a. Add large embedded PNG/BMP ICO tests. r=me
authorAndrew Osmond <aosmond@mozilla.com>
Sat, 22 Jul 2017 07:50:32 -0400
changeset 419120 6a5ba604200e8db1efe18d7f637e11a2b0286060
parent 419119 44311d857010b64e0b97ca0628e198622e6629cd
child 419121 6b3ee47d2f8fda2ea668bbf2355eb05724687652
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1315554
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1315554 - Part 10a. Add large embedded PNG/BMP ICO tests. r=me
image/test/gtest/Common.cpp
image/test/gtest/Common.h
image/test/gtest/TestDecoders.cpp
image/test/gtest/green-large-bmp.ico
image/test/gtest/green-large-png.ico
image/test/gtest/moz.build
--- a/image/test/gtest/Common.cpp
+++ b/image/test/gtest/Common.cpp
@@ -674,16 +674,28 @@ ImageTestCase DownscaledTransparentICOWi
                        TEST_CASE_IS_TRANSPARENT | TEST_CASE_IGNORE_OUTPUT);
 }
 
 ImageTestCase TruncatedSmallGIFTestCase()
 {
   return ImageTestCase("green-1x1-truncated.gif", "image/gif", IntSize(1, 1));
 }
 
+ImageTestCase LargeICOWithBMPTestCase()
+{
+  return ImageTestCase("green-large-bmp.ico", "image/x-icon", IntSize(256, 256),
+                       TEST_CASE_IS_TRANSPARENT);
+}
+
+ImageTestCase LargeICOWithPNGTestCase()
+{
+  return ImageTestCase("green-large-png.ico", "image/x-icon", IntSize(512, 512),
+                       TEST_CASE_IS_TRANSPARENT);
+}
+
 ImageTestCase GreenMultipleSizesICOTestCase()
 {
   return ImageTestCase("green-multiple-sizes.ico", "image/x-icon",
                        IntSize(256, 256));
 }
 
 } // namespace image
 } // namespace mozilla
--- a/image/test/gtest/Common.h
+++ b/image/test/gtest/Common.h
@@ -409,14 +409,16 @@ ImageTestCase DownscaledGIFTestCase();
 ImageTestCase DownscaledJPGTestCase();
 ImageTestCase DownscaledBMPTestCase();
 ImageTestCase DownscaledICOTestCase();
 ImageTestCase DownscaledIconTestCase();
 ImageTestCase DownscaledTransparentICOWithANDMaskTestCase();
 
 ImageTestCase TruncatedSmallGIFTestCase();
 
+ImageTestCase LargeICOWithBMPTestCase();
+ImageTestCase LargeICOWithPNGTestCase();
 ImageTestCase GreenMultipleSizesICOTestCase();
 
 } // namespace image
 } // namespace mozilla
 
 #endif // mozilla_image_test_gtest_Common_h
--- a/image/test/gtest/TestDecoders.cpp
+++ b/image/test/gtest/TestDecoders.cpp
@@ -668,16 +668,36 @@ TEST_F(ImageDecoders, AnimatedGIFWithExt
   EXPECT_TRUE(bool(result.Surface()));
 }
 
 TEST_F(ImageDecoders, TruncatedSmallGIFSingleChunk)
 {
   CheckDecoderSingleChunk(TruncatedSmallGIFTestCase());
 }
 
+TEST_F(ImageDecoders, LargeICOWithBMPSingleChunk)
+{
+  CheckDecoderSingleChunk(LargeICOWithBMPTestCase());
+}
+
+TEST_F(ImageDecoders, LargeICOWithBMPMultiChunk)
+{
+  CheckDecoderMultiChunk(LargeICOWithBMPTestCase());
+}
+
+TEST_F(ImageDecoders, LargeICOWithPNGSingleChunk)
+{
+  CheckDecoderSingleChunk(LargeICOWithPNGTestCase());
+}
+
+TEST_F(ImageDecoders, LargeICOWithPNGMultiChunk)
+{
+  CheckDecoderMultiChunk(LargeICOWithPNGTestCase());
+}
+
 TEST_F(ImageDecoders, MultipleSizesICOSingleChunk)
 {
   ImageTestCase testCase = GreenMultipleSizesICOTestCase();
 
   // Create an image.
   RefPtr<Image> image =
     ImageFactory::CreateAnonymousImage(nsDependentCString(testCase.mMimeType));
   ASSERT_TRUE(!image->HasError());
new file mode 100644
index 0000000000000000000000000000000000000000..3962cea29de37892ddda2b7dae390bd2865f784b
GIT binary patch
literal 270398
zc%1FXu?@f=6hlE1F#|Ov`!AS)ewR!T>E1P#leV2&X4dQ(d#^f@tNyCz(+vOs00000
z00000000000000000000000000000000000000000000000000000000000000000
z00000000000000000000000000000000000000000000000000000000000000000
z00000000000000000000000000000000000000000000000000000000000000000
z00000000000000000000000000000000000000000000000000000000000000000
z0000000000000000000000000000000000000000000000002+B1w`YNs=T<k|arz
Ge%}KR#vZr;
new file mode 100644
index 0000000000000000000000000000000000000000..27b9f43cdd6f48e3f581455d8df10f3dbf0f0d30
GIT binary patch
literal 341
zc${NkU<5)CU}R8Wum>{5fb7lyKX+a(DJ~$B*VDr#h=GBL0fZTufz-KeZaaY#OS+@4
zBLl<6e(pbstU$g(vPY0F14ES>14Ba#1H&(%P{RubhEf9thF1v;3|2E37{m+a><Y92
zO0Wg^gt#*NXZZjBfBxQxK#=W8-tI1p|Cw~}0Xgg?p1!W^57|Y<%{iRswVVVBnR&W6
zhE&{odyo<2+9rkn>+?JuAP&b3YNVThCMTB$ECF&<OI#yLQW8s2t&)pUffR$0fuXss
zfw``cVTh5jm8q$ffrYMtiIsst-x0Z6C>nC}Q!>*kaclTLb6Fb5K2KLamvv4FO#s$r
BOe+8Y
--- a/image/test/gtest/moz.build
+++ b/image/test/gtest/moz.build
@@ -42,16 +42,18 @@ TEST_HARNESS_FILES.gtest += [
     'downscaled.ico',
     'downscaled.icon',
     'downscaled.jpg',
     'downscaled.png',
     'first-frame-green.gif',
     'first-frame-green.png',
     'first-frame-padding.gif',
     'green-1x1-truncated.gif',
+    'green-large-bmp.ico',
+    'green-large-png.ico',
     'green-multiple-sizes.ico',
     'green.bmp',
     'green.gif',
     'green.ico',
     'green.icon',
     'green.jpg',
     'green.png',
     'invalid-truncated-metadata.bmp',