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

Side by Side Diff: ppapi/tests/test_video_encoder.cc

Issue 1069653002: ppapi: VideoEncoder: fix reported value for GetSupportedProfiles() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bbudge's nit Created 5 years, 8 months 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
« no previous file with comments | « ppapi/proxy/video_encoder_resource_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ppapi/tests/test_video_encoder.h" 5 #include "ppapi/tests/test_video_encoder.h"
6 6
7 #include "ppapi/c/pp_codecs.h" 7 #include "ppapi/c/pp_codecs.h"
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/cpp/video_encoder.h" 9 #include "ppapi/cpp/video_encoder.h"
10 #include "ppapi/tests/testing_instance.h" 10 #include "ppapi/tests/testing_instance.h"
(...skipping 14 matching lines...) Expand all
25 // Test that we get results for supported formats. 25 // Test that we get results for supported formats.
26 { 26 {
27 pp::VideoEncoder video_encoder(instance_); 27 pp::VideoEncoder video_encoder(instance_);
28 ASSERT_FALSE(video_encoder.is_null()); 28 ASSERT_FALSE(video_encoder.is_null());
29 29
30 TestCompletionCallbackWithOutput<std::vector<PP_VideoProfileDescription> > 30 TestCompletionCallbackWithOutput<std::vector<PP_VideoProfileDescription> >
31 callback(instance_->pp_instance(), false); 31 callback(instance_->pp_instance(), false);
32 callback.WaitForResult( 32 callback.WaitForResult(
33 video_encoder.GetSupportedProfiles(callback.GetCallback())); 33 video_encoder.GetSupportedProfiles(callback.GetCallback()));
34 34
35 ASSERT_EQ(PP_OK, callback.result()); 35 ASSERT_GE(callback.result(), 1U);
36 36
37 const std::vector<PP_VideoProfileDescription> video_profiles = 37 const std::vector<PP_VideoProfileDescription> video_profiles =
38 callback.output(); 38 callback.output();
39 ASSERT_GE(video_profiles.size(), 1U); 39 ASSERT_GE(video_profiles.size(), 1U);
40 40
41 bool found_vp8 = false; 41 bool found_vp8 = false;
42 for (uint32_t i = 0; i < video_profiles.size(); ++i) { 42 for (uint32_t i = 0; i < video_profiles.size(); ++i) {
43 const PP_VideoProfileDescription& description = video_profiles[i]; 43 const PP_VideoProfileDescription& description = video_profiles[i];
44 if (description.profile == PP_VIDEOPROFILE_VP8_ANY) 44 if (description.profile == PP_VIDEOPROFILE_VP8_ANY)
45 found_vp8 = true; 45 found_vp8 = true;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 ASSERT_EQ(PP_OK, callback.result()); 81 ASSERT_EQ(PP_OK, callback.result());
82 82
83 pp::Size coded_size; 83 pp::Size coded_size;
84 ASSERT_EQ(PP_OK, video_encoder.GetFrameCodedSize(&coded_size)); 84 ASSERT_EQ(PP_OK, video_encoder.GetFrameCodedSize(&coded_size));
85 ASSERT_GE(coded_size.GetArea(), video_size.GetArea()); 85 ASSERT_GE(coded_size.GetArea(), video_size.GetArea());
86 ASSERT_GE(video_encoder.GetFramesRequired(), 1); 86 ASSERT_GE(video_encoder.GetFramesRequired(), 1);
87 } 87 }
88 88
89 PASS(); 89 PASS();
90 } 90 }
OLDNEW
« no previous file with comments | « ppapi/proxy/video_encoder_resource_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698