diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-27 20:41:27 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-27 20:41:27 +0000 |
commit | 497e342c070df49e9cbe1e9f8c39e31477fb11ff (patch) | |
tree | 7b8e200c4bd6c6599e9229fde271d9af1ffdb872 /webkit/tools/test_shell/image_decoder_unittest.h | |
parent | aa15ca70b58a09192d3367070f6c7a14fac0887c (diff) | |
download | chromium_src-497e342c070df49e9cbe1e9f8c39e31477fb11ff.zip chromium_src-497e342c070df49e9cbe1e9f8c39e31477fb11ff.tar.gz chromium_src-497e342c070df49e9cbe1e9f8c39e31477fb11ff.tar.bz2 |
Refactor the "load and decode" portion of the image decoder unittest into a helper function, so that it will be easier for the ICO favicon test to ask for a particular frame.
Right now this isn't necessary; that test still wants frame 0. After I land some patches upstream, however, this will change (and all the "testing_favicon_size_" crap will disappear, it's just a temporary hack).
BUG=none
TEST=Covered by existing unittests
Review URL: http://codereview.chromium.org/160123
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21692 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/image_decoder_unittest.h')
-rw-r--r-- | webkit/tools/test_shell/image_decoder_unittest.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/webkit/tools/test_shell/image_decoder_unittest.h b/webkit/tools/test_shell/image_decoder_unittest.h index 33c99d1..4b1a5d9 100644 --- a/webkit/tools/test_shell/image_decoder_unittest.h +++ b/webkit/tools/test_shell/image_decoder_unittest.h @@ -46,9 +46,11 @@ std::wstring GetMD5SumPath(const std::wstring& path); void SaveMD5Sum(const std::wstring& path, WebCore::RGBA32Buffer* buffer); #else // Verifies the image. |path| identifies the path the image was loaded from. +// |frame_index| indicates which index from the decoder we should examine. void VerifyImage(WebCore::ImageDecoder* decoder, const std::wstring& path, - const std::wstring& md5_sum_path); + const std::wstring& md5_sum_path, + size_t frame_index); #endif class ImageDecoderTest : public testing::Test { @@ -64,6 +66,12 @@ class ImageDecoderTest : public testing::Test { // Returns true if the image is bogus and should not be successfully decoded. bool ShouldImageFail(const std::wstring& path) const; + // Creates and returns an ImageDecoder for the file at the given |path|. If + // |split_at_random| is true, also verifies that breaking the data supplied to + // the decoder into two random pieces does not cause problems. + WebCore::ImageDecoder* SetupDecoder(const std::wstring& path, + bool split_at_random) const; + // Verifies each of the test image files is decoded correctly and matches the // expected state. |file_selection| and |threshold| can be used to select // files to test based on file size. |