зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1288228 part 3: Add regression mochitest for this bug. r=jwatt
MozReview-Commit-ID: DOqPoTLU1MZ --HG-- extra : rebase_source : cae10215a12c362317c5d4751e15724807b8c272
This commit is contained in:
Родитель
9e983e1b6a
Коммит
6456eee1ba
|
@ -86,6 +86,8 @@ skip-if = android_version == '18' # bug 1147994
|
|||
[test_SVGxxxListIndexing.xhtml]
|
||||
[test_SVGxxxList.xhtml]
|
||||
[test_switch.xhtml]
|
||||
[test_tearoff_with_cc.html]
|
||||
support-files = tearoff_with_cc_helper.html
|
||||
[test_text_2.html]
|
||||
[test_text_dirty.html]
|
||||
[test_text.html]
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body onload="go()">
|
||||
<svg id="outerSvg" width="50%" height="50%"
|
||||
style="border: 1px solid black">
|
||||
</svg>
|
||||
<script type="application/javascript">
|
||||
/* I'm not sure what exactly was required to trigger bug 1288228's crash,
|
||||
* but it involved tweaking a length's specified units and cycle-collecting
|
||||
* and reloading (in some combination). So, we'll tweak the units and
|
||||
* cycle-collect a few times, and message the outer page to reload us
|
||||
* after we've made the first tweak.
|
||||
*/
|
||||
const maxTweaks = 5;
|
||||
let remainingTweaks = maxTweaks;
|
||||
|
||||
var savedBaseVal = document.getElementById("outerSvg").width.baseVal;
|
||||
function go() {
|
||||
window.parent.SpecialPowers.DOMWindowUtils.cycleCollect();
|
||||
tweak();
|
||||
}
|
||||
|
||||
function tweak() {
|
||||
console.log("tweaked");
|
||||
savedBaseVal.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX);
|
||||
savedBaseVal.convertToSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PERCENTAGE);
|
||||
if (remainingTweaks == maxTweaks) {
|
||||
window.parent.postMessage("ping", "*"); // only do this on first tweak
|
||||
}
|
||||
if (--remainingTweaks) {
|
||||
setTimeout(tweak, 0);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,48 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1288228
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1288228</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript">
|
||||
/** Test for Bug 1288228 **/
|
||||
/* Note: the crash in bug 1288228 doesn't happen reliably (and only happens
|
||||
* after several reloads). So, we reload the iframe 10 times, and then call
|
||||
* it good if we haven't crashed.
|
||||
*/
|
||||
const maxReloads = 10;
|
||||
let remainingReloads = maxReloads;
|
||||
|
||||
/* The helper-file in the iframe will notify us after it's performed its
|
||||
* potentially-crash-triggering tweak. At that point, we reload the iframe
|
||||
* and wait for it to notify again (or we simply finish, if we've completed
|
||||
* all of the reloads we planned to do).
|
||||
*/
|
||||
window.addEventListener("message", reloadIframe, false);
|
||||
|
||||
function reloadIframe() {
|
||||
if (--remainingReloads == 0) {
|
||||
ok(true, "Didn't crash!");
|
||||
SimpleTest.finish();
|
||||
} else {
|
||||
var frame = document.getElementById("testIframe");
|
||||
frame.setAttribute("src", "");
|
||||
frame.setAttribute("src", "tearoff_with_cc_helper.html");
|
||||
}
|
||||
}
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
</script>
|
||||
</head>
|
||||
<body onload="reloadIframe()">
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1288228">
|
||||
Mozilla Bug 1288228
|
||||
</a>
|
||||
<p id="display">
|
||||
<iframe id="testIframe"></iframe>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче