mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Add a manual test for panicking while JS stack frames exist.
This commit is contained in:
parent
a0a62ed3fd
commit
fbf6c7fc2b
3 changed files with 20 additions and 0 deletions
|
@ -580,6 +580,8 @@ impl TestBindingMethods for TestBinding {
|
||||||
ptr::write_volatile(p, 0xbaadc0de);
|
ptr::write_volatile(p, 0xbaadc0de);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn Panic(&self) { panic!("explicit panic from script") }
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TestBinding {
|
impl TestBinding {
|
||||||
|
|
|
@ -455,6 +455,8 @@ interface TestBinding {
|
||||||
static void funcControlledStaticMethodEnabled();
|
static void funcControlledStaticMethodEnabled();
|
||||||
[Func="TestBinding::condition_satisfied"]
|
[Func="TestBinding::condition_satisfied"]
|
||||||
const unsigned short funcControlledConstEnabled = 0;
|
const unsigned short funcControlledConstEnabled = 0;
|
||||||
|
|
||||||
|
void panic();
|
||||||
};
|
};
|
||||||
|
|
||||||
partial interface TestBinding {
|
partial interface TestBinding {
|
||||||
|
|
16
tests/html/panic.html
Normal file
16
tests/html/panic.html
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<!-- To exercise these tests, set the `dom.testbinding.enabled` to true.
|
||||||
|
It is expected that the browser will not abort due to failed JS engine assertions. -->
|
||||||
|
|
||||||
|
<!-- Straightforward test - invoking a panic from a toplevel script execution -->
|
||||||
|
<script>
|
||||||
|
(new TestBinding()).panic();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- invoking a panic from an event handler which is invoked by native code -->
|
||||||
|
<!--<iframe src="data:,hi there" onload="(new TestBinding()).panic()"></iframe>-->
|
||||||
|
|
||||||
|
<!-- invoking a panic from an event handler which is invoked by script -->
|
||||||
|
<!--<div onclick="(new TestBinding()).panic()"></div>
|
||||||
|
<script>
|
||||||
|
document.querySelector('div').click();
|
||||||
|
</script>-->
|
Loading…
Add table
Add a link
Reference in a new issue