| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 6 #include "content/test/image_decoder_test.h" | 6 #include "content/test/image_decoder_test.h" |
| 7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebImageDecoder.h" | 7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebImageDecoder.h" |
| 8 | 8 |
| 9 using WebKit::WebImageDecoder; | 9 using WebKit::WebImageDecoder; |
| 10 | 10 |
| 11 class ICOImageDecoderTest : public ImageDecoderTest { | 11 class ICOImageDecoderTest : public ImageDecoderTest { |
| 12 public: | 12 public: |
| 13 ICOImageDecoderTest() : ImageDecoderTest("ico") { } | 13 ICOImageDecoderTest() : ImageDecoderTest("ico") { } |
| 14 | 14 |
| 15 protected: | 15 protected: |
| 16 virtual WebKit::WebImageDecoder* CreateWebKitImageDecoder() const OVERRIDE { | 16 virtual WebKit::WebImageDecoder* CreateWebKitImageDecoder() const OVERRIDE { |
| 17 return new WebKit::WebImageDecoder(WebKit::WebImageDecoder::TypeICO); | 17 return new WebKit::WebImageDecoder(WebKit::WebImageDecoder::TypeICO); |
| 18 } | 18 } |
| 19 }; | 19 }; |
| 20 | 20 |
| 21 TEST_F(ICOImageDecoderTest, Decoding) { | 21 #if defined(OS_LINUX) |
| 22 #define MAYBE_Decoding DISABLED_Decoding |
| 23 #else |
| 24 #define MAYBE_Decoding Decoding |
| 25 #endif |
| 26 TEST_F(ICOImageDecoderTest, MAYBE_Decoding) { |
| 22 TestDecoding(); | 27 TestDecoding(); |
| 23 } | 28 } |
| 24 | 29 |
| 25 TEST_F(ICOImageDecoderTest, ImageNonZeroFrameIndex) { | 30 TEST_F(ICOImageDecoderTest, ImageNonZeroFrameIndex) { |
| 26 if (data_dir_.empty()) | 31 if (data_dir_.empty()) |
| 27 return; | 32 return; |
| 28 // Test that the decoder decodes multiple sizes of icons which have them. | 33 // Test that the decoder decodes multiple sizes of icons which have them. |
| 29 // Load an icon that has both favicon-size and larger entries. | 34 // Load an icon that has both favicon-size and larger entries. |
| 30 base::FilePath multisize_icon_path(data_dir_.AppendASCII("yahoo.ico")); | 35 base::FilePath multisize_icon_path(data_dir_.AppendASCII("yahoo.ico")); |
| 31 const base::FilePath md5_sum_path( | 36 const base::FilePath md5_sum_path( |
| 32 GetMD5SumPath(multisize_icon_path).value() + FILE_PATH_LITERAL("2")); | 37 GetMD5SumPath(multisize_icon_path).value() + FILE_PATH_LITERAL("2")); |
| 33 static const int kDesiredFrameIndex = 3; | 38 static const int kDesiredFrameIndex = 3; |
| 34 TestWebKitImageDecoder(multisize_icon_path, md5_sum_path, kDesiredFrameIndex); | 39 TestWebKitImageDecoder(multisize_icon_path, md5_sum_path, kDesiredFrameIndex); |
| 35 } | 40 } |
| OLD | NEW |