OLD | NEW |
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_drm.h" |
12 #include "ppapi/cpp/var.h" | 12 #include "ppapi/cpp/var.h" |
13 #include "ppapi/tests/testing_instance.h" | 13 #include "ppapi/tests/testing_instance.h" |
14 | 14 |
15 REGISTER_TEST_CASE(FlashDeviceID); | 15 REGISTER_TEST_CASE(FlashDRM); |
16 | 16 |
17 using pp::flash::DeviceID; | 17 using pp::flash::DRM; |
18 using pp::Var; | 18 using pp::Var; |
19 | 19 |
20 TestFlashDeviceID::TestFlashDeviceID(TestingInstance* instance) | 20 TestFlashDRM::TestFlashDRM(TestingInstance* instance) |
21 : TestCase(instance), | 21 : TestCase(instance), |
22 PP_ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)) { | 22 PP_ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)) { |
23 } | 23 } |
24 | 24 |
25 void TestFlashDeviceID::RunTests(const std::string& filter) { | 25 void TestFlashDRM::RunTests(const std::string& filter) { |
26 RUN_TEST(GetDeviceID, filter); | 26 RUN_TEST(GetDeviceID, filter); |
27 } | 27 } |
28 | 28 |
29 std::string TestFlashDeviceID::TestGetDeviceID() { | 29 std::string TestFlashDRM::TestGetDeviceID() { |
30 DeviceID device_id(instance_); | 30 DRM drm(instance_); |
31 TestCompletionCallbackWithOutput<Var> output_callback( | 31 TestCompletionCallbackWithOutput<Var> output_callback( |
32 instance_->pp_instance()); | 32 instance_->pp_instance()); |
33 int32_t rv = device_id.GetDeviceID(output_callback.GetCallback()); | 33 int32_t rv = drm.GetDeviceID(output_callback.GetCallback()); |
34 output_callback.WaitForResult(rv); | 34 output_callback.WaitForResult(rv); |
35 ASSERT_TRUE(output_callback.result() == PP_OK); | 35 ASSERT_TRUE(output_callback.result() == PP_OK); |
36 Var result = output_callback.output(); | 36 Var result = output_callback.output(); |
37 ASSERT_TRUE(result.is_string()); | 37 ASSERT_TRUE(result.is_string()); |
38 std::string id = result.AsString(); | 38 std::string id = result.AsString(); |
39 ASSERT_FALSE(id.empty()); | 39 ASSERT_FALSE(id.empty()); |
40 | 40 |
41 PASS(); | 41 PASS(); |
42 } | 42 } |
OLD | NEW |