summaryrefslogtreecommitdiffstats
path: root/LayoutTests/storage/indexeddb/script-tests/database-basics.js
blob: a07c684d42fddc9eaa6e1d16922338f398ef3f8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
description("Test the basics of IndexedDB's IDBDatabase.");
if (window.layoutTestController) 
    layoutTestController.waitUntilDone();

function openSuccess()
{
    verifySuccessEvent(event);

    var db = evalAndLog("db = event.result");
    shouldBeEqualToString("db.name", "name");
    shouldBeEqualToString("db.version", "");
    shouldBe("db.objectStores", "[]");
    shouldBe("db.objectStores.length", "0");
    shouldBe("db.objectStores.contains('')", "false");
    // FIXME: Test .item() once it's possible to get back a non-empty list.

    // FIXME: Test the other properties of IDBDatabase as they're written.

    done();
}

function test()
{
    result = evalAndLog("indexedDB.open('name', 'description')");
    verifyResult(result);
    result.onsuccess = openSuccess;
    result.onerror = unexpectedErrorCallback;
}

test();

var successfullyParsed = true;