Bug 766462: Make some tests wait for all their events. r=me

--HG--
extra : rebase_source : a20e771e60c6855a4bad5067c74bada689d7648a
This commit is contained in:
Kyle Huey 2012-06-23 07:02:52 -07:00
parent 1254281afd
commit 3045b78591
2 changed files with 14 additions and 4 deletions

View File

@ -8,7 +8,6 @@ var testGenerator = testSteps();
function testSteps()
{
const name = this.window ? window.location.pathname : "Splendid Test";
const description = "My Test Database";
const objectStoreInfo = [
{ name: "a", options: { keyPath: "id", autoIncrement: true } },
{ name: "b", options: { keyPath: "id", autoIncrement: false } },
@ -22,9 +21,10 @@ function testSteps()
{ name: undefined, keyPath: "value", options: { unique: false } },
];
let request = mozIndexedDB.open(name, 1, description);
let request = mozIndexedDB.open(name, 1);
request.onerror = errorHandler;
request.onupgradeneeded = grabEventAndContinueHandler;
request.onsucess = unexpectedSuccessHandler;
let event = yield;
let db = event.target.result;
@ -115,6 +115,11 @@ function testSteps()
}
}
request.onsuccess = grabEventAndContinueHandler;
request.onupgradeneeded = unexpectedSuccessHandler;
event = yield;
finishTest();
yield;
}

View File

@ -8,7 +8,6 @@ var testGenerator = testSteps();
function testSteps()
{
const name = this.window ? window.location.pathname : "Splendid Test";
const description = "My Test Database";
const objectStoreInfo = [
{ name: "1", options: { keyPath: null } },
{ name: "2", options: { keyPath: null, autoIncrement: true } },
@ -26,9 +25,10 @@ function testSteps()
{ name: undefined }
];
let request = mozIndexedDB.open(name, 1, description);
let request = mozIndexedDB.open(name, 1);
request.onerror = errorHandler;
request.onupgradeneeded = grabEventAndContinueHandler;
request.onsuccess = unexpectedSuccessHandler;
let event = yield;
let db = event.target.result;
@ -99,6 +99,11 @@ function testSteps()
is(found, true, "transaction has correct objectStoreNames list");
}
request.onsuccess = grabEventAndContinueHandler;
request.onupgradeneeded = unexpectedSuccessHandler;
event = yield;
finishTest();
yield;
}