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.h" | 5 #include "ppapi/tests/test_flash.h" |
6 | 6 |
7 #include "ppapi/c/pp_macros.h" | 7 #include "ppapi/c/pp_macros.h" |
8 #include "ppapi/c/private/ppb_flash.h" | 8 #include "ppapi/c/private/ppb_flash.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" |
(...skipping 14 matching lines...) Expand all Loading... |
25 pp::Module::Get()->GetBrowserInterface(PPB_FLASH_INTERFACE)); | 25 pp::Module::Get()->GetBrowserInterface(PPB_FLASH_INTERFACE)); |
26 return !!flash_interface_; | 26 return !!flash_interface_; |
27 } | 27 } |
28 | 28 |
29 void TestFlash::RunTests(const std::string& filter) { | 29 void TestFlash::RunTests(const std::string& filter) { |
30 RUN_TEST(SetInstanceAlwaysOnTop, filter); | 30 RUN_TEST(SetInstanceAlwaysOnTop, filter); |
31 RUN_TEST(GetProxyForURL, filter); | 31 RUN_TEST(GetProxyForURL, filter); |
32 RUN_TEST(MessageLoop, filter); | 32 RUN_TEST(MessageLoop, filter); |
33 RUN_TEST(GetLocalTimeZoneOffset, filter); | 33 RUN_TEST(GetLocalTimeZoneOffset, filter); |
34 RUN_TEST(GetCommandLineArgs, filter); | 34 RUN_TEST(GetCommandLineArgs, filter); |
| 35 RUN_TEST(GetDeviceID, filter); |
35 } | 36 } |
36 | 37 |
37 std::string TestFlash::TestSetInstanceAlwaysOnTop() { | 38 std::string TestFlash::TestSetInstanceAlwaysOnTop() { |
38 flash_interface_->SetInstanceAlwaysOnTop(instance_->pp_instance(), PP_TRUE); | 39 flash_interface_->SetInstanceAlwaysOnTop(instance_->pp_instance(), PP_TRUE); |
39 flash_interface_->SetInstanceAlwaysOnTop(instance_->pp_instance(), PP_FALSE); | 40 flash_interface_->SetInstanceAlwaysOnTop(instance_->pp_instance(), PP_FALSE); |
40 PASS(); | 41 PASS(); |
41 } | 42 } |
42 | 43 |
43 std::string TestFlash::TestGetProxyForURL() { | 44 std::string TestFlash::TestGetProxyForURL() { |
44 Var result(pp::PASS_REF, | 45 Var result(pp::PASS_REF, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 93 |
93 std::string TestFlash::TestGetCommandLineArgs() { | 94 std::string TestFlash::TestGetCommandLineArgs() { |
94 Var result(pp::PASS_REF, | 95 Var result(pp::PASS_REF, |
95 flash_interface_->GetCommandLineArgs( | 96 flash_interface_->GetCommandLineArgs( |
96 pp::Module::Get()->pp_module())); | 97 pp::Module::Get()->pp_module())); |
97 ASSERT_TRUE(result.is_string()); | 98 ASSERT_TRUE(result.is_string()); |
98 | 99 |
99 PASS(); | 100 PASS(); |
100 } | 101 } |
101 | 102 |
| 103 std::string TestFlash::TestGetDeviceID() { |
| 104 Var result(pp::PASS_REF, |
| 105 flash_interface_->GetDeviceID(instance_->pp_instance())); |
| 106 ASSERT_TRUE(result.is_string()); |
| 107 // TODO(wad) How do I mock up the full flow here? |
| 108 PASS(); |
| 109 } |
| 110 |
| 111 |
102 void TestFlash::QuitMessageLoopTask(int32_t) { | 112 void TestFlash::QuitMessageLoopTask(int32_t) { |
103 flash_interface_->QuitMessageLoop(instance_->pp_instance()); | 113 flash_interface_->QuitMessageLoop(instance_->pp_instance()); |
104 } | 114 } |
OLD | NEW |