OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Native Client 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 <string.h> |
| 6 |
| 7 #include "native_client/src/include/nacl_macros.h" |
| 8 #include "native_client/src/shared/platform/nacl_check.h" |
| 9 #include "native_client/tests/ppapi_test_lib/get_browser_interface.h" |
| 10 #include "native_client/tests/ppapi_test_lib/test_interface.h" |
| 11 |
| 12 #include "ppapi/c/pp_bool.h" |
| 13 #include "ppapi/c/pp_errors.h" |
| 14 #include "ppapi/c/ppb_core.h" |
| 15 |
| 16 namespace { |
| 17 |
| 18 void Callback(void* /*data*/, int32_t /*result*/) { |
| 19 printf("--- Callback\n"); |
| 20 } |
| 21 |
| 22 void TestSimple() { |
| 23 printf("--- TestSimple\n"); |
| 24 EXPECT(pp_instance() != kInvalidInstance); |
| 25 EXPECT(pp_module() != kInvalidModule); |
| 26 TEST_PASSED; |
| 27 } |
| 28 |
| 29 void TestCallback() { |
| 30 printf("--- TestCallback\n"); |
| 31 PP_CompletionCallback callback = MakeTestableCompletionCallback( |
| 32 "Callback", Callback, NULL /*user_data*/); |
| 33 PPBCore()->CallOnMainThread(10, callback, PP_OK); |
| 34 TEST_PASSED; |
| 35 } |
| 36 |
| 37 } // namespace |
| 38 |
| 39 void SetupTests() { |
| 40 RegisterTest("TestSimple", TestSimple); |
| 41 RegisterTest("TestCallback", TestCallback); |
| 42 } |
| 43 |
| 44 void SetupPluginInterfaces() { |
| 45 // TODO(polina): add an example of PPP interface testing |
| 46 } |
OLD | NEW |