Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Side by Side Diff: ppapi/native_client/tests/ppapi_test_example/ppapi_test_example.cc

Issue 7740013: Cloning a bunch of stuff from the native_client repository at r6528 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698