OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2014 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 /* globals TEST_F, chrometest, DevEnvTest */ | 7 /* globals TEST_F, chrometest, DevEnvTest */ |
8 | 8 |
9 'use strict'; | 9 'use strict'; |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 return Promise.resolve().then(function() { | 43 return Promise.resolve().then(function() { |
44 return self.writeFile( | 44 return self.writeFile( |
45 '/home/user/bar.sh', | 45 '/home/user/bar.sh', |
46 '#!/bin/sh\necho "resolute urgency"\n'); | 46 '#!/bin/sh\necho "resolute urgency"\n'); |
47 }).then(function() { | 47 }).then(function() { |
48 return self.checkCommand( | 48 return self.checkCommand( |
49 '/home/user/bar.sh', 0, 'resolute urgency\n'); | 49 '/home/user/bar.sh', 0, 'resolute urgency\n'); |
50 }); | 50 }); |
51 }); | 51 }); |
52 | 52 |
| 53 // Confirm that we can run a command, sleep, and kill it. |
| 54 TEST_F(DevEnvTest, 'testSleepKill', function() { |
| 55 var self = this; |
| 56 var pid; |
| 57 return Promise.resolve().then(function() { |
| 58 return self.spawnCommand('bash -c "while [[ 1 == 1 ]]; do echo -n; done"'); |
| 59 }).then(function(msg) { |
| 60 pid = msg.pid; |
| 61 return chrometest.sleep(300); |
| 62 }).then(function(msg) { |
| 63 self.sigint(); |
| 64 return self.waitCommand(pid); |
| 65 }).then(function(msg) { |
| 66 ASSERT_EQ(128 + 9, msg.status, 'Expect kill status'); |
| 67 }); |
| 68 }); |
| 69 |
53 // Run a NaCl executable to make sure syscalls are working. | 70 // Run a NaCl executable to make sure syscalls are working. |
54 TEST_F(DevEnvTest, 'testCTests', function() { | 71 TEST_F(DevEnvTest, 'testCTests', function() { |
55 var self = this; | 72 var self = this; |
56 return Promise.resolve().then(function() { | 73 return Promise.resolve().then(function() { |
57 return self.checkCommand('geturl ' + | 74 return self.checkCommand('geturl ' + |
58 chrometest.harnessURL('devenv_small_test.zip') + | 75 chrometest.harnessURL('devenv_small_test.zip') + |
59 ' devenv_small_test.zip', 0); | 76 ' devenv_small_test.zip', 0); |
60 }).then(function() { | 77 }).then(function() { |
61 return self.checkCommand('unzip devenv_small_test.zip', 0); | 78 return self.checkCommand('unzip devenv_small_test.zip', 0); |
62 }).then(function() { | 79 }).then(function() { |
63 return self.checkCommand( | 80 return self.checkCommand( |
64 'LD_LIBRARY_PATH=${PWD}/${PACKAGE_LIB_DIR}:$LD_LIBRARY_PATH ' + | 81 'LD_LIBRARY_PATH=${PWD}/${PACKAGE_LIB_DIR}:$LD_LIBRARY_PATH ' + |
65 './devenv_small_test_${NACL_BOOT_ARCH}', 0); | 82 './devenv_small_test_${NACL_BOOT_ARCH}', 0); |
66 }); | 83 }); |
67 }); | 84 }); |
OLD | NEW |