Bug 565943 - Intermittent timeout in test_bug253481.xul

This commit is contained in:
Ehsan Akhgari 2010-06-03 21:49:53 -04:00
Родитель 4c9c87e1eb
Коммит 5e71d8984d
1 изменённых файлов: 14 добавлений и 8 удалений

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

@ -49,7 +49,7 @@ function testPaste(name, element, expected) {
SimpleTest.waitForExplicitFinish();
addLoadEvent(function() {
SimpleTest.waitForFocus(function() {
setTimeout(function() {
var testString = "\n hello hello \n world\nworld \n";
var expectedResults = {
@ -68,15 +68,21 @@ var expectedResults = {
};
// Put a multi-line string in the clipboard
var clip = Components.classes["@mozilla.org/widget/clipboardhelper;1"]
SimpleTest.waitForClipboard(testString, function() {
var clip = Components.classes["@mozilla.org/widget/clipboardhelper;1"]
.getService(Components.interfaces.nsIClipboardHelper);
clip.copyString(testString);
for (let [item, expected] in Iterator(expectedResults)) {
clip.copyString(testString);
}, function() {
for (let [item, expected] in Iterator(expectedResults)) {
testPaste(item, $(item), expected);
}
}
SimpleTest.finish();
SimpleTest.finish();
}, function() {
ok(false, "Could not copy the string to clipboard, giving up");
SimpleTest.finish();
});
}, 0);
});