OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "base/files/file_path.h" | |
6 #include "base/file_util.h" | |
7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebImageDecoder.h" | |
8 #include "webkit/tools/test_shell/image_decoder_unittest.h" | |
9 | |
10 using WebKit::WebImageDecoder; | |
11 | |
12 class ICOImageDecoderTest : public ImageDecoderTest { | |
13 public: | |
14 ICOImageDecoderTest() : ImageDecoderTest("ico") { } | |
15 | |
16 protected: | |
17 virtual WebKit::WebImageDecoder* CreateWebKitImageDecoder() const OVERRIDE { | |
18 return new WebKit::WebImageDecoder(WebKit::WebImageDecoder::TypeICO); | |
19 } | |
20 }; | |
21 | |
22 TEST_F(ICOImageDecoderTest, Decoding) { | |
23 TestDecoding(); | |
24 } | |
25 | |
26 TEST_F(ICOImageDecoderTest, ImageNonZeroFrameIndex) { | |
27 // Test that the decoder decodes multiple sizes of icons which have them. | |
28 // Load an icon that has both favicon-size and larger entries. | |
29 base::FilePath multisize_icon_path(data_dir_.AppendASCII("yahoo.ico")); | |
30 const base::FilePath md5_sum_path( | |
31 GetMD5SumPath(multisize_icon_path).value() + FILE_PATH_LITERAL("2")); | |
32 static const int kDesiredFrameIndex = 3; | |
33 TestWebKitImageDecoder(multisize_icon_path, md5_sum_path, kDesiredFrameIndex); | |
34 } | |
OLD | NEW |