| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 os.system("ls", ["/bin/sleep"]); | 122 os.system("ls", ["/bin/sleep"]); |
| 123 } catch (e) { | 123 } catch (e) { |
| 124 have_sleep = false; | 124 have_sleep = false; |
| 125 } | 125 } |
| 126 try { | 126 try { |
| 127 os.system("ls", ["/bin/echo"]); | 127 os.system("ls", ["/bin/echo"]); |
| 128 } catch (e) { | 128 } catch (e) { |
| 129 have_echo = false; | 129 have_echo = false; |
| 130 } | 130 } |
| 131 if (have_sleep) { | 131 if (have_sleep) { |
| 132 assertThrows("os.system('sleep', ['2000'], 20);", "sleep 1"); | 132 assertThrows("os.system('sleep', ['2000'], 200);", "sleep 1"); |
| 133 | 133 |
| 134 // Check we time out with total time. | 134 // Check we time out with total time. |
| 135 assertThrows("os.system('sleep', ['2000'], -1, 20);", "sleep 2"); | 135 assertThrows("os.system('sleep', ['2000'], -1, 200);", "sleep 2"); |
| 136 | 136 |
| 137 // Check that -1 means no timeout. | 137 // Check that -1 means no timeout. |
| 138 os.system('sleep', ['0.1'], -1, -1); | 138 os.system('sleep', ['1'], -1, -1); |
| 139 | 139 |
| 140 } | 140 } |
| 141 | 141 |
| 142 // Check that we don't fill up the process table with zombies. | 142 // Check that we don't fill up the process table with zombies. |
| 143 // Disabled because it's too slow. | 143 // Disabled because it's too slow. |
| 144 if (have_echo) { | 144 if (have_echo) { |
| 145 //for (var i = 0; i < 65536; i++) { | 145 //for (var i = 0; i < 65536; i++) { |
| 146 assertEquals("baz\n", os.system("echo", ["baz"])); | 146 assertEquals("baz\n", os.system("echo", ["baz"])); |
| 147 //} | 147 //} |
| 148 } | 148 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 179 str_error("os.mkdirp(e);"); | 179 str_error("os.mkdirp(e);"); |
| 180 str_error("os.setenv(e, 'goo');"); | 180 str_error("os.setenv(e, 'goo');"); |
| 181 str_error("os.setenv('goo', e);"); | 181 str_error("os.setenv('goo', e);"); |
| 182 str_error("os.chdir(e);"); | 182 str_error("os.chdir(e);"); |
| 183 str_error("os.rmdir(e);"); | 183 str_error("os.rmdir(e);"); |
| 184 | 184 |
| 185 } finally { | 185 } finally { |
| 186 os.system("rm", ["-r", TEST_DIR]); | 186 os.system("rm", ["-r", TEST_DIR]); |
| 187 } | 187 } |
| 188 } | 188 } |
| OLD | NEW |