2010-06-23 12:46:08 -07:00
|
|
|
<!--
|
|
|
|
Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/
|
|
|
|
-->
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Indexed Database Property Test</title>
|
|
|
|
|
|
|
|
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
|
|
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
|
|
|
|
|
|
<script type="text/javascript;version=1.7">
|
|
|
|
function testSteps()
|
|
|
|
{
|
|
|
|
const CONSTRAINT_ERR =
|
|
|
|
Components.interfaces.nsIIDBDatabaseException.CONSTRAINT_ERR;
|
|
|
|
const READ_WRITE = Components.interfaces.nsIIDBTransaction.READ_WRITE;
|
|
|
|
const NEXT = Components.interfaces.nsIIDBCursor.NEXT;
|
|
|
|
const PREV = Components.interfaces.nsIIDBCursor.PREV;
|
|
|
|
const NEXT_NO_DUPLICATE =
|
|
|
|
Components.interfaces.nsIIDBCursor.NEXT_NO_DUPLICATE;
|
|
|
|
const PREV_NO_DUPLICATE =
|
|
|
|
Components.interfaces.nsIIDBCursor.PREV_NO_DUPLICATE;
|
|
|
|
|
|
|
|
const name = window.location.pathname;
|
|
|
|
const description = "My Test Database";
|
|
|
|
|
|
|
|
const objectStoreName = "People";
|
|
|
|
|
|
|
|
const objectStoreData = [
|
|
|
|
{ key: "237-23-7732", value: { name: "Bob", height: 60, weight: 120 } },
|
|
|
|
{ key: "237-23-7733", value: { name: "Ann", height: 52, weight: 110 } },
|
|
|
|
{ key: "237-23-7734", value: { name: "Ron", height: 73, weight: 180 } },
|
|
|
|
{ key: "237-23-7735", value: { name: "Sue", height: 58, weight: 130 } },
|
|
|
|
{ key: "237-23-7736", value: { name: "Joe", height: 65, weight: 150 } },
|
|
|
|
{ key: "237-23-7737", value: { name: "Pat", height: 65 } }
|
|
|
|
];
|
|
|
|
|
|
|
|
const indexData = [
|
2010-12-21 08:02:01 -08:00
|
|
|
{ name: "name", keyPath: "name", options: { unique: true } },
|
|
|
|
{ name: "height", keyPath: "height", options: { } },
|
|
|
|
{ name: "weight", keyPath: "weight", options: { unique: false } }
|
2010-06-23 12:46:08 -07:00
|
|
|
];
|
|
|
|
|
|
|
|
const objectStoreDataNameSort = [
|
|
|
|
{ key: "237-23-7733", value: { name: "Ann", height: 52, weight: 110 } },
|
|
|
|
{ key: "237-23-7732", value: { name: "Bob", height: 60, weight: 120 } },
|
|
|
|
{ key: "237-23-7736", value: { name: "Joe", height: 65, weight: 150 } },
|
|
|
|
{ key: "237-23-7737", value: { name: "Pat", height: 65 } },
|
|
|
|
{ key: "237-23-7734", value: { name: "Ron", height: 73, weight: 180 } },
|
|
|
|
{ key: "237-23-7735", value: { name: "Sue", height: 58, weight: 130 } }
|
|
|
|
];
|
|
|
|
|
|
|
|
const objectStoreDataWeightSort = [
|
|
|
|
{ key: "237-23-7733", value: { name: "Ann", height: 52, weight: 110 } },
|
|
|
|
{ key: "237-23-7732", value: { name: "Bob", height: 60, weight: 120 } },
|
|
|
|
{ key: "237-23-7735", value: { name: "Sue", height: 58, weight: 130 } },
|
|
|
|
{ key: "237-23-7736", value: { name: "Joe", height: 65, weight: 150 } },
|
|
|
|
{ key: "237-23-7734", value: { name: "Ron", height: 73, weight: 180 } }
|
|
|
|
];
|
|
|
|
|
|
|
|
const objectStoreDataHeightSort = [
|
|
|
|
{ key: "237-23-7733", value: { name: "Ann", height: 52, weight: 110 } },
|
|
|
|
{ key: "237-23-7735", value: { name: "Sue", height: 58, weight: 130 } },
|
|
|
|
{ key: "237-23-7732", value: { name: "Bob", height: 60, weight: 120 } },
|
|
|
|
{ key: "237-23-7736", value: { name: "Joe", height: 65, weight: 150 } },
|
|
|
|
{ key: "237-23-7737", value: { name: "Pat", height: 65 } },
|
|
|
|
{ key: "237-23-7734", value: { name: "Ron", height: 73, weight: 180 } }
|
|
|
|
];
|
|
|
|
|
2011-01-03 12:03:06 -08:00
|
|
|
let request = mozIndexedDB.open(name, description);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = grabEventAndContinueHandler;
|
|
|
|
let event = yield;
|
|
|
|
|
2011-01-06 22:21:36 -08:00
|
|
|
let db = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-10-19 10:58:52 -07:00
|
|
|
request = db.setVersion("1");
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = grabEventAndContinueHandler;
|
|
|
|
event = yield;
|
|
|
|
|
2010-12-21 08:02:01 -08:00
|
|
|
let objectStore = db.createObjectStore(objectStoreName, { keyPath: "" });
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
// First, add all our data to the object store.
|
|
|
|
let addedData = 0;
|
|
|
|
for (let i in objectStoreData) {
|
|
|
|
request = objectStore.add(objectStoreData[i].value,
|
|
|
|
objectStoreData[i].key);
|
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function(event) {
|
|
|
|
if (++addedData == objectStoreData.length) {
|
|
|
|
testGenerator.send(event);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
event = yield;
|
|
|
|
|
2010-10-19 10:58:52 -07:00
|
|
|
// Now create the indexes.
|
2010-06-23 12:46:08 -07:00
|
|
|
for (let i in indexData) {
|
2010-10-19 10:58:52 -07:00
|
|
|
objectStore.createIndex(indexData[i].name, indexData[i].keyPath,
|
2010-12-21 08:02:01 -08:00
|
|
|
indexData[i].options);
|
2010-06-23 12:46:08 -07:00
|
|
|
}
|
2010-10-19 10:58:52 -07:00
|
|
|
is(objectStore.indexNames.length, indexData.length, "Good index count");
|
|
|
|
continueToNextStep();
|
2010-06-23 12:46:08 -07:00
|
|
|
yield;
|
|
|
|
|
2010-10-19 10:58:49 -07:00
|
|
|
objectStore = db.transaction(objectStoreName)
|
|
|
|
.objectStore(objectStoreName);
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
// Check global properties to make sure they are correct.
|
|
|
|
is(objectStore.indexNames.length, indexData.length, "Good index count");
|
|
|
|
for (let i in indexData) {
|
|
|
|
let found = false;
|
|
|
|
for (let j = 0; j < objectStore.indexNames.length; j++) {
|
|
|
|
if (objectStore.indexNames.item(j) == indexData[i].name) {
|
|
|
|
found = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
is(found, true, "objectStore has our index");
|
|
|
|
let index = objectStore.index(indexData[i].name);
|
|
|
|
is(index.name, indexData[i].name, "Correct name");
|
|
|
|
is(index.storeName, objectStore.name, "Correct store name");
|
|
|
|
is(index.keyPath, indexData[i].keyPath, "Correct keyPath");
|
2010-12-21 08:02:01 -08:00
|
|
|
is(index.unique, indexData[i].options.unique ? true : false,
|
|
|
|
"Correct unique value");
|
2010-06-23 12:46:08 -07:00
|
|
|
}
|
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").getKey("Bob");
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = grabEventAndContinueHandler;
|
|
|
|
event = yield;
|
|
|
|
|
2011-01-06 22:21:36 -08:00
|
|
|
is(event.target.result, "237-23-7732", "Correct key returned!");
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").get("Bob");
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = grabEventAndContinueHandler;
|
|
|
|
event = yield;
|
|
|
|
|
2011-01-06 22:21:36 -08:00
|
|
|
is(event.target.result.name, "Bob", "Correct name returned!");
|
|
|
|
is(event.target.result.height, 60, "Correct height returned!");
|
|
|
|
is(event.target.result.weight, 120, "Correct weight returned!");
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 1");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
let keyIndex = 0;
|
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").openKeyCursor();
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
|
|
|
"Correct primary key");
|
|
|
|
ok(!("value" in cursor), "No value");
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
cursor.continue();
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
2010-06-23 12:46:08 -07:00
|
|
|
"Correct value");
|
2011-02-10 23:47:00 -08:00
|
|
|
ok(!("value" in cursor), "No value");
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
keyIndex++;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, objectStoreData.length, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 2");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = 0;
|
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("weight").openKeyCursor(null, NEXT);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataWeightSort[keyIndex].value.weight,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataWeightSort[keyIndex].key,
|
2010-06-23 12:46:08 -07:00
|
|
|
"Correct value");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
cursor.continue();
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
is(cursor.key, objectStoreDataWeightSort[keyIndex].value.weight,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataWeightSort[keyIndex].key,
|
2010-06-23 12:46:08 -07:00
|
|
|
"Correct value");
|
|
|
|
|
|
|
|
keyIndex++;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, objectStoreData.length - 1, "Saw all the expected keys");
|
|
|
|
|
|
|
|
// Check that the name index enforces its unique constraint.
|
2010-10-19 10:58:49 -07:00
|
|
|
objectStore = db.transaction(objectStoreName, READ_WRITE)
|
|
|
|
.objectStore(objectStoreName);
|
2010-06-23 12:46:08 -07:00
|
|
|
request = objectStore.add({ name: "Bob", height: 62, weight: 170 },
|
|
|
|
"237-23-7738");
|
|
|
|
request.onerror = new ExpectError(CONSTRAINT_ERR);
|
|
|
|
request.onsuccess = unexpectedSuccessHandler;
|
|
|
|
event = yield;
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 3");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = objectStoreDataNameSort.length - 1;
|
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").openKeyCursor(null, PREV);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
2010-06-23 12:46:08 -07:00
|
|
|
"Correct value");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
cursor.continue();
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
2010-06-23 12:46:08 -07:00
|
|
|
"Correct value");
|
|
|
|
|
|
|
|
keyIndex--;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, -1, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 4");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = 1;
|
2010-11-10 15:26:00 -08:00
|
|
|
let keyRange = IDBKeyRange.bound("Bob", "Ron");
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").openKeyCursor(keyRange);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
2010-06-23 12:46:08 -07:00
|
|
|
"Correct value");
|
|
|
|
|
|
|
|
cursor.continue();
|
|
|
|
keyIndex++;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, 5, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 5");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = 2;
|
2010-11-10 15:26:00 -08:00
|
|
|
let keyRange = IDBKeyRange.bound("Bob", "Ron", true);
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").openKeyCursor(keyRange);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
2010-06-23 12:46:08 -07:00
|
|
|
"Correct value");
|
|
|
|
|
|
|
|
cursor.continue();
|
|
|
|
keyIndex++;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, 5, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 6");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = 1;
|
2010-11-10 15:26:00 -08:00
|
|
|
let keyRange = IDBKeyRange.bound("Bob", "Ron", false, true);
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").openKeyCursor(keyRange);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
2010-06-23 12:46:08 -07:00
|
|
|
"Correct value");
|
|
|
|
|
|
|
|
cursor.continue();
|
|
|
|
keyIndex++;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, 4, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 7");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = 2;
|
2010-11-10 15:26:00 -08:00
|
|
|
keyRange = IDBKeyRange.bound("Bob", "Ron", true, true);
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").openKeyCursor(keyRange);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
2010-06-23 12:46:08 -07:00
|
|
|
"Correct value");
|
|
|
|
|
|
|
|
cursor.continue();
|
|
|
|
keyIndex++;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, 4, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 8");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = 1;
|
2010-11-10 15:26:00 -08:00
|
|
|
keyRange = IDBKeyRange.lowerBound("Bob");
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").openKeyCursor(keyRange);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
2010-06-23 12:46:08 -07:00
|
|
|
"Correct value");
|
|
|
|
|
|
|
|
cursor.continue();
|
|
|
|
keyIndex++;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, objectStoreDataNameSort.length, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 9");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = 2;
|
2010-11-10 15:26:00 -08:00
|
|
|
keyRange = IDBKeyRange.lowerBound("Bob", true);
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").openKeyCursor(keyRange);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
2010-06-23 12:46:08 -07:00
|
|
|
"Correct value");
|
|
|
|
|
|
|
|
cursor.continue();
|
|
|
|
keyIndex++;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, objectStoreDataNameSort.length, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 10");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = 0;
|
2010-11-10 15:26:00 -08:00
|
|
|
keyRange = IDBKeyRange.upperBound("Joe");
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").openKeyCursor(keyRange);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
2010-06-23 12:46:08 -07:00
|
|
|
"Correct value");
|
|
|
|
|
|
|
|
cursor.continue();
|
|
|
|
keyIndex++;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, 3, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 11");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = 0;
|
2010-11-10 15:26:00 -08:00
|
|
|
keyRange = IDBKeyRange.upperBound("Joe", true);
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").openKeyCursor(keyRange);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
2010-06-23 12:46:08 -07:00
|
|
|
"Correct value");
|
|
|
|
|
|
|
|
cursor.continue();
|
|
|
|
keyIndex++;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, 2, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 12");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = 3;
|
2010-11-10 15:26:00 -08:00
|
|
|
keyRange = IDBKeyRange.only("Pat");
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").openKeyCursor(keyRange);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
2010-06-23 12:46:08 -07:00
|
|
|
"Correct value");
|
|
|
|
|
|
|
|
cursor.continue();
|
|
|
|
keyIndex++;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, 4, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 13");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = 0;
|
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").openCursor();
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
|
|
|
"Correct primary key");
|
2010-06-23 12:46:08 -07:00
|
|
|
is(cursor.value.name, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct name");
|
|
|
|
is(cursor.value.height,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.height,
|
|
|
|
"Correct height");
|
|
|
|
if ("weight" in cursor.value) {
|
|
|
|
is(cursor.value.weight,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.weight,
|
|
|
|
"Correct weight");
|
|
|
|
}
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
cursor.continue();
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
|
|
|
"Correct primary key");
|
2010-06-23 12:46:08 -07:00
|
|
|
is(cursor.value.name, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct name");
|
|
|
|
is(cursor.value.height,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.height,
|
|
|
|
"Correct height");
|
|
|
|
if ("weight" in cursor.value) {
|
|
|
|
is(cursor.value.weight,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.weight,
|
|
|
|
"Correct weight");
|
|
|
|
}
|
|
|
|
|
|
|
|
keyIndex++;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, objectStoreDataNameSort.length, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 14");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = objectStoreDataNameSort.length - 1;
|
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").openCursor(null, PREV);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
|
|
|
"Correct primary key");
|
2010-06-23 12:46:08 -07:00
|
|
|
is(cursor.value.name, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct name");
|
|
|
|
is(cursor.value.height,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.height,
|
|
|
|
"Correct height");
|
|
|
|
if ("weight" in cursor.value) {
|
|
|
|
is(cursor.value.weight,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.weight,
|
|
|
|
"Correct weight");
|
|
|
|
}
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
cursor.continue();
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
|
|
|
"Correct primary key");
|
2010-06-23 12:46:08 -07:00
|
|
|
is(cursor.value.name, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct name");
|
|
|
|
is(cursor.value.height,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.height,
|
|
|
|
"Correct height");
|
|
|
|
if ("weight" in cursor.value) {
|
|
|
|
is(cursor.value.weight,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.weight,
|
|
|
|
"Correct weight");
|
|
|
|
}
|
|
|
|
|
|
|
|
keyIndex--;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, -1, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 15");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = 1;
|
2010-11-10 15:26:00 -08:00
|
|
|
keyRange = IDBKeyRange.bound("Bob", "Ron");
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").openCursor(keyRange);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
|
|
|
"Correct primary key");
|
2010-06-23 12:46:08 -07:00
|
|
|
is(cursor.value.name, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct name");
|
|
|
|
is(cursor.value.height,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.height,
|
|
|
|
"Correct height");
|
|
|
|
if ("weight" in cursor.value) {
|
|
|
|
is(cursor.value.weight,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.weight,
|
|
|
|
"Correct weight");
|
|
|
|
}
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
cursor.continue();
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
|
|
|
"Correct primary key");
|
2010-06-23 12:46:08 -07:00
|
|
|
is(cursor.value.name, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct name");
|
|
|
|
is(cursor.value.height,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.height,
|
|
|
|
"Correct height");
|
|
|
|
if ("weight" in cursor.value) {
|
|
|
|
is(cursor.value.weight,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.weight,
|
|
|
|
"Correct weight");
|
|
|
|
}
|
|
|
|
|
|
|
|
keyIndex++;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, 5, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 16");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = 2;
|
2010-11-10 15:26:00 -08:00
|
|
|
keyRange = IDBKeyRange.bound("Bob", "Ron", true);
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").openCursor(keyRange);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
|
|
|
"Correct primary key");
|
2010-06-23 12:46:08 -07:00
|
|
|
is(cursor.value.name, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct name");
|
|
|
|
is(cursor.value.height,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.height,
|
|
|
|
"Correct height");
|
|
|
|
if ("weight" in cursor.value) {
|
|
|
|
is(cursor.value.weight,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.weight,
|
|
|
|
"Correct weight");
|
|
|
|
}
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
cursor.continue();
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
|
|
|
"Correct primary key");
|
2010-06-23 12:46:08 -07:00
|
|
|
is(cursor.value.name, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct name");
|
|
|
|
is(cursor.value.height,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.height,
|
|
|
|
"Correct height");
|
|
|
|
if ("weight" in cursor.value) {
|
|
|
|
is(cursor.value.weight,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.weight,
|
|
|
|
"Correct weight");
|
|
|
|
}
|
|
|
|
|
|
|
|
keyIndex++;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, 5, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 17");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = 1;
|
2010-11-10 15:26:00 -08:00
|
|
|
keyRange = IDBKeyRange.bound("Bob", "Ron", false, true);
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").openCursor(keyRange);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
|
|
|
"Correct primary key");
|
2010-06-23 12:46:08 -07:00
|
|
|
is(cursor.value.name, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct name");
|
|
|
|
is(cursor.value.height,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.height,
|
|
|
|
"Correct height");
|
|
|
|
if ("weight" in cursor.value) {
|
|
|
|
is(cursor.value.weight,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.weight,
|
|
|
|
"Correct weight");
|
|
|
|
}
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
cursor.continue();
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
|
|
|
"Correct primary key");
|
2010-06-23 12:46:08 -07:00
|
|
|
is(cursor.value.name, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct name");
|
|
|
|
is(cursor.value.height,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.height,
|
|
|
|
"Correct height");
|
|
|
|
if ("weight" in cursor.value) {
|
|
|
|
is(cursor.value.weight,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.weight,
|
|
|
|
"Correct weight");
|
|
|
|
}
|
|
|
|
|
|
|
|
keyIndex++;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, 4, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 18");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = 2;
|
2010-11-10 15:26:00 -08:00
|
|
|
keyRange = IDBKeyRange.bound("Bob", "Ron", true, true);
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").openCursor(keyRange);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
|
|
|
"Correct primary key");
|
2010-06-23 12:46:08 -07:00
|
|
|
is(cursor.value.name, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct name");
|
|
|
|
is(cursor.value.height,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.height,
|
|
|
|
"Correct height");
|
|
|
|
if ("weight" in cursor.value) {
|
|
|
|
is(cursor.value.weight,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.weight,
|
|
|
|
"Correct weight");
|
|
|
|
}
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
cursor.continue();
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
|
|
|
"Correct primary key");
|
2010-06-23 12:46:08 -07:00
|
|
|
is(cursor.value.name, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct name");
|
|
|
|
is(cursor.value.height,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.height,
|
|
|
|
"Correct height");
|
|
|
|
if ("weight" in cursor.value) {
|
|
|
|
is(cursor.value.weight,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.weight,
|
|
|
|
"Correct weight");
|
|
|
|
}
|
|
|
|
|
|
|
|
keyIndex++;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, 4, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 19");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = 4;
|
2010-11-10 15:26:00 -08:00
|
|
|
keyRange = IDBKeyRange.bound("Bob", "Ron");
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").openCursor(keyRange, PREV);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
|
|
|
"Correct primary key");
|
2010-06-23 12:46:08 -07:00
|
|
|
is(cursor.value.name, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct name");
|
|
|
|
is(cursor.value.height,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.height,
|
|
|
|
"Correct height");
|
|
|
|
if ("weight" in cursor.value) {
|
|
|
|
is(cursor.value.weight,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.weight,
|
|
|
|
"Correct weight");
|
|
|
|
}
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
cursor.continue();
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
|
|
|
"Correct primary key");
|
2010-06-23 12:46:08 -07:00
|
|
|
is(cursor.value.name, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct name");
|
|
|
|
is(cursor.value.height,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.height,
|
|
|
|
"Correct height");
|
|
|
|
if ("weight" in cursor.value) {
|
|
|
|
is(cursor.value.weight,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.weight,
|
|
|
|
"Correct weight");
|
|
|
|
}
|
|
|
|
|
|
|
|
keyIndex--;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, 0, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 20");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
// Test NEXT_NO_DUPLICATE
|
|
|
|
keyIndex = 3;
|
2010-11-10 15:26:00 -08:00
|
|
|
keyRange = IDBKeyRange.only(65);
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("height").openKeyCursor(keyRange, NEXT);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataHeightSort[keyIndex].value.height,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataHeightSort[keyIndex].key,
|
2010-06-23 12:46:08 -07:00
|
|
|
"Correct value");
|
|
|
|
|
|
|
|
cursor.continue();
|
|
|
|
keyIndex++;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, 5, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 21");
|
|
|
|
|
|
|
|
keyIndex = 3;
|
2010-11-10 15:26:00 -08:00
|
|
|
keyRange = IDBKeyRange.only(65);
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("height").openKeyCursor(keyRange,
|
|
|
|
NEXT_NO_DUPLICATE);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataHeightSort[keyIndex].value.height,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataHeightSort[keyIndex].key,
|
2010-06-23 12:46:08 -07:00
|
|
|
"Correct value");
|
|
|
|
|
|
|
|
cursor.continue();
|
|
|
|
keyIndex++;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
is(keyIndex, 4, "Saw all the expected keys");
|
|
|
|
|
|
|
|
ok(true, "Test group 22");
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
keyIndex = 5;
|
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("height").openKeyCursor(null,
|
|
|
|
PREV_NO_DUPLICATE);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataHeightSort[keyIndex].value.height,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataHeightSort[keyIndex].key,
|
2010-06-23 12:46:08 -07:00
|
|
|
"Correct value");
|
|
|
|
|
|
|
|
cursor.continue();
|
2010-12-09 18:15:00 -08:00
|
|
|
if (keyIndex == 5) {
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex--;
|
|
|
|
}
|
|
|
|
keyIndex--;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, -1, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 23");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = 3;
|
2010-11-10 15:26:00 -08:00
|
|
|
keyRange = IDBKeyRange.only(65);
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("height").openCursor(keyRange, NEXT);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataHeightSort[keyIndex].value.height,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataHeightSort[keyIndex].key,
|
|
|
|
"Correct primary key");
|
2010-06-23 12:46:08 -07:00
|
|
|
is(cursor.value.name, objectStoreDataHeightSort[keyIndex].value.name,
|
|
|
|
"Correct name");
|
|
|
|
is(cursor.value.height,
|
|
|
|
objectStoreDataHeightSort[keyIndex].value.height,
|
|
|
|
"Correct height");
|
|
|
|
if ("weight" in cursor.value) {
|
|
|
|
is(cursor.value.weight,
|
|
|
|
objectStoreDataHeightSort[keyIndex].value.weight,
|
|
|
|
"Correct weight");
|
|
|
|
}
|
|
|
|
|
|
|
|
cursor.continue();
|
|
|
|
keyIndex++;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, 5, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 24");
|
|
|
|
|
|
|
|
keyIndex = 3;
|
2010-11-10 15:26:00 -08:00
|
|
|
keyRange = IDBKeyRange.only(65);
|
2010-06-23 12:46:08 -07:00
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("height").openCursor(keyRange,
|
|
|
|
NEXT_NO_DUPLICATE);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataHeightSort[keyIndex].value.height,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataHeightSort[keyIndex].key,
|
|
|
|
"Correct primary key");
|
2010-06-23 12:46:08 -07:00
|
|
|
is(cursor.value.name, objectStoreDataHeightSort[keyIndex].value.name,
|
|
|
|
"Correct name");
|
|
|
|
is(cursor.value.height,
|
|
|
|
objectStoreDataHeightSort[keyIndex].value.height,
|
|
|
|
"Correct height");
|
|
|
|
if ("weight" in cursor.value) {
|
|
|
|
is(cursor.value.weight,
|
|
|
|
objectStoreDataHeightSort[keyIndex].value.weight,
|
|
|
|
"Correct weight");
|
|
|
|
}
|
|
|
|
|
|
|
|
cursor.continue();
|
|
|
|
keyIndex++;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
is(keyIndex, 4, "Saw all the expected keys");
|
|
|
|
|
|
|
|
ok(true, "Test group 25");
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
keyIndex = 5;
|
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("height").openCursor(null,
|
|
|
|
PREV_NO_DUPLICATE);
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataHeightSort[keyIndex].value.height,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataHeightSort[keyIndex].key,
|
|
|
|
"Correct primary key");
|
2010-06-23 12:46:08 -07:00
|
|
|
is(cursor.value.name, objectStoreDataHeightSort[keyIndex].value.name,
|
|
|
|
"Correct name");
|
|
|
|
is(cursor.value.height,
|
|
|
|
objectStoreDataHeightSort[keyIndex].value.height,
|
|
|
|
"Correct height");
|
|
|
|
if ("weight" in cursor.value) {
|
|
|
|
is(cursor.value.weight,
|
|
|
|
objectStoreDataHeightSort[keyIndex].value.weight,
|
|
|
|
"Correct weight");
|
|
|
|
}
|
|
|
|
|
|
|
|
cursor.continue();
|
2010-12-09 18:15:00 -08:00
|
|
|
if (keyIndex == 5) {
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex--;
|
|
|
|
}
|
|
|
|
keyIndex--;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, -1, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 26");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = 0;
|
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").openKeyCursor();
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
2010-06-23 12:46:08 -07:00
|
|
|
"Correct value");
|
|
|
|
|
|
|
|
let nextKey = !keyIndex ? "Pat" : undefined;
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
cursor.continue(nextKey);
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
2010-06-23 12:46:08 -07:00
|
|
|
"Correct value");
|
|
|
|
|
|
|
|
if (!keyIndex) {
|
|
|
|
keyIndex = 3;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
keyIndex++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, objectStoreData.length, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 27");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = 0;
|
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").openKeyCursor();
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
2010-06-23 12:46:08 -07:00
|
|
|
"Correct value");
|
|
|
|
|
|
|
|
let nextKey = !keyIndex ? "Flo" : undefined;
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
cursor.continue(nextKey);
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
2010-06-23 12:46:08 -07:00
|
|
|
"Correct value");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
keyIndex += keyIndex ? 1 : 2;
|
2010-06-23 12:46:08 -07:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, objectStoreData.length, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 28");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = 0;
|
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").openCursor();
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
|
|
|
"Correct primary key");
|
2010-06-23 12:46:08 -07:00
|
|
|
is(cursor.value.name, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct name");
|
|
|
|
is(cursor.value.height,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.height,
|
|
|
|
"Correct height");
|
|
|
|
if ("weight" in cursor.value) {
|
|
|
|
is(cursor.value.weight,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.weight,
|
|
|
|
"Correct weight");
|
|
|
|
}
|
|
|
|
|
|
|
|
let nextKey = !keyIndex ? "Pat" : undefined;
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
cursor.continue(nextKey);
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
|
|
|
"Correct primary key");
|
2010-06-23 12:46:08 -07:00
|
|
|
is(cursor.value.name, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct name");
|
|
|
|
is(cursor.value.height,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.height,
|
|
|
|
"Correct height");
|
|
|
|
if ("weight" in cursor.value) {
|
|
|
|
is(cursor.value.weight,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.weight,
|
|
|
|
"Correct weight");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!keyIndex) {
|
|
|
|
keyIndex = 3;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
keyIndex++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, objectStoreDataNameSort.length, "Saw all the expected keys");
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
ok(true, "Test group 29");
|
|
|
|
|
2010-06-23 12:46:08 -07:00
|
|
|
keyIndex = 0;
|
|
|
|
|
2010-12-15 13:21:02 -08:00
|
|
|
request = objectStore.index("name").openCursor();
|
2010-06-23 12:46:08 -07:00
|
|
|
request.onerror = errorHandler;
|
|
|
|
request.onsuccess = function (event) {
|
2011-01-06 22:21:36 -08:00
|
|
|
let cursor = event.target.result;
|
2010-06-23 12:46:08 -07:00
|
|
|
if (cursor) {
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
|
|
|
"Correct primary key");
|
2010-06-23 12:46:08 -07:00
|
|
|
is(cursor.value.name, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct name");
|
|
|
|
is(cursor.value.height,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.height,
|
|
|
|
"Correct height");
|
|
|
|
if ("weight" in cursor.value) {
|
|
|
|
is(cursor.value.weight,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.weight,
|
|
|
|
"Correct weight");
|
|
|
|
}
|
|
|
|
|
|
|
|
let nextKey = !keyIndex ? "Flo" : undefined;
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
cursor.continue(nextKey);
|
2010-06-23 12:46:08 -07:00
|
|
|
|
|
|
|
is(cursor.key, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct key");
|
2011-02-10 23:47:00 -08:00
|
|
|
is(cursor.primaryKey, objectStoreDataNameSort[keyIndex].key,
|
|
|
|
"Correct primary key");
|
2010-06-23 12:46:08 -07:00
|
|
|
is(cursor.value.name, objectStoreDataNameSort[keyIndex].value.name,
|
|
|
|
"Correct name");
|
|
|
|
is(cursor.value.height,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.height,
|
|
|
|
"Correct height");
|
|
|
|
if ("weight" in cursor.value) {
|
|
|
|
is(cursor.value.weight,
|
|
|
|
objectStoreDataNameSort[keyIndex].value.weight,
|
|
|
|
"Correct weight");
|
|
|
|
}
|
|
|
|
|
2010-12-09 18:15:00 -08:00
|
|
|
keyIndex += keyIndex ? 1 : 2;
|
2010-06-23 12:46:08 -07:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
testGenerator.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yield;
|
|
|
|
|
|
|
|
is(keyIndex, objectStoreDataNameSort.length, "Saw all the expected keys");
|
|
|
|
|
|
|
|
finishTest();
|
|
|
|
yield;
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<script type="text/javascript;version=1.7" src="helpers.js"></script>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body onload="runTest();"></body>
|
|
|
|
|
|
|
|
</html>
|