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

Side by Side Diff: trunk/src/chrome/test/data/nacl/irt_exception/irt_exception_test.cc

Issue 265433002: Revert 266968 "NonSFI NaCl: Plumb Exception IRT enough for break..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | trunk/src/chrome/test/data/nacl/irt_exception/irt_exception_test.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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.
4
5 #include <setjmp.h>
6 #include <stdio.h>
7
8 #include "native_client/src/include/nacl/nacl_exception.h"
9 #include "ppapi/native_client/tests/ppapi_test_lib/test_interface.h"
10
11 namespace {
12
13 jmp_buf g_jmp_buf;
14
15 void MyNaClExceptionHandler(struct NaClExceptionContext* context) {
16 printf("--- MyNaClExceptionHandler\n");
17 longjmp(g_jmp_buf, 1);
18 }
19
20 void CrashViaSignalHandler() {
21 printf("--- CrashViaSignalHandler\n");
22
23 int retval = nacl_exception_set_handler(MyNaClExceptionHandler);
24 if (retval != 0) {
25 printf("Unexpected return value from nacl_exception_set_handler: %d\n",
26 retval);
27 TEST_FAILED;
28 return;
29 }
30
31 if (setjmp(g_jmp_buf)) {
32 printf("Returned via longjmp\n");
33 TEST_PASSED;
34 return;
35 }
36 printf("Going to crash\n");
37 __builtin_trap();
38 }
39
40 } // namespace
41
42 void SetupTests() {
43 RegisterTest("CrashViaSignalHandler", CrashViaSignalHandler);
44 }
45
46 void SetupPluginInterfaces() {}
OLDNEW
« no previous file with comments | « no previous file | trunk/src/chrome/test/data/nacl/irt_exception/irt_exception_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698