| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 // This has to be included first. | 7 // This has to be included first. |
| 8 // See http://code.google.com/p/googletest/issues/detail?id=371 | 8 // See http://code.google.com/p/googletest/issues/detail?id=371 |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 wrapper_ = VaapiWrapper::Create(VaapiWrapper::kDecode, | 39 wrapper_ = VaapiWrapper::Create(VaapiWrapper::kDecode, |
| 40 VAProfileJPEGBaseline, report_error_cb); | 40 VAProfileJPEGBaseline, report_error_cb); |
| 41 ASSERT_TRUE(wrapper_); | 41 ASSERT_TRUE(wrapper_); |
| 42 | 42 |
| 43 base::FilePath input_file = media::GetTestDataFilePath(kTestFilename); | 43 base::FilePath input_file = media::GetTestDataFilePath(kTestFilename); |
| 44 | 44 |
| 45 ASSERT_TRUE(base::ReadFileToString(input_file, &jpeg_data_)) | 45 ASSERT_TRUE(base::ReadFileToString(input_file, &jpeg_data_)) |
| 46 << "failed to read input data from " << input_file.value(); | 46 << "failed to read input data from " << input_file.value(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void TearDown() override { wrapper_.reset(); } | 49 void TearDown() override { wrapper_ = nullptr; } |
| 50 | 50 |
| 51 bool VerifyDecode(const media::JpegParseResult& parse_result, | 51 bool VerifyDecode(const media::JpegParseResult& parse_result, |
| 52 const std::string& md5sum); | 52 const std::string& md5sum); |
| 53 | 53 |
| 54 protected: | 54 protected: |
| 55 scoped_refptr<VaapiWrapper> wrapper_; | 55 scoped_refptr<VaapiWrapper> wrapper_; |
| 56 std::string jpeg_data_; | 56 std::string jpeg_data_; |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 bool VaapiJpegDecoderTest::VerifyDecode( | 59 bool VaapiJpegDecoderTest::VerifyDecode( |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 129 |
| 130 } // namespace | 130 } // namespace |
| 131 } // namespace content | 131 } // namespace content |
| 132 | 132 |
| 133 int main(int argc, char** argv) { | 133 int main(int argc, char** argv) { |
| 134 testing::InitGoogleTest(&argc, argv); | 134 testing::InitGoogleTest(&argc, argv); |
| 135 base::AtExitManager exit_manager; | 135 base::AtExitManager exit_manager; |
| 136 content::VaapiWrapper::PreSandboxInitialization(); | 136 content::VaapiWrapper::PreSandboxInitialization(); |
| 137 return RUN_ALL_TESTS(); | 137 return RUN_ALL_TESTS(); |
| 138 } | 138 } |
| OLD | NEW |