| OLD | NEW |
| 1 // Copyright (c) 2008, Google Inc. | 1 // Copyright (c) 2008, Google Inc. |
| 2 // All rights reserved. | 2 // All rights reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 virtual WebCore::ImageDecoder* CreateDecoder() const { | 43 virtual WebCore::ImageDecoder* CreateDecoder() const { |
| 44 return new WebCore::ICOImageDecoder(); | 44 return new WebCore::ICOImageDecoder(); |
| 45 } | 45 } |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 TEST_F(ICOImageDecoderTest, Decoding) { | 48 TEST_F(ICOImageDecoderTest, Decoding) { |
| 49 TestDecoding(); | 49 TestDecoding(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 #ifndef CALCULATE_MD5_SUMS | 52 #ifndef CALCULATE_MD5_SUMS |
| 53 TEST_F(ICOImageDecoderTest, DISABLED_ChunkedDecoding) { | 53 TEST_F(ICOImageDecoderTest, ChunkedDecoding) { |
| 54 TestChunkedDecoding(); | 54 TestChunkedDecoding(); |
| 55 } | 55 } |
| 56 #endif | 56 #endif |
| 57 | 57 |
| 58 TEST_F(ICOImageDecoderTest, FaviconSize) { | 58 TEST_F(ICOImageDecoderTest, FaviconSize) { |
| 59 // Test that the decoder decodes multiple sizes of icons which have them. | 59 // Test that the decoder decodes multiple sizes of icons which have them. |
| 60 | 60 |
| 61 // Load an icon that has both favicon-size and larger entries. | 61 // Load an icon that has both favicon-size and larger entries. |
| 62 std::wstring multisize_icon_path(data_dir_); | 62 std::wstring multisize_icon_path(data_dir_); |
| 63 file_util::AppendToPath(&multisize_icon_path, L"yahoo.ico"); | 63 file_util::AppendToPath(&multisize_icon_path, L"yahoo.ico"); |
| 64 scoped_ptr<WebCore::ImageDecoder> decoder(SetupDecoder(multisize_icon_path, | 64 scoped_ptr<WebCore::ImageDecoder> decoder(SetupDecoder(multisize_icon_path, |
| 65 false)); | 65 false)); |
| 66 | 66 |
| 67 // Verify the decoding. | 67 // Verify the decoding. |
| 68 const std::wstring md5_sum_path(GetMD5SumPath(multisize_icon_path) + L"2"); | 68 const std::wstring md5_sum_path(GetMD5SumPath(multisize_icon_path) + L"2"); |
| 69 static const int kDesiredFrameIndex = 3; | 69 static const int kDesiredFrameIndex = 3; |
| 70 #ifdef CALCULATE_MD5_SUMS | 70 #ifdef CALCULATE_MD5_SUMS |
| 71 SaveMD5Sum(md5_sum_path, decoder->frameBufferAtIndex(kDesiredFrameIndex)); | 71 SaveMD5Sum(md5_sum_path, decoder->frameBufferAtIndex(kDesiredFrameIndex)); |
| 72 #else | 72 #else |
| 73 VerifyImage(decoder.get(), multisize_icon_path, md5_sum_path, | 73 VerifyImage(decoder.get(), multisize_icon_path, md5_sum_path, |
| 74 kDesiredFrameIndex); | 74 kDesiredFrameIndex); |
| 75 #endif | 75 #endif |
| 76 } | 76 } |
| OLD | NEW |