Bug 607729 - Reenable test, a=testfix

This commit is contained in:
Ben Turner 2010-11-11 10:57:07 -08:00
Родитель 23a6a74a23
Коммит 8f4b6434fa
2 изменённых файлов: 15 добавлений и 13 удалений

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

@ -54,6 +54,7 @@ TEST_FILES = \
test_create_objectStore.html \
test_cursors.html \
test_cursor_update_updates_indexes.html \
test_event_propagation.html \
test_event_source.html \
test_getAll.html \
test_global_data.html \
@ -83,10 +84,6 @@ TEST_FILES = \
test_writer_starvation.html \
$(NULL)
# disabled for the moment
# test_event_propagation.html \
ifeq (browser,$(MOZ_BUILD_APP))
BROWSER_TEST_FILES = \
browserHelpers.js \

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

@ -26,9 +26,14 @@
}
function finishTest() {
setTimeout(testGenerator.close, 0);
ok(windowErrorCount == 1, "Good window.onerror count");
window.parent.postMessage("SimpleTest.finish();", "*");
// Let window.onerror have a chance to fire
setTimeout(function() {
setTimeout(function() {
testGenerator.close();
ok(windowErrorCount == 1, "Good window.onerror count");
window.parent.postMessage("SimpleTest.finish();", "*");
}, 0);
}, 0);
}
const eventChain = [
@ -39,6 +44,7 @@
let captureCount = 0;
let bubbleCount = 0;
let atTargetCount = 0;
let windowErrorCount = 0;
window.onerror = function(event) {
@ -53,6 +59,7 @@
let constructor;
if (event.eventPhase == event.AT_TARGET) {
atTargetCount++;
constructor = eventChain[0];
}
else if (event.eventPhase == event.CAPTURING_PHASE) {
@ -70,13 +77,11 @@
if (bubbleCount == eventChain.length - 1) {
ok(bubbleCount == captureCount,
"Got same number of calls for both phases");
ok(atTargetCount == 1, "Got one atTarget event");
if (!windowErrorCount) {
captureCount = bubbleCount = 0;
}
else {
// Let window.onerror have a chance to fire
setTimeout(finishTest, 0);
captureCount = bubbleCount = atTargetCount = 0;
if (windowErrorCount) {
finishTest();
}
}
}