mirror of
https://github.com/servo/servo.git
synced 2025-06-06 00:25:37 +00:00
Add a test that forces a crash. This makes it easy to manually check the output of a segfault with a complicated backtrace; the actual automation doesn't help us except to verify that the crash continues to happen as excepted.
This commit is contained in:
parent
d4a5b45242
commit
99e436eb05
6 changed files with 33 additions and 0 deletions
|
@ -571,6 +571,15 @@ impl TestBindingMethods for TestBinding {
|
|||
fn FuncControlledAttributeEnabled(&self) -> bool { false }
|
||||
fn FuncControlledMethodDisabled(&self) {}
|
||||
fn FuncControlledMethodEnabled(&self) {}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
fn CrashHard(&self) {
|
||||
static READ_ONLY_VALUE: i32 = 0;
|
||||
unsafe {
|
||||
let p: *mut u32 = &READ_ONLY_VALUE as *const _ as *mut _;
|
||||
ptr::write_volatile(p, 0xbaadc0de);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl TestBinding {
|
||||
|
|
|
@ -456,3 +456,8 @@ interface TestBinding {
|
|||
[Func="TestBinding::condition_satisfied"]
|
||||
const unsigned short funcControlledConstEnabled = 0;
|
||||
};
|
||||
|
||||
partial interface TestBinding {
|
||||
[Pref="dom.testable_crash.enabled"]
|
||||
void crashHard();
|
||||
};
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
"dom.mouseevent.which.enabled": false,
|
||||
"dom.mozbrowser.enabled": false,
|
||||
"dom.serviceworker.timeout_seconds": 60,
|
||||
"dom.testable_crash.enabled": false,
|
||||
"dom.testbinding.enabled": false,
|
||||
"gfx.webrender.enabled": false,
|
||||
"js.baseline.enabled": true,
|
||||
|
|
|
@ -6946,6 +6946,12 @@
|
|||
"url": "/_mozilla/mozilla/service-workers/service-worker-registration.html"
|
||||
}
|
||||
],
|
||||
"mozilla/sigsegv.html": [
|
||||
{
|
||||
"path": "mozilla/sigsegv.html",
|
||||
"url": "/_mozilla/mozilla/sigsegv.html"
|
||||
}
|
||||
],
|
||||
"mozilla/storage.html": [
|
||||
{
|
||||
"path": "mozilla/storage.html",
|
||||
|
|
4
tests/wpt/mozilla/meta/mozilla/sigsegv.html.ini
Normal file
4
tests/wpt/mozilla/meta/mozilla/sigsegv.html.ini
Normal file
|
@ -0,0 +1,4 @@
|
|||
[sigsegv.html]
|
||||
type: testharness
|
||||
prefs: [dom.testbinding.enabled:true,dom.testable_crash.enabled:true]
|
||||
expected: CRASH
|
8
tests/wpt/mozilla/tests/mozilla/sigsegv.html
Normal file
8
tests/wpt/mozilla/tests/mozilla/sigsegv.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<title></title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
(new TestBinding()).crashHard();
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue