1 // Copyright 2013 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.
5 // Test that we kill the nexe on a CHECK and handle it gracefully on the
6 // trusted side when untrusted code makes unsupported PPAPI calls
7 // on other than the main thread.
11 #include "native_client/src/shared/platform/nacl_check.h"
12 #include "ppapi/c/ppb_url_request_info.h"
13 #include "ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h"
14 #include "ppapi/native_client/tests/ppapi_test_lib/test_interface.h"
18 void* CrashOffMainThreadFunction(void* thread_arg
) {
19 printf("--- CrashPPAPIOffMainThreadFunction\n");
25 // This will crash PPP_Messaging::HandleMessage.
26 void CrashPPAPIOffMainThread() {
27 printf("--- CrashPPAPIOffMainThread\n");
30 pthread_create(&tid
, NULL
/*attr*/, CrashOffMainThreadFunction
, NULL
);
31 pthread_join(tid
, &thread_result
); // Wait for the thread to crash.
37 RegisterTest("CrashPPAPIOffMainThread", CrashPPAPIOffMainThread
);
40 void SetupPluginInterfaces() {