summaryrefslogtreecommitdiffstats
path: root/native_client_sdk/src/examples/common.js
diff options
context:
space:
mode:
authorsbc@chromium.org <sbc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-04 23:07:56 +0000
committersbc@chromium.org <sbc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-04 23:07:56 +0000
commit0e357c3e1cb8f788ad592ab6760900716f9b018d (patch)
treeead1e55f9b7bf5492e2a362cf8b2fef3e6be8910 /native_client_sdk/src/examples/common.js
parent87b327a7dc81ba041d208e768373064b4c6b9957 (diff)
downloadchromium_src-0e357c3e1cb8f788ad592ab6760900716f9b018d.zip
chromium_src-0e357c3e1cb8f788ad592ab6760900716f9b018d.tar.gz
chromium_src-0e357c3e1cb8f788ad592ab6760900716f9b018d.tar.bz2
[NaCl SDK] Add launcher script for sel_ldr.
This script simplifies the process of running .nexe files under the sel_ldr in the SDK. It uses sensible defaults for things like the IRT location and library paths. It can also determine which version of the sel_ldr to run according to that architecture of the .nexe. Make common.mk aware of SEL_LDR=1 environment variable. In this case SEL_LDR is defined (so code an detect it) and 'make run' will run the sel_ldr rather than chrome. Run sel_ldr based tests as part of test_sdk. Currently this is only simple_hello_world and nacl_io_test. Distinguish between crashes and program exiting normally in common.js (we can't distinguish if exitcode is -1 right now). Review URL: https://chromiumcodereview.appspot.com/18176014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210236 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk/src/examples/common.js')
-rw-r--r--native_client_sdk/src/examples/common.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/native_client_sdk/src/examples/common.js b/native_client_sdk/src/examples/common.js
index e1bc06a..51a0164 100644
--- a/native_client_sdk/src/examples/common.js
+++ b/native_client_sdk/src/examples/common.js
@@ -96,7 +96,11 @@ var common = (function () {
* This event listener is registered in attachDefaultListeners above.
*/
function handleCrash(event) {
- updateStatus('CRASHED')
+ if (common.naclModule.exitStatus == -1) {
+ updateStatus('CRASHED')
+ } else {
+ updateStatus('EXITED [' + common.naclModule.exitStatus + ']')
+ }
if (typeof window.handleCrash !== 'undefined') {
window.handleCrash(common.naclModule.lastError);
}
@@ -109,7 +113,7 @@ var common = (function () {
*/
function moduleDidLoad() {
common.naclModule = document.getElementById('nacl_module');
- updateStatus('SUCCESS');
+ updateStatus('RUNNING');
if (typeof window.moduleDidLoad !== 'undefined') {
window.moduleDidLoad();