OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 flash_interface_->GetProxyForURL(instance_->pp_instance(), | 65 flash_interface_->GetProxyForURL(instance_->pp_instance(), |
66 "this_isnt_an_url")); | 66 "this_isnt_an_url")); |
67 // Should be an error. | 67 // Should be an error. |
68 ASSERT_TRUE(result.is_undefined()); | 68 ASSERT_TRUE(result.is_undefined()); |
69 | 69 |
70 PASS(); | 70 PASS(); |
71 } | 71 } |
72 | 72 |
73 std::string TestFlash::TestMessageLoop() { | 73 std::string TestFlash::TestMessageLoop() { |
74 pp::CompletionCallback callback = | 74 pp::CompletionCallback callback = |
75 callback_factory_.NewRequiredCallback(&TestFlash::QuitMessageLoopTask); | 75 callback_factory_.NewCallback(&TestFlash::QuitMessageLoopTask); |
76 pp::Module::Get()->core()->CallOnMainThread(0, callback); | 76 pp::Module::Get()->core()->CallOnMainThread(0, callback); |
77 flash_interface_->RunMessageLoop(instance_->pp_instance()); | 77 flash_interface_->RunMessageLoop(instance_->pp_instance()); |
78 | 78 |
79 PASS(); | 79 PASS(); |
80 } | 80 } |
81 | 81 |
82 std::string TestFlash::TestGetLocalTimeZoneOffset() { | 82 std::string TestFlash::TestGetLocalTimeZoneOffset() { |
83 double result = flash_interface_->GetLocalTimeZoneOffset( | 83 double result = flash_interface_->GetLocalTimeZoneOffset( |
84 instance_->pp_instance(), 1321491298.0); | 84 instance_->pp_instance(), 1321491298.0); |
85 // The result depends on the local time zone, but +/- 14h from UTC should | 85 // The result depends on the local time zone, but +/- 14h from UTC should |
86 // cover the possibilities. | 86 // cover the possibilities. |
87 ASSERT_TRUE(result >= -14 * 60 * 60); | 87 ASSERT_TRUE(result >= -14 * 60 * 60); |
88 ASSERT_TRUE(result <= 14 * 60 * 60); | 88 ASSERT_TRUE(result <= 14 * 60 * 60); |
89 | 89 |
90 PASS(); | 90 PASS(); |
91 } | 91 } |
92 | 92 |
93 std::string TestFlash::TestGetCommandLineArgs() { | 93 std::string TestFlash::TestGetCommandLineArgs() { |
94 Var result(pp::PASS_REF, | 94 Var result(pp::PASS_REF, |
95 flash_interface_->GetCommandLineArgs( | 95 flash_interface_->GetCommandLineArgs( |
96 pp::Module::Get()->pp_module())); | 96 pp::Module::Get()->pp_module())); |
97 ASSERT_TRUE(result.is_string()); | 97 ASSERT_TRUE(result.is_string()); |
98 | 98 |
99 PASS(); | 99 PASS(); |
100 } | 100 } |
101 | 101 |
102 void TestFlash::QuitMessageLoopTask(int32_t) { | 102 void TestFlash::QuitMessageLoopTask(int32_t) { |
103 flash_interface_->QuitMessageLoop(instance_->pp_instance()); | 103 flash_interface_->QuitMessageLoop(instance_->pp_instance()); |
104 } | 104 } |
OLD | NEW |