OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_TEST_IMAGE_DECODER_TEST_H_ | 5 #ifndef CONTENT_TEST_IMAGE_DECODER_TEST_H_ |
6 #define CONTENT_TEST_IMAGE_DECODER_TEST_H_ | 6 #define CONTENT_TEST_IMAGE_DECODER_TEST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 }; | 34 }; |
35 | 35 |
36 // Returns the path the decoded data is saved at. | 36 // Returns the path the decoded data is saved at. |
37 base::FilePath GetMD5SumPath(const base::FilePath& path); | 37 base::FilePath GetMD5SumPath(const base::FilePath& path); |
38 | 38 |
39 class ImageDecoderTest : public testing::Test { | 39 class ImageDecoderTest : public testing::Test { |
40 public: | 40 public: |
41 explicit ImageDecoderTest(const std::string& format) : format_(format) { } | 41 explicit ImageDecoderTest(const std::string& format) : format_(format) { } |
42 | 42 |
43 protected: | 43 protected: |
44 virtual void SetUp() OVERRIDE; | 44 virtual void SetUp() override; |
45 | 45 |
46 // Returns the vector of image files for testing. | 46 // Returns the vector of image files for testing. |
47 std::vector<base::FilePath> GetImageFiles() const; | 47 std::vector<base::FilePath> GetImageFiles() const; |
48 | 48 |
49 // Returns true if the image is bogus and should not be successfully decoded. | 49 // Returns true if the image is bogus and should not be successfully decoded. |
50 bool ShouldImageFail(const base::FilePath& path) const; | 50 bool ShouldImageFail(const base::FilePath& path) const; |
51 | 51 |
52 // Tests if decoder decodes image at image_path with underlying frame at | 52 // Tests if decoder decodes image at image_path with underlying frame at |
53 // index desired_frame_index. The md5_sum_path is needed if the test is not | 53 // index desired_frame_index. The md5_sum_path is needed if the test is not |
54 // asked to generate one, i.e. if #define CALCULATE_MD5_SUMS is not set. | 54 // asked to generate one, i.e. if #define CALCULATE_MD5_SUMS is not set. |
(...skipping 22 matching lines...) Expand all Loading... |
77 const base::FilePath& data_dir() const { return data_dir_; } | 77 const base::FilePath& data_dir() const { return data_dir_; } |
78 | 78 |
79 private: | 79 private: |
80 // Path to the test files. | 80 // Path to the test files. |
81 base::FilePath data_dir_; | 81 base::FilePath data_dir_; |
82 | 82 |
83 DISALLOW_COPY_AND_ASSIGN(ImageDecoderTest); | 83 DISALLOW_COPY_AND_ASSIGN(ImageDecoderTest); |
84 }; | 84 }; |
85 | 85 |
86 #endif // CONTENT_TEST_IMAGE_DECODER_TEST_H_ | 86 #endif // CONTENT_TEST_IMAGE_DECODER_TEST_H_ |
OLD | NEW |