Bug 937006 - No crash when IDRequest fails to get filename and line number, r=bholley

This commit is contained in:
Andrea Marchesini 2013-11-23 19:25:18 +00:00
Родитель c198d5a1f4
Коммит d5f5c6e692
3 изменённых файлов: 39 добавлений и 1 удалений

Просмотреть файл

@ -278,7 +278,7 @@ IDBRequest::CaptureCaller()
const char* filename = nullptr;
uint32_t lineNo = 0;
if (!nsJSUtils::GetCallingLocation(cx, &filename, &lineNo)) {
MOZ_CRASH("Failed to get caller.");
NS_WARNING("Failed to get caller.");
return;
}

Просмотреть файл

@ -112,3 +112,4 @@ support-files =
[test_webapp_clearBrowserData_inproc_inproc.html]
[test_webapp_clearBrowserData_inproc_oop.html]
[test_webapp_clearBrowserData_oop_inproc.html]
[test_bug937006.html]

Просмотреть файл

@ -0,0 +1,37 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<html>
<head>
<title>Bug 937006 - "Hit MOZ_CRASH(Failed to get caller.)" using setTimeout on IndexedDB call</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="runTest();">
<script type="text/javascript;version=1.7">
function runTest() {
if (!SpecialPowers.isMainProcess()) {
window.runTest = function() {
todo(false, "Figure out this test for child processes!");
SimpleTest.finish();
return;
}
}
// doing this IDBRequest should not be able to retrieve the filename and
// line number.
//setTimeout(indexedDB.deleteDatabase.bind(indexedDB), 0, 'x');
setTimeout(function() {
ok(true, "Still alive");
SimpleTest.finish();
}, 10);
}
</script>
</body>
</html>