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

Unified Diff: ppapi/tests/test_flash_drm.cc

Issue 15491006: Rename PPB_Flash_DeviceID interface to PPB_Flash_DRM (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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_flash_drm.h ('k') | ppapi/thunk/interfaces_ppb_private_flash.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_flash_drm.cc
diff --git a/ppapi/tests/test_flash_device_id.cc b/ppapi/tests/test_flash_drm.cc
similarity index 30%
rename from ppapi/tests/test_flash_device_id.cc
rename to ppapi/tests/test_flash_drm.cc
index a4e20b28e78a0794cec4695f6e9e46950503af7a..94b6f26bf0870597164cf1ac0ff1396ed8905e52 100644
--- a/ppapi/tests/test_flash_device_id.cc
+++ b/ppapi/tests/test_flash_drm.cc
@@ -2,41 +2,60 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ppapi/tests/test_flash_device_id.h"
+#include "ppapi/tests/test_flash_drm.h"
#include "ppapi/c/pp_macros.h"
-#include "ppapi/c/private/ppb_flash_device_id.h"
+#include "ppapi/c/private/ppb_flash_drm.h"
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/private/flash_device_id.h"
+#include "ppapi/cpp/private/flash_drm.h"
#include "ppapi/cpp/var.h"
#include "ppapi/tests/testing_instance.h"
-REGISTER_TEST_CASE(FlashDeviceID);
+REGISTER_TEST_CASE(FlashDRM);
using pp::flash::DeviceID;
+using pp::flash::DRM;
using pp::Var;
-TestFlashDeviceID::TestFlashDeviceID(TestingInstance* instance)
+TestFlashDRM::TestFlashDRM(TestingInstance* instance)
: TestCase(instance),
PP_ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)) {
}
-void TestFlashDeviceID::RunTests(const std::string& filter) {
+void TestFlashDRM::RunTests(const std::string& filter) {
RUN_TEST(GetDeviceID, filter);
}
-std::string TestFlashDeviceID::TestGetDeviceID() {
- DeviceID device_id(instance_);
- TestCompletionCallbackWithOutput<Var> output_callback(
- instance_->pp_instance());
- int32_t rv = device_id.GetDeviceID(output_callback.GetCallback());
- output_callback.WaitForResult(rv);
- ASSERT_TRUE(output_callback.result() == PP_OK);
- Var result = output_callback.output();
- ASSERT_TRUE(result.is_string());
- std::string id = result.AsString();
- ASSERT_FALSE(id.empty());
+std::string TestFlashDRM::TestGetDeviceID() {
+ // Test the old C++ wrapper.
+ // TODO(raymes): Remove this once Flash switches APIs.
+ {
+ DeviceID device_id(instance_);
+ TestCompletionCallbackWithOutput<Var> output_callback(
+ instance_->pp_instance());
+ int32_t rv = device_id.GetDeviceID(output_callback.GetCallback());
+ output_callback.WaitForResult(rv);
+ ASSERT_TRUE(output_callback.result() == PP_OK);
+ Var result = output_callback.output();
+ ASSERT_TRUE(result.is_string());
+ std::string id = result.AsString();
+ ASSERT_FALSE(id.empty());
+ }
+
+ {
+ DRM drm(instance_);
+ TestCompletionCallbackWithOutput<Var> output_callback(
+ instance_->pp_instance());
+ int32_t rv = drm.GetDeviceID(output_callback.GetCallback());
+ output_callback.WaitForResult(rv);
+ ASSERT_TRUE(output_callback.result() == PP_OK);
+ Var result = output_callback.output();
+ ASSERT_TRUE(result.is_string());
+ std::string id = result.AsString();
+ ASSERT_FALSE(id.empty());
+ }
PASS();
}
« no previous file with comments | « ppapi/tests/test_flash_drm.h ('k') | ppapi/thunk/interfaces_ppb_private_flash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698