Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(718)

Side by Side Diff: content/common/gpu/media/vaapi_jpeg_decoder_unittest.cc

Issue 1432963003: [Ozone] Extends the lifetime of VaapiWrapper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_.reset(); }
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_ptr<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(
60 const media::JpegParseResult& parse_result, 60 const media::JpegParseResult& parse_result,
61 const std::string& expected_md5sum) { 61 const std::string& expected_md5sum) {
62 gfx::Size size(parse_result.frame_header.coded_width, 62 gfx::Size size(parse_result.frame_header.coded_width,
63 parse_result.frame_header.coded_height); 63 parse_result.frame_header.coded_height);
64 64
65 std::vector<VASurfaceID> va_surfaces; 65 std::vector<VASurfaceID> va_surfaces;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « content/common/gpu/media/vaapi_jpeg_decode_accelerator.h ('k') | content/common/gpu/media/vaapi_picture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698