1function done()
2{
3    isSuccessfullyParsed();
4    if (window.layoutTestController)
5        layoutTestController.notifyDone()
6}
7
8function unexpectedSuccessCallback()
9{
10    testFailed("Success function called unexpectedly.");
11}
12
13function unexpectedErrorCallback()
14{
15    testFailed("Error function called unexpectedly: (" + event.target.errorCode + ") " + event.target.webkitErrorMessage);
16}
17
18function unexpectedAbortCallback()
19{
20    testFailed("Abort function called unexpectedly!");
21}
22
23function unexpectedCompleteCallback()
24{
25    testFailed("oncomplete function called unexpectedly!");
26}
27
28function unexpectedBlockedCallback()
29{
30    testFailed("onblocked called unexpectedly");
31}
32
33function evalAndExpectException(cmd, expected)
34{
35    debug("Expecting exception from " + cmd);
36    try {
37        eval(cmd);
38        testFailed("No exception thrown! Should have been " + expected);
39    } catch (e) {
40        code = e.code;
41        testPassed("Exception was thrown.");
42        shouldBe("code", expected);
43    }
44}
45
46function deleteAllObjectStores(db)
47{
48    while (db.objectStoreNames.length)
49        db.deleteObjectStore(db.objectStoreNames.item(0));
50    debug("Deleted all object stores.");
51}
52