mirror of
https://github.com/phpv8/v8js.git
synced 2024-11-09 15:18:41 +00:00
Add test showing that time limits can be prolonged
This commit is contained in:
parent
c17208c9c0
commit
e85b095282
29
tests/set_time_limit_004.phpt
Normal file
29
tests/set_time_limit_004.phpt
Normal file
@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
Test V8::setTimeLimit() : Time limit can be prolonged
|
||||
--SKIPIF--
|
||||
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$JS = <<< EOT
|
||||
var text = "abcdefghijklmnopqrstuvwyxz0123456789";
|
||||
for (var j = 0; j < 100; ++j) {
|
||||
PHP.prolongTimeLimit();
|
||||
for (var i = 0; i < 3000; ++i) {
|
||||
var encoded = encodeURI(text);
|
||||
}
|
||||
}
|
||||
EOT;
|
||||
|
||||
$v8 = new V8Js();
|
||||
$v8->setTimeLimit(25);
|
||||
|
||||
$v8->prolongTimeLimit = function() use ($v8) {
|
||||
$v8->setTimeLimit(25);
|
||||
};
|
||||
|
||||
$v8->executeString($JS);
|
||||
?>
|
||||
===EOF===
|
||||
--EXPECTF--
|
||||
===EOF===
|
Loading…
Reference in New Issue
Block a user