mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 957213 - Fix intermittent test_bug944397.html. r=fabrice
This commit is contained in:
parent
e2c1e9671e
commit
6aea75ae46
@ -11,7 +11,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=944397
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=944397">Mozilla Bug 944397</a>
|
||||
<input type="text" />
|
||||
<p id="display"></p>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="application/javascript;version=1.7">
|
||||
@ -26,6 +25,14 @@ function appFrameScript() {
|
||||
input.oninput = function() {
|
||||
sendAsyncMessage('test:InputMethod:oninput', {});
|
||||
};
|
||||
|
||||
/*
|
||||
* Bug 957213. Sometimes we need to refocus the input field to avoid
|
||||
* intermittent test failure.
|
||||
*/
|
||||
content.setInterval(function() {
|
||||
input.focus();
|
||||
}, 500);
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
@ -40,8 +47,12 @@ function runTest() {
|
||||
let mm = SpecialPowers.getBrowserFrameMessageManager(app);
|
||||
mm.loadFrameScript('data:,(' + appFrameScript.toString() + ')();', false);
|
||||
mm.addMessageListener("test:InputMethod:oninput", function() {
|
||||
if (!timeoutId) {
|
||||
return;
|
||||
}
|
||||
ok(true, 'Keyboard input was received.');
|
||||
clearTimeout(timeoutId);
|
||||
timeoutId = null;
|
||||
inputmethod_cleanup();
|
||||
});
|
||||
});
|
||||
@ -80,7 +91,7 @@ function runTest() {
|
||||
timeoutId = setTimeout(function() {
|
||||
inputmethod_cleanup();
|
||||
ok(false, 'Failed to generate keyboard input.');
|
||||
}, 60000);
|
||||
}, 20000);
|
||||
};
|
||||
|
||||
req.onerror = function() {
|
||||
@ -89,6 +100,7 @@ function runTest() {
|
||||
};
|
||||
|
||||
// Loads the input method app to the browser frame after a delay.
|
||||
SpecialPowers.DOMWindowUtils.focus(app);
|
||||
setTimeout(function() {
|
||||
keyboard.src = imeUrl;
|
||||
}, 100);
|
||||
|
Loading…
Reference in New Issue
Block a user