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