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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_flash_device_id.h" 5 #include "ppapi/tests/test_flash_drm.h"
6 6
7 #include "ppapi/c/pp_macros.h" 7 #include "ppapi/c/pp_macros.h"
8 #include "ppapi/c/private/ppb_flash_device_id.h" 8 #include "ppapi/c/private/ppb_flash_drm.h"
9 #include "ppapi/cpp/instance.h" 9 #include "ppapi/cpp/instance.h"
10 #include "ppapi/cpp/module.h" 10 #include "ppapi/cpp/module.h"
11 #include "ppapi/cpp/private/flash_device_id.h" 11 #include "ppapi/cpp/private/flash_device_id.h"
12 #include "ppapi/cpp/private/flash_drm.h"
12 #include "ppapi/cpp/var.h" 13 #include "ppapi/cpp/var.h"
13 #include "ppapi/tests/testing_instance.h" 14 #include "ppapi/tests/testing_instance.h"
14 15
15 REGISTER_TEST_CASE(FlashDeviceID); 16 REGISTER_TEST_CASE(FlashDRM);
16 17
17 using pp::flash::DeviceID; 18 using pp::flash::DeviceID;
19 using pp::flash::DRM;
18 using pp::Var; 20 using pp::Var;
19 21
20 TestFlashDeviceID::TestFlashDeviceID(TestingInstance* instance) 22 TestFlashDRM::TestFlashDRM(TestingInstance* instance)
21 : TestCase(instance), 23 : TestCase(instance),
22 PP_ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)) { 24 PP_ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)) {
23 } 25 }
24 26
25 void TestFlashDeviceID::RunTests(const std::string& filter) { 27 void TestFlashDRM::RunTests(const std::string& filter) {
26 RUN_TEST(GetDeviceID, filter); 28 RUN_TEST(GetDeviceID, filter);
27 } 29 }
28 30
29 std::string TestFlashDeviceID::TestGetDeviceID() { 31 std::string TestFlashDRM::TestGetDeviceID() {
30 DeviceID device_id(instance_); 32 // Test the old C++ wrapper.
31 TestCompletionCallbackWithOutput<Var> output_callback( 33 // TODO(raymes): Remove this once Flash switches APIs.
32 instance_->pp_instance()); 34 {
33 int32_t rv = device_id.GetDeviceID(output_callback.GetCallback()); 35 DeviceID device_id(instance_);
34 output_callback.WaitForResult(rv); 36 TestCompletionCallbackWithOutput<Var> output_callback(
35 ASSERT_TRUE(output_callback.result() == PP_OK); 37 instance_->pp_instance());
36 Var result = output_callback.output(); 38 int32_t rv = device_id.GetDeviceID(output_callback.GetCallback());
37 ASSERT_TRUE(result.is_string()); 39 output_callback.WaitForResult(rv);
38 std::string id = result.AsString(); 40 ASSERT_TRUE(output_callback.result() == PP_OK);
39 ASSERT_FALSE(id.empty()); 41 Var result = output_callback.output();
42 ASSERT_TRUE(result.is_string());
43 std::string id = result.AsString();
44 ASSERT_FALSE(id.empty());
45 }
46
47 {
48 DRM drm(instance_);
49 TestCompletionCallbackWithOutput<Var> output_callback(
50 instance_->pp_instance());
51 int32_t rv = drm.GetDeviceID(output_callback.GetCallback());
52 output_callback.WaitForResult(rv);
53 ASSERT_TRUE(output_callback.result() == PP_OK);
54 Var result = output_callback.output();
55 ASSERT_TRUE(result.is_string());
56 std::string id = result.AsString();
57 ASSERT_FALSE(id.empty());
58 }
40 59
41 PASS(); 60 PASS();
42 } 61 }
OLDNEW
« 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