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:
Josh Matthews 2016-05-31 17:14:52 -04:00
parent d4a5b45242
commit 99e436eb05
6 changed files with 33 additions and 0 deletions

View file

@ -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 {

View file

@ -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();
};

View file

@ -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,

View file

@ -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",

View file

@ -0,0 +1,4 @@
[sigsegv.html]
type: testharness
prefs: [dom.testbinding.enabled:true,dom.testable_crash.enabled:true]
expected: CRASH

View 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>