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

Unified Diff: ppapi/tests/test_video_encoder.cc

Issue 905023005: Pepper: PPB_VideoEncoder implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unittest on win_chromium_x64_rel_ng Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/tests/test_video_encoder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_video_encoder.cc
diff --git a/ppapi/tests/test_video_encoder.cc b/ppapi/tests/test_video_encoder.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4737ed0fc72b037545ee7dbe121ff86bbd7ae39f
--- /dev/null
+++ b/ppapi/tests/test_video_encoder.cc
@@ -0,0 +1,41 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ppapi/tests/test_video_encoder.h"
+
+#include "ppapi/c/pp_codecs.h"
+#include "ppapi/c/pp_errors.h"
+#include "ppapi/cpp/video_encoder.h"
+#include "ppapi/tests/testing_instance.h"
+
+REGISTER_TEST_CASE(VideoEncoder);
+
+bool TestVideoEncoder::Init() {
+ video_encoder_interface_ = static_cast<const PPB_VideoEncoder_0_1*>(
+ pp::Module::Get()->GetBrowserInterface(PPB_VIDEOENCODER_INTERFACE_0_1));
+ return video_encoder_interface_ && CheckTestingInterface();
+}
+
+void TestVideoEncoder::RunTests(const std::string& filter) {
+ RUN_CALLBACK_TEST(TestVideoEncoder, Create, filter);
+}
+
+std::string TestVideoEncoder::TestCreate() {
+ // Test that we get results for supported formats.
+ {
+ pp::VideoEncoder video_encoder(instance_);
+ ASSERT_FALSE(video_encoder.is_null());
+
+ TestCompletionCallbackWithOutput<std::vector<PP_VideoProfileDescription> >
+ callback(instance_->pp_instance(), false);
+ callback.WaitForResult(
+ video_encoder.GetSupportedProfiles(callback.GetCallback()));
+
+ ASSERT_GE(callback.output().size(), 0U);
+ }
+ // TODO(llandwerlin): add more tests once software video encode is
+ // available.
+
+ PASS();
+}
« no previous file with comments | « ppapi/tests/test_video_encoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698