| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "webkit/tools/test_shell/image_decoder_unittest.h" | 7 #include "webkit/tools/test_shell/image_decoder_unittest.h" |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/md5.h" | 10 #include "base/md5.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 EXPECT_EQ(0, memcmp(&expected_digest, &actual_digest, sizeof(MD5Digest))) << | 75 EXPECT_EQ(0, memcmp(&expected_digest, &actual_digest, sizeof(MD5Digest))) << |
| 76 path; | 76 path; |
| 77 } | 77 } |
| 78 #endif | 78 #endif |
| 79 | 79 |
| 80 void ImageDecoderTest::SetUp() { | 80 void ImageDecoderTest::SetUp() { |
| 81 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &data_dir_)); | 81 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &data_dir_)); |
| 82 file_util::AppendToPath(&data_dir_, L"webkit"); | 82 file_util::AppendToPath(&data_dir_, L"webkit"); |
| 83 file_util::AppendToPath(&data_dir_, L"data"); | 83 file_util::AppendToPath(&data_dir_, L"data"); |
| 84 file_util::AppendToPath(&data_dir_, format_ + L"_decoder"); | 84 file_util::AppendToPath(&data_dir_, format_ + L"_decoder"); |
| 85 ASSERT_TRUE(file_util::PathExists(data_dir_)); | 85 ASSERT_TRUE(file_util::PathExists(data_dir_)) << data_dir_; |
| 86 } | 86 } |
| 87 | 87 |
| 88 std::vector<std::wstring> ImageDecoderTest::GetImageFiles() const { | 88 std::vector<std::wstring> ImageDecoderTest::GetImageFiles() const { |
| 89 std::wstring pattern = L"*." + format_; | 89 std::wstring pattern = L"*." + format_; |
| 90 | 90 |
| 91 file_util::FileEnumerator enumerator(FilePath::FromWStringHack(data_dir_), | 91 file_util::FileEnumerator enumerator(FilePath::FromWStringHack(data_dir_), |
| 92 false, | 92 false, |
| 93 file_util::FileEnumerator::FILES); | 93 file_util::FileEnumerator::FILES); |
| 94 | 94 |
| 95 std::vector<std::wstring> image_files; | 95 std::vector<std::wstring> image_files; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 // Make sure passing the complete image results in successful decoding. | 178 // Make sure passing the complete image results in successful decoding. |
| 179 partial_contents->append( | 179 partial_contents->append( |
| 180 &image_contents.data()[partial_size], | 180 &image_contents.data()[partial_size], |
| 181 static_cast<int>(image_contents.size() - partial_size)); | 181 static_cast<int>(image_contents.size() - partial_size)); |
| 182 decoder->setData(partial_contents.get(), true); | 182 decoder->setData(partial_contents.get(), true); |
| 183 VerifyImage(decoder.get(), *i, GetMD5SumPath(*i)); | 183 VerifyImage(decoder.get(), *i, GetMD5SumPath(*i)); |
| 184 } | 184 } |
| 185 } | 185 } |
| 186 #endif | 186 #endif |
| 187 | 187 |
| OLD | NEW |