OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ppapi/tests/test_video_encoder.h" |
| 6 |
| 7 #include "ppapi/c/pp_codecs.h" |
| 8 #include "ppapi/c/pp_errors.h" |
| 9 #include "ppapi/cpp/video_encoder.h" |
| 10 #include "ppapi/tests/testing_instance.h" |
| 11 |
| 12 REGISTER_TEST_CASE(VideoEncoder); |
| 13 |
| 14 bool TestVideoEncoder::Init() { |
| 15 video_encoder_interface_ = static_cast<const PPB_VideoEncoder_0_1*>( |
| 16 pp::Module::Get()->GetBrowserInterface(PPB_VIDEOENCODER_INTERFACE_0_1)); |
| 17 return video_encoder_interface_ && CheckTestingInterface(); |
| 18 } |
| 19 |
| 20 void TestVideoEncoder::RunTests(const std::string& filter) { |
| 21 RUN_CALLBACK_TEST(TestVideoEncoder, Create, filter); |
| 22 } |
| 23 |
| 24 std::string TestVideoEncoder::TestCreate() { |
| 25 // Test that we get results for supported formats. |
| 26 { |
| 27 pp::VideoEncoder video_encoder(instance_); |
| 28 ASSERT_FALSE(video_encoder.is_null()); |
| 29 |
| 30 TestCompletionCallbackWithOutput<std::vector<PP_VideoProfileDescription> > |
| 31 callback(instance_->pp_instance(), false); |
| 32 callback.WaitForResult( |
| 33 video_encoder.GetSupportedProfiles(callback.GetCallback())); |
| 34 |
| 35 ASSERT_GE(callback.output().size(), 0U); |
| 36 } |
| 37 // TODO(llandwerlin): add more tests once software video encode is |
| 38 // available. |
| 39 |
| 40 PASS(); |
| 41 } |
OLD | NEW |