summaryrefslogtreecommitdiffstats
path: root/LayoutTests
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2011-05-18 13:36:51 +0100
committerSteve Block <steveblock@google.com>2011-05-24 15:38:28 +0100
commit2fc2651226baac27029e38c9d6ef883fa32084db (patch)
treee396d4bf89dcce6ed02071be66212495b1df1dec /LayoutTests
parentb3725cedeb43722b3b175aaeff70552e562d2c94 (diff)
downloadexternal_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.zip
external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.gz
external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.bz2
Merge WebKit at r78450: Initial merge by git.
Change-Id: I6d3e5f1f868ec266a0aafdef66182ddc3f265dc1
Diffstat (limited to 'LayoutTests')
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-hash.js2
-rw-r--r--LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash-expected.txt2
-rw-r--r--LayoutTests/fast/encoding/css-charset-default-expected.txt2
-rw-r--r--LayoutTests/fast/encoding/css-charset-default.xhtml5
-rw-r--r--LayoutTests/fast/encoding/external-script-charset-expected.txt4
-rw-r--r--LayoutTests/fast/encoding/external-script-charset-koi-8.js1
-rw-r--r--LayoutTests/fast/encoding/external-script-charset.js2
-rw-r--r--LayoutTests/fast/encoding/external-script-charset.xhtml5
-rw-r--r--LayoutTests/fast/url/anchor-expected.txt7
-rw-r--r--LayoutTests/fast/url/file-expected.txt2
-rw-r--r--LayoutTests/fast/url/file-http-base-expected.txt4
-rw-r--r--LayoutTests/fast/url/path-expected.txt5
-rw-r--r--LayoutTests/fast/url/path-url-expected.txt2
-rw-r--r--LayoutTests/fast/url/port-expected.txt3
-rw-r--r--LayoutTests/fast/url/relative-expected.txt2
-rw-r--r--LayoutTests/fast/url/relative-unix-expected.txt2
-rw-r--r--LayoutTests/fast/url/relative-win-expected.txt2
-rw-r--r--LayoutTests/fast/url/scheme-expected.txt2
-rw-r--r--LayoutTests/fast/url/script-tests/anchor.js1
-rw-r--r--LayoutTests/fast/url/script-tests/path.js3
-rw-r--r--LayoutTests/fast/url/script-tests/port.js2
-rw-r--r--LayoutTests/fast/url/segments-expected.txt6
-rw-r--r--LayoutTests/fast/url/segments-from-data-url-expected.txt6
-rw-r--r--LayoutTests/fast/url/standard-url-expected.txt12
-rw-r--r--LayoutTests/http/conf/apache2-msys-httpd.conf709
-rw-r--r--LayoutTests/storage/indexeddb/create-object-store-options-expected.txt2
-rw-r--r--LayoutTests/storage/indexeddb/create-object-store-options.html2
-rw-r--r--LayoutTests/storage/indexeddb/cursor-delete-expected.txt8
-rw-r--r--LayoutTests/storage/indexeddb/cursor-delete.html8
-rw-r--r--LayoutTests/storage/indexeddb/cursor-index-delete-expected.txt11
-rw-r--r--LayoutTests/storage/indexeddb/cursor-index-delete.html11
-rw-r--r--LayoutTests/storage/indexeddb/cursor-skip-deleted-expected.txt185
-rw-r--r--LayoutTests/storage/indexeddb/cursor-skip-deleted.html218
-rw-r--r--LayoutTests/storage/indexeddb/cursor-update-expected.txt283
-rw-r--r--LayoutTests/storage/indexeddb/cursor-update.html249
-rw-r--r--LayoutTests/storage/indexeddb/data-corruption-expected.txt69
-rw-r--r--LayoutTests/storage/indexeddb/data-corruption.html88
-rw-r--r--LayoutTests/storage/indexeddb/database-quota-expected.txt3
-rw-r--r--LayoutTests/storage/indexeddb/database-quota.html3
-rw-r--r--LayoutTests/storage/indexeddb/duplicates-expected.txt4
-rw-r--r--LayoutTests/storage/indexeddb/duplicates.html4
-rw-r--r--LayoutTests/storage/indexeddb/error-causes-abort-by-default-expected.txt107
-rw-r--r--LayoutTests/storage/indexeddb/error-causes-abort-by-default.html127
-rw-r--r--LayoutTests/storage/indexeddb/index-basics-expected.txt2
-rw-r--r--LayoutTests/storage/indexeddb/index-basics.html4
-rw-r--r--LayoutTests/storage/indexeddb/index-cursor.html4
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-autoincrement-expected.txt42
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-autoincrement.html43
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-basics-expected.txt11
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-basics.html22
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-clear-expected.txt151
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-clear.html130
-rw-r--r--LayoutTests/storage/indexeddb/objectstore-cursor.html4
-rw-r--r--LayoutTests/storage/indexeddb/open-cursor-expected.txt4
-rw-r--r--LayoutTests/storage/indexeddb/open-cursor.html4
-rw-r--r--LayoutTests/storage/indexeddb/request-event-propagation-expected.txt166
-rw-r--r--LayoutTests/storage/indexeddb/request-event-propagation.html272
-rw-r--r--LayoutTests/storage/indexeddb/transaction-after-close-expected.txt95
-rw-r--r--LayoutTests/storage/indexeddb/transaction-after-close.html105
-rw-r--r--LayoutTests/storage/indexeddb/transaction-and-objectstore-calls-expected.txt24
-rw-r--r--LayoutTests/storage/indexeddb/transaction-and-objectstore-calls.html24
-rw-r--r--LayoutTests/storage/indexeddb/transaction-basics.html6
-rw-r--r--LayoutTests/storage/indexeddb/transaction-event-propagation-expected.txt79
-rw-r--r--LayoutTests/storage/indexeddb/transaction-event-propagation.html153
-rw-r--r--LayoutTests/storage/indexeddb/tutorial.html24
65 files changed, 3391 insertions, 153 deletions
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-hash.js b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-hash.js
index 5cce834..c28dceb 100644
--- a/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-hash.js
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-hash.js
@@ -50,7 +50,7 @@ shouldBe("a.href", "'mailto:e-mail_address@goes_here#hash-value'");
debug("Add hash to file: protocol");
a.href = "file:///some path";
a.hash = "hash value";
-shouldBe("a.href", "'file:///some%20path#hash%20value'");
+shouldBe("a.href", "'file:///some%20path#hash value'");
debug("Set hash to '#'");
a.href = "http://mydomain.com#middle";
diff --git a/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash-expected.txt b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash-expected.txt
index 6515820..a757f84 100644
--- a/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash-expected.txt
+++ b/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash-expected.txt
@@ -18,7 +18,7 @@ PASS a.href is 'https://www.mydomain.com/path/testurl.html#'
Add hash to mailto: protocol
PASS a.href is 'mailto:e-mail_address@goes_here#hash-value'
Add hash to file: protocol
-PASS a.href is 'file:///some%20path#hash%20value'
+PASS a.href is 'file:///some%20path#hash value'
Set hash to '#'
PASS a.href is 'http://mydomain.com/#'
Add hash to non-standard protocol
diff --git a/LayoutTests/fast/encoding/css-charset-default-expected.txt b/LayoutTests/fast/encoding/css-charset-default-expected.txt
index 954790e..69ddbb1 100644
--- a/LayoutTests/fast/encoding/css-charset-default-expected.txt
+++ b/LayoutTests/fast/encoding/css-charset-default-expected.txt
@@ -7,3 +7,5 @@ Stylesheet 2 (inherit document charset using link): SUССЕSS
Stylesheet 3 (inherit referring stylesheet charset): SUССЕSS
Stylesheet 4 (inherit referring inline stylesheet charset): SUССЕSS
+
+Stylesheet 5 (inherit document charset using link after document.charset was set): SUССЕSS
diff --git a/LayoutTests/fast/encoding/css-charset-default.xhtml b/LayoutTests/fast/encoding/css-charset-default.xhtml
index 24432f2..87a6d68 100644
--- a/LayoutTests/fast/encoding/css-charset-default.xhtml
+++ b/LayoutTests/fast/encoding/css-charset-default.xhtml
@@ -10,6 +10,8 @@
<style type="text/css">
@import "css-charset-inherit-iso-8859-5.css?4";
</style>
+ <script>document.charset = "koi8-r";</script>
+ <link rel="stylesheet" type="text/css" href="css-charset-inherit-koi-8.css?2"/>
</head>
<body onload="test()">
<p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=11011">bug 11011</a>:
@@ -19,6 +21,7 @@ External CSS is parsed as iso-8859-1 even though the main document is utf-8.</p>
<p id="res2">Stylesheet 2 (inherit document charset using link): </p>
<p id="res3">Stylesheet 3 (inherit referring stylesheet charset): </p>
<p id="res4">Stylesheet 4 (inherit referring inline stylesheet charset): </p>
+<p id="res5">Stylesheet 5 (inherit document charset using link after document.charset was set): </p>
<script type="text/javascript">
if (window.layoutTestController)
@@ -33,6 +36,8 @@ function test() {
document.getElementById("res3").innerHTML += document.styleSheets[2].cssRules[1].styleSheet.cssRules[0].style.content;
document.getElementById("res4").innerHTML += document.styleSheets[3].cssRules[0].styleSheet.cssRules[0].style.content;
+
+ document.getElementById("res5").innerHTML += document.styleSheets[4].cssRules[0].style.content;
} catch (ex) {
alert(ex.toString());
}
diff --git a/LayoutTests/fast/encoding/external-script-charset-expected.txt b/LayoutTests/fast/encoding/external-script-charset-expected.txt
index 6575759..0b4c6df 100644
--- a/LayoutTests/fast/encoding/external-script-charset-expected.txt
+++ b/LayoutTests/fast/encoding/external-script-charset-expected.txt
@@ -1,3 +1,5 @@
Test that external scripts in XHTML documents inherit document charset.
-PASS
+Javascript 1 (original document charset): PASS
+
+Javascript 2 (after document.charset was set): PASS
diff --git a/LayoutTests/fast/encoding/external-script-charset-koi-8.js b/LayoutTests/fast/encoding/external-script-charset-koi-8.js
new file mode 100644
index 0000000..141c931
--- /dev/null
+++ b/LayoutTests/fast/encoding/external-script-charset-koi-8.js
@@ -0,0 +1 @@
+document.getElementById("result2").innerHTML += ("" == "\u0421") ? "PASS" : "FAIL";
diff --git a/LayoutTests/fast/encoding/external-script-charset.js b/LayoutTests/fast/encoding/external-script-charset.js
index 841824d..a8306cb 100644
--- a/LayoutTests/fast/encoding/external-script-charset.js
+++ b/LayoutTests/fast/encoding/external-script-charset.js
@@ -1,4 +1,4 @@
if (window.layoutTestController)
layoutTestController.dumpAsText();
-document.getElementById("result").innerHTML = ("Я" == "\u042F") ? "PASS" : "FAIL"; \ No newline at end of file
+document.getElementById("result1").innerHTML += ("Я" == "\u042F") ? "PASS" : "FAIL";
diff --git a/LayoutTests/fast/encoding/external-script-charset.xhtml b/LayoutTests/fast/encoding/external-script-charset.xhtml
index d89b9d6..f6e8bf3 100644
--- a/LayoutTests/fast/encoding/external-script-charset.xhtml
+++ b/LayoutTests/fast/encoding/external-script-charset.xhtml
@@ -1,7 +1,10 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" dir="ltr">
<body>
<p>Test that external scripts in XHTML documents inherit document charset.</p>
- <div id="result"></div>
+ <p id="result1">Javascript 1 (original document charset): </p>
+ <p id="result2">Javascript 2 (after document.charset was set): </p>
<script type="text/javascript" src="external-script-charset.js"></script>
+ <script>document.charset = "koi8-r";</script>
+ <script type="text/javascript" src="external-script-charset-koi-8.js"></script>
</body>
</html>
diff --git a/LayoutTests/fast/url/anchor-expected.txt b/LayoutTests/fast/url/anchor-expected.txt
index 15dc84f..c7c8b1d 100644
--- a/LayoutTests/fast/url/anchor-expected.txt
+++ b/LayoutTests/fast/url/anchor-expected.txt
@@ -3,14 +3,15 @@ Test URLs that have an anchor.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-FAIL canonicalize('http://www.example.com/#hello, world') should be http://www.example.com/#hello, world. Was http://www.example.com/#hello,%20world.
+PASS canonicalize('http://www.example.com/#hello, world') is 'http://www.example.com/#hello, world'
FAIL canonicalize('http://www.example.com/#©') should be http://www.example.com/#©. Was http://www.example.com/#%C2%A9.
FAIL canonicalize('http://www.example.com/#𐌀ss') should be http://www.example.com/#𐌀ss. Was http://www.example.com/#%26%2366304%3Bss.
PASS canonicalize('http://www.example.com/#%41%a') is 'http://www.example.com/#%41%a'
FAIL canonicalize('http://www.example.com/#\ud800\u597d') should be http://www.example.com/#�好. Was http://www.example.com/#%26%2355296%3B%26%2322909%3B.
FAIL canonicalize('http://www.example.com/#a\uFDD0') should be http://www.example.com/#a﷐. Was http://www.example.com/#a%26%2364976%3B.
-FAIL canonicalize('http://www.example.com/#asdf#qwer') should be http://www.example.com/#asdf#qwer. Was http://www.example.com/#asdf%23qwer.
-FAIL canonicalize('http://www.example.com/##asdf') should be http://www.example.com/##asdf. Was http://www.example.com/#%23asdf.
+PASS canonicalize('http://www.example.com/#asdf#qwer') is 'http://www.example.com/#asdf#qwer'
+PASS canonicalize('http://www.example.com/##asdf') is 'http://www.example.com/##asdf'
+PASS canonicalize('http://www.example.com/#a\nb\rc\td') is 'http://www.example.com/#abcd'
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/url/file-expected.txt b/LayoutTests/fast/url/file-expected.txt
index e85ff52..d274673 100644
--- a/LayoutTests/fast/url/file-expected.txt
+++ b/LayoutTests/fast/url/file-expected.txt
@@ -17,7 +17,7 @@ PASS canonicalize('/\\server/file') is 'file://server/file'
FAIL canonicalize('file:c:foo/bar.html') should be file:///C:/foo/bar.html. Was file:///tmp/mock/c:foo/bar.html.
FAIL canonicalize('file:/\\/\\C:\\\\//foo\\bar.html') should be file:///C:////foo/bar.html. Was file:////C:////foo/bar.html.
PASS canonicalize('file:///foo/bar.txt') is 'file:///foo/bar.txt'
-FAIL canonicalize('FILE:/\\/\\7:\\\\//foo\\bar.html') should be file://7:////foo/bar.html. Was FILE:////7:////foo/bar.html.
+FAIL canonicalize('FILE:/\\/\\7:\\\\//foo\\bar.html') should be file://7:////foo/bar.html. Was file:////7:////foo/bar.html.
FAIL canonicalize('file:filer/home\\me') should be file://filer/home/me. Was file:///tmp/mock/filer/home/me.
FAIL canonicalize('file:///C:/foo/../../../bar.html') should be file:///C:/bar.html. Was file:///bar.html.
FAIL canonicalize('file:///C:/asdf#\xc2') should be file:///C:/asdf#�. Was file:///C:/asdf#%C2.
diff --git a/LayoutTests/fast/url/file-http-base-expected.txt b/LayoutTests/fast/url/file-http-base-expected.txt
index aa860a1..afd3131 100644
--- a/LayoutTests/fast/url/file-http-base-expected.txt
+++ b/LayoutTests/fast/url/file-http-base-expected.txt
@@ -4,7 +4,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
FAIL canonicalize('file:c:\\foo\\bar.html') should be file:///C:/foo/bar.html. Was file://c:/foo/bar.html.
-FAIL canonicalize(' File:c|////foo\\bar.html') should be file:///C:////foo/bar.html. Was File://c|////foo/bar.html.
+FAIL canonicalize(' File:c|////foo\\bar.html') should be file:///C:////foo/bar.html. Was file://c|////foo/bar.html.
FAIL canonicalize('file:') should be file:///. Was file:.
FAIL canonicalize('file:UNChost/path') should be file://unchost/path. Was file://UNChost/path.
FAIL canonicalize('c:\\foo\\bar') should be file:///C:/foo/bar. Was c:/foo/bar.
@@ -17,7 +17,7 @@ FAIL canonicalize('/\\server/file') should be file://server/file. Was http://ser
FAIL canonicalize('file:c:foo/bar.html') should be file:///C:/foo/bar.html. Was file://c:foo/bar.html.
FAIL canonicalize('file:/\\/\\C:\\\\//foo\\bar.html') should be file:///C:////foo/bar.html. Was file:////C:////foo/bar.html.
PASS canonicalize('file:///foo/bar.txt') is 'file:///foo/bar.txt'
-FAIL canonicalize('FILE:/\\/\\7:\\\\//foo\\bar.html') should be file://7:////foo/bar.html. Was FILE:////7:////foo/bar.html.
+FAIL canonicalize('FILE:/\\/\\7:\\\\//foo\\bar.html') should be file://7:////foo/bar.html. Was file:////7:////foo/bar.html.
PASS canonicalize('file:filer/home\\me') is 'file://filer/home/me'
FAIL canonicalize('file:///C:/foo/../../../bar.html') should be file:///C:/bar.html. Was file:///bar.html.
FAIL canonicalize('file:///C:/asdf#\xc2') should be file:///C:/asdf#�. Was file:///C:/asdf#%C2.
diff --git a/LayoutTests/fast/url/path-expected.txt b/LayoutTests/fast/url/path-expected.txt
index 629806b..93bfb03 100644
--- a/LayoutTests/fast/url/path-expected.txt
+++ b/LayoutTests/fast/url/path-expected.txt
@@ -17,7 +17,10 @@ PASS canonicalize('http://example.com/foo/../../../ton') is 'http://example.com/
FAIL canonicalize('http://example.com/foo/%2e') should be http://example.com/foo/. Was http://example.com/foo/%2e.
FAIL canonicalize('http://example.com/foo/%2e%2') should be http://example.com/foo/.%2. Was http://example.com/foo/%2e%2.
FAIL canonicalize('http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar') should be http://example.com/..bar. Was http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar.
-FAIL canonicalize('http://example.com////../..') should be http://example.com//. Was http://example.com/.
+PASS canonicalize('http://example.com////../..') is 'http://example.com//'
+PASS canonicalize('http://example.com/foo/bar//../..') is 'http://example.com/foo/'
+PASS canonicalize('http://example.com/foo/bar//..') is 'http://example.com/foo/bar/'
+PASS canonicalize('http://example.com/foo/bar/..') is 'http://example.com/foo/'
PASS canonicalize('http://example.com/foo') is 'http://example.com/foo'
PASS canonicalize('http://example.com/%20foo') is 'http://example.com/%20foo'
PASS canonicalize('http://example.com/foo%') is 'http://example.com/foo%'
diff --git a/LayoutTests/fast/url/path-url-expected.txt b/LayoutTests/fast/url/path-url-expected.txt
index 73eaf54..278b623 100644
--- a/LayoutTests/fast/url/path-url-expected.txt
+++ b/LayoutTests/fast/url/path-url-expected.txt
@@ -4,7 +4,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS canonicalize('javascript:') is 'javascript:'
-FAIL canonicalize('JavaScript:Foo') should be javascript:Foo. Was JavaScript:Foo.
+PASS canonicalize('JavaScript:Foo') is 'javascript:Foo'
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/url/port-expected.txt b/LayoutTests/fast/url/port-expected.txt
index d64dd3a..11ab371 100644
--- a/LayoutTests/fast/url/port-expected.txt
+++ b/LayoutTests/fast/url/port-expected.txt
@@ -5,8 +5,9 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
FAIL canonicalize('http://www.example.com:as df/') should be http://www.example.com:as%20df/. Was http://www.example.com:as df/.
PASS canonicalize('http://www.example.com:-2/') is 'http://www.example.com:-2/'
-FAIL canonicalize('http://www.example.com:80/') should be http://www.example.com/. Was http://www.example.com:80/.
+PASS canonicalize('http://www.example.com:80/') is 'http://www.example.com/'
PASS canonicalize('http://www.example.com:8080/') is 'http://www.example.com:8080/'
+PASS canonicalize('http://www.example.com:/') is 'http://www.example.com/'
PASS canonicalize('foobar://www.example.com:80/') is 'foobar://www.example.com:80/'
PASS successfullyParsed is true
diff --git a/LayoutTests/fast/url/relative-expected.txt b/LayoutTests/fast/url/relative-expected.txt
index 684253f..8ee781c 100644
--- a/LayoutTests/fast/url/relative-expected.txt
+++ b/LayoutTests/fast/url/relative-expected.txt
@@ -14,7 +14,7 @@ PASS canonicalize(' ') is 'http://foo/bar'
PASS canonicalize('http:path') is 'http://host/path'
PASS canonicalize('http:path') is 'http://host/a/path'
FAIL canonicalize('http:/path') should be http://host/path. Was http:/path.
-FAIL canonicalize('HTTP:/path') should be http://host/path. Was HTTP:/path.
+FAIL canonicalize('HTTP:/path') should be http://host/path. Was http:/path.
FAIL canonicalize('https:host2') should be https://host2/. Was https:host2.
PASS canonicalize('htto:/host2') is 'htto:/host2'
PASS canonicalize('/b/c/d') is 'http://host/b/c/d'
diff --git a/LayoutTests/fast/url/relative-unix-expected.txt b/LayoutTests/fast/url/relative-unix-expected.txt
index acd59ab..32c1a75 100644
--- a/LayoutTests/fast/url/relative-unix-expected.txt
+++ b/LayoutTests/fast/url/relative-unix-expected.txt
@@ -5,7 +5,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
FAIL canonicalize('\\\\Another\\path') should be http://another/path. Was http://Another/path.
PASS canonicalize('/c:\\foo') is 'http://host/c:/foo'
-FAIL canonicalize('//c:\\foo') should be http://c/foo. Was http://c:/foo.
+PASS canonicalize('//c:\\foo') is 'http://c/foo'
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/url/relative-win-expected.txt b/LayoutTests/fast/url/relative-win-expected.txt
index 733f815..1cb8d67 100644
--- a/LayoutTests/fast/url/relative-win-expected.txt
+++ b/LayoutTests/fast/url/relative-win-expected.txt
@@ -8,7 +8,7 @@ PASS canonicalize('bar') is 'file:///C:/bar'
FAIL canonicalize('../../../bar.html') should be file:///C:/bar.html. Was file:///bar.html.
FAIL canonicalize('/../bar.html') should be file:///C:/bar.html. Was file:///bar.html.
FAIL canonicalize('\\\\another\\path') should be . Was http://another/path.
-FAIL canonicalize('//c:/foo') should be file:///C:/foo. Was file://c:/foo.
+FAIL canonicalize('//c:/foo') should be file:///C:/foo. Was file://c/foo.
FAIL canonicalize('//localhost/c:/foo') should be file:///C:/foo. Was file:///c:/foo.
FAIL canonicalize('c:') should be . Was c:.
FAIL canonicalize('c:/foo') should be . Was c:/foo.
diff --git a/LayoutTests/fast/url/scheme-expected.txt b/LayoutTests/fast/url/scheme-expected.txt
index 8709b81..fbc130d 100644
--- a/LayoutTests/fast/url/scheme-expected.txt
+++ b/LayoutTests/fast/url/scheme-expected.txt
@@ -4,7 +4,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS canonicalize('http://example.com/') is 'http://example.com/'
-FAIL canonicalize('HTTP://example.com/') should be http://example.com/. Was HTTP://example.com/.
+PASS canonicalize('HTTP://example.com/') is 'http://example.com/'
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/fast/url/script-tests/anchor.js b/LayoutTests/fast/url/script-tests/anchor.js
index 0387a86..8791b74 100644
--- a/LayoutTests/fast/url/script-tests/anchor.js
+++ b/LayoutTests/fast/url/script-tests/anchor.js
@@ -9,6 +9,7 @@ cases = [
["a\\uFDD0", "a\\uFDD0"],
["asdf#qwer", "asdf#qwer"],
["#asdf", "#asdf"],
+ ["a\\nb\\rc\\td", "abcd"],
];
for (var i = 0; i < cases.length; ++i) {
diff --git a/LayoutTests/fast/url/script-tests/path.js b/LayoutTests/fast/url/script-tests/path.js
index 10aaf4d..fb082ad 100644
--- a/LayoutTests/fast/url/script-tests/path.js
+++ b/LayoutTests/fast/url/script-tests/path.js
@@ -23,6 +23,9 @@ cases = [
// Multiple slashes in a row should be preserved and treated like empty
// directory names.
["////../..", "//"],
+ ["/foo/bar//../..", "/foo/"],
+ ["/foo/bar//..", "/foo/bar/"],
+ ["/foo/bar/..", "/foo/"],
// ----- escaping tests -----
["/foo", "/foo"],
diff --git a/LayoutTests/fast/url/script-tests/port.js b/LayoutTests/fast/url/script-tests/port.js
index b3228b1..e9e6057 100644
--- a/LayoutTests/fast/url/script-tests/port.js
+++ b/LayoutTests/fast/url/script-tests/port.js
@@ -7,6 +7,8 @@ cases = [
// Default port should be omitted.
["80", ""],
["8080", ":8080"],
+ // Empty ports (just a colon) should also be removed
+ ["", ""],
];
for (var i = 0; i < cases.length; ++i) {
diff --git a/LayoutTests/fast/url/segments-expected.txt b/LayoutTests/fast/url/segments-expected.txt
index 2da6912..659be5f 100644
--- a/LayoutTests/fast/url/segments-expected.txt
+++ b/LayoutTests/fast/url/segments-expected.txt
@@ -8,7 +8,7 @@ PASS segments('http:foo.com') is '["http:","example.org","0","/foo/foo.com","","
PASS segments('\t :foo.com \n') is '["http:","example.org","0","/foo/:foo.com","",""]'
PASS segments(' foo.com ') is '["http:","example.org","0","/foo/foo.com","",""]'
PASS segments('a:\t foo.com') is '["a:","","0"," foo.com","",""]'
-FAIL segments('http://f:21/ b ? d # e ') should be ["http:","f","21","/%20b%20","?%20d%20","# e"]. Was ["http:","f","21","/ b ","?%20d%20","#%20e"].
+FAIL segments('http://f:21/ b ? d # e ') should be ["http:","f","21","/%20b%20","?%20d%20","# e"]. Was ["http:","f","21","/ b ","?%20d%20","# e"].
PASS segments('http://f:/c') is '["http:","f","0","/c","",""]'
PASS segments('http://f:0/c') is '["http:","f","0","/c","",""]'
PASS segments('http://f:00000000000000/c') is '["http:","f","0","/c","",""]'
@@ -55,7 +55,7 @@ PASS segments('foo://///////bar.com/') is '["foo:","","0","/////////bar.com/",""
PASS segments('foo:////://///') is '["foo:","","0","////://///","",""]'
PASS segments('c:/foo') is '["c:","","0","/foo","",""]'
PASS segments('//foo/bar') is '["http:","foo","0","/bar","",""]'
-FAIL segments('http://foo/path;a??e#f#g') should be ["http:","foo","0","/path;a","??e","#f#g"]. Was ["http:","foo","0","/path;a","??e","#f%23g"].
+PASS segments('http://foo/path;a??e#f#g') is '["http:","foo","0","/path;a","??e","#f#g"]'
PASS segments('http://foo/abcd?efgh?ijkl') is '["http:","foo","0","/abcd","?efgh?ijkl",""]'
PASS segments('http://foo/abcd#foo?bar') is '["http:","foo","0","/abcd","","#foo?bar"]'
PASS segments('[61:24:74]:98') is '["http:","example.org","0","/foo/[61:24:74]:98","",""]'
@@ -67,7 +67,7 @@ PASS segments('http://[2001::1') is '[":","","0","","",""]'
PASS segments('http://2001::1]') is '[":","","0","","",""]'
PASS segments('http://2001::1]:80') is '[":","","0","","",""]'
PASS segments('http://[2001::1]') is '["http:","[2001::1]","0","/","",""]'
-FAIL segments('http://[2001::1]:80') should be ["http:","[2001::1]","0","/","",""]. Was ["http:","[2001::1]","80","/","",""].
+PASS segments('http://[2001::1]:80') is '["http:","[2001::1]","0","/","",""]'
PASS segments('http://[[::]]') is '[":","","0","","",""]'
PASS successfullyParsed is true
diff --git a/LayoutTests/fast/url/segments-from-data-url-expected.txt b/LayoutTests/fast/url/segments-from-data-url-expected.txt
index 6e1853e..b97e489 100644
--- a/LayoutTests/fast/url/segments-from-data-url-expected.txt
+++ b/LayoutTests/fast/url/segments-from-data-url-expected.txt
@@ -8,7 +8,7 @@ FAIL segments('http:foo.com') should be ["http:","foo.com","0","/","",""]. Was [
PASS segments('\t :foo.com \n') is '[":","","0","","",""]'
PASS segments(' foo.com ') is '[":","","0","","",""]'
PASS segments('a:\t foo.com') is '["a:","","0"," foo.com","",""]'
-FAIL segments('http://f:21/ b ? d # e ') should be ["http:","f","21","/%20b%20","?%20d%20","# e"]. Was ["http:","f","21","/ b ","?%20d%20","#%20e"].
+FAIL segments('http://f:21/ b ? d # e ') should be ["http:","f","21","/%20b%20","?%20d%20","# e"]. Was ["http:","f","21","/ b ","?%20d%20","# e"].
PASS segments('http://f:/c') is '["http:","f","0","/c","",""]'
PASS segments('http://f:0/c') is '["http:","f","0","/c","",""]'
PASS segments('http://f:00000000000000/c') is '["http:","f","0","/c","",""]'
@@ -55,7 +55,7 @@ PASS segments('foo://///////bar.com/') is '["foo:","","0","/////////bar.com/",""
PASS segments('foo:////://///') is '["foo:","","0","////://///","",""]'
PASS segments('c:/foo') is '["c:","","0","/foo","",""]'
PASS segments('//foo/bar') is '[":","","0","","",""]'
-FAIL segments('http://foo/path;a??e#f#g') should be ["http:","foo","0","/path;a","??e","#f#g"]. Was ["http:","foo","0","/path;a","??e","#f%23g"].
+PASS segments('http://foo/path;a??e#f#g') is '["http:","foo","0","/path;a","??e","#f#g"]'
PASS segments('http://foo/abcd?efgh?ijkl') is '["http:","foo","0","/abcd","?efgh?ijkl",""]'
PASS segments('http://foo/abcd#foo?bar') is '["http:","foo","0","/abcd","","#foo?bar"]'
FAIL segments('[61:24:74]:98') should be ["data:","","0","text/[61:24:74]:98","",""]. Was [":","","0","","",""].
@@ -67,7 +67,7 @@ PASS segments('http://[2001::1') is '[":","","0","","",""]'
PASS segments('http://2001::1]') is '[":","","0","","",""]'
PASS segments('http://2001::1]:80') is '[":","","0","","",""]'
PASS segments('http://[2001::1]') is '["http:","[2001::1]","0","/","",""]'
-FAIL segments('http://[2001::1]:80') should be ["http:","[2001::1]","0","/","",""]. Was ["http:","[2001::1]","80","/","",""].
+PASS segments('http://[2001::1]:80') is '["http:","[2001::1]","0","/","",""]'
PASS segments('http://[[::]]') is '[":","","0","","",""]'
PASS successfullyParsed is true
diff --git a/LayoutTests/fast/url/standard-url-expected.txt b/LayoutTests/fast/url/standard-url-expected.txt
index 18a5117..5312e07 100644
--- a/LayoutTests/fast/url/standard-url-expected.txt
+++ b/LayoutTests/fast/url/standard-url-expected.txt
@@ -12,23 +12,23 @@ PASS canonicalize('http://user:pass@/') is 'http://user:pass@/'
PASS canonicalize('http://%25DOMAIN:foobar@foodomain.com/') is 'http://%25DOMAIN:foobar@foodomain.com/'
PASS canonicalize('http:\\\\www.google.com\\foo') is 'http://www.google.com/foo'
FAIL canonicalize('http://www.google.com/asdf#\ud800') should be http://www.google.com/asdf#�. Was http://www.google.com/asdf#%26%2355296%3B.
-FAIL canonicalize('http://foo:80/') should be http://foo/. Was http://foo:80/.
+PASS canonicalize('http://foo:80/') is 'http://foo/'
PASS canonicalize('http://foo:81/') is 'http://foo:81/'
PASS canonicalize('httpa://foo:80/') is 'httpa://foo:80/'
PASS canonicalize('http://foo:-80/') is 'http://foo:-80/'
-FAIL canonicalize('https://foo:443/') should be https://foo/. Was https://foo:443/.
+PASS canonicalize('https://foo:443/') is 'https://foo/'
PASS canonicalize('https://foo:80/') is 'https://foo:80/'
-FAIL canonicalize('ftp://foo:21/') should be ftp://foo/. Was ftp://foo:21/.
+PASS canonicalize('ftp://foo:21/') is 'ftp://foo/'
PASS canonicalize('ftp://foo:80/') is 'ftp://foo:80/'
-FAIL canonicalize('gopher://foo:70/') should be gopher://foo/. Was gopher://foo:70/.
+PASS canonicalize('gopher://foo:70/') is 'gopher://foo/'
PASS canonicalize('gopher://foo:443/') is 'gopher://foo:443/'
-FAIL canonicalize('ws://foo:80/') should be ws://foo/. Was ws://foo:80/.
+PASS canonicalize('ws://foo:80/') is 'ws://foo/'
PASS canonicalize('ws://foo:81/') is 'ws://foo:81/'
PASS canonicalize('ws://foo:443/') is 'ws://foo:443/'
PASS canonicalize('ws://foo:815/') is 'ws://foo:815/'
PASS canonicalize('wss://foo:80/') is 'wss://foo:80/'
PASS canonicalize('wss://foo:81/') is 'wss://foo:81/'
-FAIL canonicalize('wss://foo:443/') should be wss://foo/. Was wss://foo:443/.
+PASS canonicalize('wss://foo:443/') is 'wss://foo/'
PASS canonicalize('wss://foo:815/') is 'wss://foo:815/'
PASS successfullyParsed is true
diff --git a/LayoutTests/http/conf/apache2-msys-httpd.conf b/LayoutTests/http/conf/apache2-msys-httpd.conf
new file mode 100644
index 0000000..9b14992
--- /dev/null
+++ b/LayoutTests/http/conf/apache2-msys-httpd.conf
@@ -0,0 +1,709 @@
+##
+## httpd.conf -- Apache HTTP server configuration file
+##
+
+#
+# Based upon the NCSA server configuration files originally by Rob McCool.
+#
+# This is the main Apache server configuration file. It contains the
+# configuration directives that give the server its instructions.
+# See <URL:http://httpd.apache.org/docs/> for detailed information about
+# the directives.
+#
+# Do NOT simply read the instructions in here without understanding
+# what they do. They're here only as hints or reminders. If you are unsure
+# consult the online docs. You have been warned.
+#
+# After this file is processed, the server will look for and process
+# /private/etc/apache2/srm.conf and then /private/etc/apache2/access.conf
+# unless you have overridden these with ResourceConfig and/or
+# AccessConfig directives here.
+#
+# The configuration directives are grouped into three basic sections:
+# 1. Directives that control the operation of the Apache server process as a
+# whole (the 'global environment').
+# 2. Directives that define the parameters of the 'main' or 'default' server,
+# which responds to requests that aren't handled by a virtual host.
+# These directives also provide default values for the settings
+# of all virtual hosts.
+# 3. Settings for virtual hosts, which allow Web requests to be sent to
+# different IP addresses or hostnames and have them handled by the
+# same Apache server process.
+#
+# Configuration and logfile names: If the filenames you specify for many
+# of the server's control files begin with "/" (or "drive:/" for Win32), the
+# server will use that explicit path. If the filenames do *not* begin
+# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
+# with ServerRoot set to "/usr/local/apache" will be interpreted by the
+# server as "/usr/local/apache/logs/foo.log".
+#
+
+### Section 1: Global Environment
+#
+# The directives in this section affect the overall operation of Apache,
+# such as the number of concurrent requests it can handle or where it
+# can find its configuration files.
+#
+
+#
+# ServerRoot: The top of the directory tree under which the server's
+# configuration, error, and log files are kept.
+#
+# NOTE! If you intend to place this on an NFS (or otherwise network)
+# mounted filesystem then please read the LockFile documentation
+# (available at <URL:http://www.apache.org/docs/mod/core.html#lockfile>);
+# you will save yourself a lot of trouble.
+#
+ServerRoot "C:/Program Files/Apache Software Foundation/Apache2.2"
+
+#
+# The LockFile directive sets the path to the lockfile used when Apache
+# is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or
+# USE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be left at
+# its default value. The main reason for changing it is if the logs
+# directory is NFS mounted, since the lockfile MUST BE STORED ON A LOCAL
+# DISK. The PID of the main server process is automatically appended to
+# the filename.
+#
+#LockFile "/tmp/WebKit/httpd.lock"
+
+#
+# PidFile: The file in which the server should record its process
+# identification number when it starts.
+#
+PidFile "/tmp/WebKit/httpd.pid"
+
+#
+# ScoreBoardFile: File used to store internal server process information.
+# Not all architectures require this. But if yours does (you'll know because
+# this file will be created when you run Apache) then you *must* ensure that
+# no two invocations of Apache share the same scoreboard file.
+#
+ScoreBoardFile "/tmp/WebKit/httpd.scoreboard"
+
+#
+# Timeout: The number of seconds before receives and sends time out.
+#
+Timeout 300
+
+#
+# KeepAlive: Whether or not to allow persistent connections (more than
+# one request per connection). Set to "Off" to deactivate.
+#
+KeepAlive On
+
+#
+# MaxKeepAliveRequests: The maximum number of requests to allow
+# during a persistent connection. Set to 0 to allow an unlimited amount.
+# We recommend you leave this number high, for maximum performance.
+#
+MaxKeepAliveRequests 100
+
+#
+# KeepAliveTimeout: Number of seconds to wait for the next request from the
+# same client on the same connection.
+#
+KeepAliveTimeout 15
+
+#
+# Server-pool size regulation. Rather than making you guess how many
+# server processes you need, Apache dynamically adapts to the load it
+# sees --- that is, it tries to maintain enough server processes to
+# handle the current load, plus a few spare servers to handle transient
+# load spikes (e.g., multiple simultaneous requests from a single
+# Netscape browser).
+#
+# It does this by periodically checking how many servers are waiting
+# for a request. If there are fewer than MinSpareServers, it creates
+# a new spare. If there are more than MaxSpareServers, some of the
+# spares die off. The default values are probably OK for most sites.
+#
+#MinSpareServers 1
+#MaxSpareServers 5
+
+#
+# Number of servers to start initially --- should be a reasonable ballpark
+# figure.
+#
+#StartServers 1
+
+#
+# Limit on total number of servers running, i.e., limit on the number
+# of clients who can simultaneously connect --- if this limit is ever
+# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
+# It is intended mainly as a brake to keep a runaway server from taking
+# the system with it as it spirals down...
+#
+#MaxClients 150
+
+#
+# MaxRequestsPerChild: the number of requests each child process is
+# allowed to process before the child dies. The child will exit so
+# as to avoid problems after prolonged use when Apache (and maybe the
+# libraries it uses) leak memory or other resources. On most systems, this
+# isn't really needed, but a few (such as Solaris) do have notable leaks
+# in the libraries. For these platforms, set to something like 10000
+# or so; a setting of 0 means unlimited.
+#
+# NOTE: This value does not include keepalive requests after the initial
+# request per connection. For example, if a child process handles
+# an initial request and 10 subsequent "keptalive" requests, it
+# would only count as 1 request towards this limit.
+#
+#MaxRequestsPerChild 100000
+
+#
+# Listen: Allows you to bind Apache to specific IP addresses and/or
+# ports, instead of the default. See also the <VirtualHost>
+# directive.
+#
+# Configured from the httpd command line for WebKit layout tests.
+# Port 8443 is hard-coded as it is needed for the HTTPS configuration later on.
+#
+#Listen 3000
+Listen 127.0.0.1:8080
+Listen 127.0.0.1:8443
+# We listen to both IPv4 and IPv6 loop-back addresses, but ignore
+# requests to 8000 from random users on network.
+# See https://bugs.webkit.org/show_bug.cgi?id=37104
+#Listen [::1]:8000
+#Listen [::1]:8080
+#Listen [::1]:8443
+
+#
+# Dynamic Shared Object (DSO) Support
+#
+# To be able to use the functionality of a module which was built as a DSO you
+# have to place corresponding `LoadModule' lines at this location so the
+# directives contained in it are actually available _before_ they are used.
+# Please read the file http://httpd.apache.org/docs/dso.html for more
+# details about the DSO mechanism and run `httpd -l' for the list of already
+# built-in (statically linked and thus always available) modules in your httpd
+# binary.
+#
+# Note: The order in which modules are loaded is important. Don't change
+# the order below without expert advice.
+#
+# Example:
+# LoadModule foo_module libexec/mod_foo.so
+#LoadModule authn_file_module modules/mod_authn_file.so
+#LoadModule authn_dbm_module modules/mod_authn_dbm.so
+#LoadModule authn_anon_module modules/mod_authn_anon.so
+#LoadModule authn_dbd_module modules/mod_authn_dbd.so
+#LoadModule authn_default_module modules/mod_authn_default.so
+LoadModule authz_host_module modules/mod_authz_host.so
+#LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
+#LoadModule authz_user_module modules/mod_authz_user.so
+#LoadModule authz_dbm_module modules/mod_authz_dbm.so
+#LoadModule authz_owner_module modules/mod_authz_owner.so
+#LoadModule authz_default_module modules/mod_authz_default.so
+#LoadModule auth_basic_module modules/mod_auth_basic.so
+#LoadModule auth_digest_module modules/mod_auth_digest.so
+#LoadModule cache_module modules/mod_cache.so
+#LoadModule disk_cache_module modules/mod_disk_cache.so
+#LoadModule mem_cache_module modules/mod_mem_cache.so
+#LoadModule dbd_module modules/mod_dbd.so
+#LoadModule dumpio_module modules/mod_dumpio.so
+#LoadModule ext_filter_module modules/mod_ext_filter.so
+LoadModule include_module modules/mod_include.so
+#LoadModule filter_module modules/mod_filter.so
+#LoadModule substitute_module modules/mod_substitute.so
+#LoadModule deflate_module modules/mod_deflate.so
+LoadModule log_config_module modules/mod_log_config.so
+#LoadModule log_forensic_module modules/mod_log_forensic.so
+#LoadModule logio_module modules/mod_logio.so
+#LoadModule env_module modules/mod_env.so
+#LoadModule mime_magic_module modules/mod_mime_magic.so
+#LoadModule cern_meta_module modules/mod_cern_meta.so
+#LoadModule expires_module modules/mod_expires.so
+LoadModule headers_module modules/mod_headers.so
+#LoadModule ident_module modules/mod_ident.so
+#LoadModule usertrack_module modules/mod_usertrack.so
+#LoadModule unique_id_module modules/mod_unique_id.so
+#LoadModule setenvif_module modules/mod_setenvif.so
+#LoadModule version_module modules/mod_version.so
+#LoadModule proxy_module modules/mod_proxy.so
+#LoadModule proxy_connect_module modules/mod_proxy_connect.so
+#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
+#LoadModule proxy_http_module modules/mod_proxy_http.so
+#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
+#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
+LoadModule ssl_module modules/mod_ssl.so
+LoadModule mime_module modules/mod_mime.so
+#LoadModule dav_module modules/mod_dav.so
+#LoadModule status_module modules/mod_status.so
+LoadModule autoindex_module modules/mod_autoindex.so
+LoadModule asis_module modules/mod_asis.so
+#LoadModule info_module modules/mod_info.so
+LoadModule cgi_module modules/mod_cgi.so
+#LoadModule dav_fs_module modules/mod_dav_fs.so
+#LoadModule vhost_alias_module modules/mod_vhost_alias.so
+LoadModule negotiation_module modules/mod_negotiation.so
+#LoadModule dir_module modules/mod_dir.so
+LoadModule imagemap_module modules/mod_imagemap.so
+LoadModule actions_module modules/mod_actions.so
+#LoadModule speling_module modules/mod_speling.so
+#LoadModule userdir_module modules/mod_userdir.so
+LoadModule alias_module modules/mod_alias.so
+LoadModule rewrite_module modules/mod_rewrite.so
+#LoadModule bonjour_module modules/mod_bonjour.so
+#LoadModule php5_module modules/php5apache2_2.dll
+#LoadModule fastcgi_module modules/mod_fastcgi.so
+#LoadModule isapi_module modules/mod_isapi.so
+
+### Section 2: 'Main' server configuration
+#
+# The directives in this section set up the values used by the 'main'
+# server, which responds to any requests that aren't handled by a
+# <VirtualHost> definition. These values also provide defaults for
+# any <VirtualHost> containers you may define later in the file.
+#
+# All of these directives may appear inside <VirtualHost> containers,
+# in which case these default settings will be overridden for the
+# virtual host being defined.
+#
+
+#
+# ServerName allows you to set a host name which is sent back to clients for
+# your server if it's different than the one the program would get (i.e., use
+# "www" instead of the host's real name).
+#
+# Note: You cannot just invent host names and hope they work. The name you
+# define here must be a valid DNS name for your host. If you don't understand
+# this, ask your network administrator.
+# If your host doesn't have a registered DNS name, enter its IP address here.
+# You will have to access it by its address (e.g., http://123.45.67.89/)
+# anyway, and this will make redirections work in a sensible way.
+#
+# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your
+# machine always knows itself by this address. If you use Apache strictly for
+# local testing and development, you may use 127.0.0.1 as the server name.
+#
+ServerName 127.0.0.1
+
+#
+# DocumentRoot: The directory out of which you will serve your
+# documents. By default, all requests are taken from this directory, but
+# symbolic links and aliases may be used to point to other locations.
+#
+# Configured from the httpd command line for WebKit layout tests.
+#DocumentRoot "/Library/WebServer/Documents"
+
+#
+# Each directory to which Apache has access, can be configured with respect
+# to which services and features are allowed and/or disabled in that
+# directory (and its subdirectories).
+#
+<Directory />
+#
+# This may also be "None", "All", or any combination of "Indexes",
+# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
+#
+# Note that "MultiViews" must be named *explicitly* --- "Options All"
+# doesn't give it to you.
+#
+ Options Indexes FollowSymLinks MultiViews ExecCGI Includes
+
+#
+# This controls which options the .htaccess files in directories can
+# override. Can also be "All", or any combination of "Options", "FileInfo",
+# "AuthConfig", and "Limit"
+#
+ AllowOverride All
+
+#
+# Controls who can get stuff from this server.
+#
+ Order allow,deny
+ Allow from all
+</Directory>
+
+#
+# AccessFileName: The name of the file to look for in each directory
+# for access control information.
+#
+AccessFileName .htaccess
+
+#
+# The following lines prevent .htaccess files from being viewed by
+# Web clients. Since .htaccess files often contain authorization
+# information, access is disallowed for security reasons. Comment
+# these lines out if you want Web visitors to see the contents of
+# .htaccess files. If you change the AccessFileName directive above,
+# be sure to make the corresponding changes here.
+#
+# Also, folks tend to use names such as .htpasswd for password
+# files, so this will protect those as well.
+#
+<Files ~ "^\.([Hh][Tt]|[Dd][Ss]_[Ss])">
+ Order allow,deny
+ Deny from all
+ Satisfy All
+</Files>
+
+#
+# Apple specific filesystem protection.
+#
+
+<Files "rsrc">
+ Order allow,deny
+ Deny from all
+ Satisfy All
+</Files>
+
+<Directory ~ ".*\.\.namedfork">
+ Order allow,deny
+ Deny from all
+ Satisfy All
+</Directory>
+
+#
+# CacheNegotiatedDocs: By default, Apache sends "Pragma: no-cache" with each
+# document that was negotiated on the basis of content. This asks proxy
+# servers not to cache the document. Uncommenting the following line disables
+# this behavior, and proxies will be allowed to cache the documents.
+#
+#CacheNegotiatedDocs
+
+#
+# UseCanonicalName: (new for 1.3) With this setting turned on, whenever
+# Apache needs to construct a self-referencing URL (a URL that refers back
+# to the server the response is coming from) it will use ServerName and
+# Port to form a "canonical" name. With this setting off, Apache will
+# use the hostname:port that the client supplied, when possible. This
+# also affects SERVER_NAME and SERVER_PORT in CGI scripts.
+#
+UseCanonicalName On
+
+#
+# TypesConfig describes where the mime.types file (or equivalent) is
+# to be found.
+#
+# Configured from the httpd command line for WebKit layout tests.
+#
+#<IfModule mod_mime.c>
+# TypesConfig /private/etc/apache2/mime.types
+#</IfModule>
+
+#
+# DefaultType is the default MIME type the server will use for a document
+# if it cannot otherwise determine one, such as from filename extensions.
+# If your server contains mostly text or HTML documents, "text/plain" is
+# a good value. If most of your content is binary, such as applications
+# or images, you may want to use "application/octet-stream" instead to
+# keep browsers from trying to display binary files as though they are
+# text.
+#
+DefaultType text/plain
+
+#
+# HostnameLookups: Log the names of clients or just their IP addresses
+# e.g., www.apache.org (on) or 204.62.129.132 (off).
+# The default is off because it'd be overall better for the net if people
+# had to knowingly turn this feature on, since enabling it means that
+# each client request will result in AT LEAST one lookup request to the
+# nameserver.
+#
+HostnameLookups Off
+
+#
+# ErrorLog: The location of the error log file.
+# If you do not specify an ErrorLog directive within a <VirtualHost>
+# container, error messages relating to that virtual host will be
+# logged here. If you *do* define an error logfile for a <VirtualHost>
+# container, that host's errors will be logged there and not here.
+#
+# Configured from the httpd command line for WebKit layout tests.
+#ErrorLog "/tmp/layout-test-results/error_log"
+
+#
+# LogLevel: Control the number of messages logged to the error_log.
+# Possible values include: debug, info, notice, warn, error, crit,
+# alert, emerg.
+#
+LogLevel warn
+
+#
+# The following directives define some format nicknames for use with
+# a CustomLog directive (see below).
+#
+LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
+LogFormat "%h %l %u %t \"%r\" %>s %b" common
+LogFormat "%{Referer}i -> %U" referer
+LogFormat "%{User-agent}i" agent
+
+#
+# The location and format of the access logfile (Common Logfile Format).
+# If you do not define any access logfiles within a <VirtualHost>
+# container, they will be logged here. Contrariwise, if you *do*
+# define per-<VirtualHost> access logfiles, transactions will be
+# logged therein and *not* in this file.
+#
+# Configured from the httpd command line for WebKit layout tests.
+#CustomLog "/tmp/layout-test-results/access_log" common
+
+#
+# If you prefer a single logfile with access, agent, and referer information
+# (Combined Logfile Format) you can use the following directive.
+#
+#CustomLog "/tmp/layout-test-results/access_log" combined
+
+#
+# Optionally add a line containing the server version and virtual host
+# name to server-generated pages (error documents, FTP directory listings,
+# mod_status and mod_info output etc., but not CGI generated documents).
+# Set to "EMail" to also include a mailto: link to the ServerAdmin.
+# Set to one of: On | Off | EMail
+#
+ServerSignature On
+
+#
+# Aliases: Add here as many aliases as you need (with no limit). The format is
+# Alias fakename realname
+#
+<IfModule mod_alias.c>
+</IfModule>
+# End of aliases.
+
+#
+# Redirect allows you to tell clients about documents which used to exist in
+# your server's namespace, but do not anymore. This allows you to tell the
+# clients where to look for the relocated document.
+# Format: Redirect old-URI new-URL
+#
+
+#
+# Document types.
+#
+<IfModule mod_mime.c>
+
+ #
+ # AddLanguage allows you to specify the language of a document. You can
+ # then use content negotiation to give a browser a file in a language
+ # it can understand.
+ #
+ # Note 1: The suffix does not have to be the same as the language
+ # keyword --- those with documents in Polish (whose net-standard
+ # language code is pl) may wish to use "AddLanguage pl .po" to
+ # avoid the ambiguity with the common suffix for perl scripts.
+ #
+ # Note 2: The example entries below illustrate that in quite
+ # some cases the two character 'Language' abbreviation is not
+ # identical to the two character 'Country' code for its country,
+ # E.g. 'Danmark/dk' versus 'Danish/da'.
+ #
+ # Note 3: In the case of 'ltz' we violate the RFC by using a three char
+ # specifier. But there is 'work in progress' to fix this and get
+ # the reference data for rfc1766 cleaned up.
+ #
+ # Danish (da) - Dutch (nl) - English (en) - Estonian (ee)
+ # French (fr) - German (de) - Greek-Modern (el)
+ # Italian (it) - Korean (kr) - Norwegian (no) - Norwegian Nynorsk (nn)
+ # Portugese (pt) - Luxembourgeois* (ltz)
+ # Spanish (es) - Swedish (sv) - Catalan (ca) - Czech(cs)
+ # Polish (pl) - Brazilian Portuguese (pt-br) - Japanese (ja)
+ # Russian (ru)
+ #
+ AddLanguage da .dk
+ AddLanguage nl .nl
+ AddLanguage en .en
+ AddLanguage et .ee
+ AddLanguage fr .fr
+ AddLanguage de .de
+ AddLanguage el .el
+ AddLanguage he .he
+ AddCharset ISO-8859-8 .iso8859-8
+ AddLanguage it .it
+ AddLanguage ja .ja
+ AddCharset ISO-2022-JP .jis
+ AddLanguage kr .kr
+ AddCharset ISO-2022-KR .iso-kr
+ AddLanguage nn .nn
+ AddLanguage no .no
+ AddLanguage pl .po
+ AddCharset ISO-8859-2 .iso-pl
+ AddLanguage pt .pt
+ AddLanguage pt-br .pt-br
+ AddLanguage ltz .lu
+ AddLanguage ca .ca
+ AddLanguage es .es
+ AddLanguage sv .sv
+ AddLanguage cs .cz .cs
+ AddLanguage ru .ru
+ AddLanguage zh-TW .zh-tw
+ AddCharset Big5 .Big5 .big5
+ AddCharset WINDOWS-1251 .cp-1251
+ AddCharset CP866 .cp866
+ AddCharset ISO-8859-5 .iso-ru
+ AddCharset KOI8-R .koi8-r
+ AddCharset UCS-2 .ucs2
+ AddCharset UCS-4 .ucs4
+ AddCharset UTF-8 .utf8
+
+ # LanguagePriority allows you to give precedence to some languages
+ # in case of a tie during content negotiation.
+ #
+ # Just list the languages in decreasing order of preference. We have
+ # more or less alphabetized them here. You probably want to change this.
+ #
+ <IfModule mod_negotiation.c>
+ LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw
+ </IfModule>
+
+ #
+ # AddType allows you to tweak mime.types without actually editing it, or to
+ # make certain files to be certain types.
+ #
+ AddType application/x-tar .tgz
+
+ #
+ # AddEncoding allows you to have certain browsers uncompress
+ # information on the fly. Note: Not all browsers support this.
+ # Despite the name similarity, the following Add* directives have nothing
+ # to do with the FancyIndexing customization directives above.
+ #
+ AddEncoding x-compress .Z
+ AddEncoding x-gzip .gz .tgz
+ #
+ # If the AddEncoding directives above are commented-out, then you
+ # probably should define those extensions to indicate media types:
+ #
+ #AddType application/x-compress .Z
+ #AddType application/x-gzip .gz .tgz
+
+ #
+ # AddHandler allows you to map certain file extensions to "handlers",
+ # actions unrelated to filetype. These can be either built into the server
+ # or added with the Action command (see below)
+ #
+ # If you want to use server side includes, or CGI outside
+ # ScriptAliased directories, uncomment the following lines.
+ #
+ # To use CGI scripts:
+ #
+ AddHandler cgi-script .cgi .pl
+
+ #
+ # To use server-parsed HTML files
+ #
+ AddType text/html .shtml
+ AddHandler server-parsed .shtml
+
+ #
+ # Uncomment the following line to enable Apache's send-asis HTTP file
+ # feature
+ #
+ AddHandler send-as-is asis
+
+ #
+ # If you wish to use server-parsed imagemap files, use
+ #
+ #AddHandler imap-file map
+
+ #
+ # To enable type maps, you might want to use
+ #
+ #AddHandler type-map var
+
+</IfModule>
+# End of document types.
+
+#
+# Action lets you define media types that will execute a script whenever
+# a matching file is called. This eliminates the need for repeated URL
+# pathnames for oft-used CGI file processors.
+# Format: Action media/type /cgi-script/location
+# Format: Action handler-name /cgi-script/location
+#
+
+#
+# MetaDir: specifies the name of the directory in which Apache can find
+# meta information files. These files contain additional HTTP headers
+# to include when sending the document
+#
+#MetaDir .web
+
+#
+# MetaSuffix: specifies the file name suffix for the file containing the
+# meta information.
+#
+#MetaSuffix .meta
+
+#
+# Customizable error response (Apache style)
+# these come in three flavors
+#
+# 1) plain text
+#ErrorDocument 500 "The server made a boo boo.
+# n.b. the single leading (") marks it as text, it does not get output
+#
+# 2) local redirects
+#ErrorDocument 404 /missing.html
+# to redirect to local URL /missing.html
+#ErrorDocument 404 /cgi-bin/missing_handler.pl
+# N.B.: You can redirect to a script or a document using server-side-includes.
+#
+# 3) external redirects
+#ErrorDocument 402 http://some.other-server.com/subscription_info.html
+# N.B.: Many of the environment variables associated with the original
+# request will *not* be available to such a script.
+
+#
+# Proxy Server directives. Uncomment the following lines to
+# enable the proxy server:
+#
+#<IfModule mod_proxy.c>
+# ProxyRequests On
+
+# <Directory proxy:*>
+# Order deny,allow
+# Deny from all
+# Allow from .your-domain.com
+# </Directory>
+
+ #
+ # Enable/disable the handling of HTTP/1.1 "Via:" headers.
+ # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
+ # Set to one of: Off | On | Full | Block
+ #
+# ProxyVia On
+
+ #
+ # To enable the cache as well, edit and uncomment the following lines:
+ # (no cacheing without CacheRoot)
+ #
+# CacheRoot "/private/var/run/proxy"
+# CacheSize 5
+# CacheGcInterval 4
+# CacheMaxExpire 24
+# CacheLastModifiedFactor 0.1
+# CacheDefaultExpire 1
+# NoCache a-domain.com another-domain.edu joes.garage-sale.com
+
+#</IfModule>
+# End of proxy directives.
+
+
+<IfModule mod_php5.c>
+ # If php is turned on, we repsect .php and .phps files.
+ AddType application/x-httpd-php .php
+ AddType application/x-httpd-php .bat
+ AddType application/x-httpd-php-source .phps
+
+ # Since most users will want index.php to work we
+ # also automatically enable index.php
+ <IfModule mod_dir.c>
+ DirectoryIndex index.html index.php
+ </IfModule>
+</IfModule>
+
+<IfModule mod_rewrite.c>
+ RewriteEngine On
+ RewriteCond %{REQUEST_METHOD} ^TRACE
+ RewriteRule .* - [F]
+</IfModule>
+
+<VirtualHost *:8443>
+ ServerName 127.0.0.1
+ SSLEngine On
+</VirtualHost>
diff --git a/LayoutTests/storage/indexeddb/create-object-store-options-expected.txt b/LayoutTests/storage/indexeddb/create-object-store-options-expected.txt
index 9e727a5..5519508 100644
--- a/LayoutTests/storage/indexeddb/create-object-store-options-expected.txt
+++ b/LayoutTests/storage/indexeddb/create-object-store-options-expected.txt
@@ -17,7 +17,7 @@ Deleted all object stores.
db.createObjectStore('a', {keyPath: 'a'})
db.createObjectStore('b')
db.createObjectStore('c', {autoIncrement: true});
-trans = db.transaction({mode: webkitIDBTransaction.READ_WRITE})
+trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
PASS trans.mode is webkitIDBTransaction.READ_WRITE
trans.objectStore('a').put({'a': 0})
trans.objectStore('b').put({'a': 0}, 0)
diff --git a/LayoutTests/storage/indexeddb/create-object-store-options.html b/LayoutTests/storage/indexeddb/create-object-store-options.html
index eacb09d..6709e58 100644
--- a/LayoutTests/storage/indexeddb/create-object-store-options.html
+++ b/LayoutTests/storage/indexeddb/create-object-store-options.html
@@ -47,7 +47,7 @@ function cleaned()
debug("db.createObjectStore('c', {autoIncrement: true});");
db.createObjectStore('c', {autoIncrement: true});
- trans = evalAndLog("trans = db.transaction({mode: webkitIDBTransaction.READ_WRITE})");
+ trans = evalAndLog("trans = db.transaction([], webkitIDBTransaction.READ_WRITE)");
shouldBe("trans.mode", "webkitIDBTransaction.READ_WRITE");
req = evalAndLog("trans.objectStore('a').put({'a': 0})");
diff --git a/LayoutTests/storage/indexeddb/cursor-delete-expected.txt b/LayoutTests/storage/indexeddb/cursor-delete-expected.txt
index bed1d0d..525ced7 100644
--- a/LayoutTests/storage/indexeddb/cursor-delete-expected.txt
+++ b/LayoutTests/storage/indexeddb/cursor-delete-expected.txt
@@ -48,7 +48,7 @@ objectStore.add('myValue2', 'myKey2')
objectStore.add('myValue3', 'myKey3')
objectStore.add('myValue4', 'myKey4')
openCursor1
-trans = db.transaction({objectStoreNames: 'test', mode: webkitIDBTransaction.READ_WRITE})
+trans = db.transaction(['test'], webkitIDBTransaction.READ_WRITE)
trans.objectStore('test').openCursor({range: keyRange})
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
@@ -68,7 +68,7 @@ event.result.delete()
PASS event.result.value is "myValue4"
event.result.continue()
PASS counter is 5
-trans.objectStore('test').openCursor({range: keyRange})
+trans.objectStore('test').openCursor(keyRange)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
PASS 'readyState' in result is true
@@ -86,7 +86,7 @@ PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
PASS event.result is null
-trans = db.transaction({objectStoreNames: 'test', mode: webkitIDBTransaction.READ_WRITE})
+trans = db.transaction(['test'], webkitIDBTransaction.READ_WRITE)
objectStore = trans.objectStore('test')
objectStore.add('myValue1', 'myKey1')
PASS 'onsuccess' in result is true
@@ -95,7 +95,7 @@ PASS 'readyState' in result is true
An event should fire shortly...
openCursor2
-objectStore.openCursor({range: keyRange})
+objectStore.openCursor(keyRange)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
PASS 'readyState' in result is true
diff --git a/LayoutTests/storage/indexeddb/cursor-delete.html b/LayoutTests/storage/indexeddb/cursor-delete.html
index a3290b9..bb0102f 100644
--- a/LayoutTests/storage/indexeddb/cursor-delete.html
+++ b/LayoutTests/storage/indexeddb/cursor-delete.html
@@ -59,7 +59,7 @@ function createAndPopulateObjectStore()
function openCursor()
{
debug("openCursor1");
- evalAndLog("trans = db.transaction({objectStoreNames: 'test', mode: webkitIDBTransaction.READ_WRITE})");
+ evalAndLog("trans = db.transaction(['test'], webkitIDBTransaction.READ_WRITE)");
keyRange = webkitIDBKeyRange.lowerBound("myKey1");
result = evalAndLog("trans.objectStore('test').openCursor({range: keyRange})");
verifyResult(result);
@@ -72,7 +72,7 @@ function cursorSuccess()
{
if (event.result == null) {
shouldBe("counter", "5");
- result = evalAndLog("trans.objectStore('test').openCursor({range: keyRange})");
+ result = evalAndLog("trans.objectStore('test').openCursor(keyRange)");
verifyResult(result);
result.onsuccess = cursorEmpty;
result.onerror = unexpectedErrorCallback;
@@ -92,7 +92,7 @@ function cursorEmpty()
function addObject()
{
- evalAndLog("trans = db.transaction({objectStoreNames: 'test', mode: webkitIDBTransaction.READ_WRITE})");
+ evalAndLog("trans = db.transaction(['test'], webkitIDBTransaction.READ_WRITE)");
objectStore = evalAndLog("objectStore = trans.objectStore('test')");
result = evalAndLog("objectStore.add('myValue1', 'myKey1')");
verifyResult(result);
@@ -103,7 +103,7 @@ function addObject()
function openCursor2()
{
debug("openCursor2");
- result = evalAndLog("objectStore.openCursor({range: keyRange})");
+ result = evalAndLog("objectStore.openCursor(keyRange)");
verifyResult(result);
result.onsuccess = deleteObject;
result.onerror = unexpectedErrorCallback;
diff --git a/LayoutTests/storage/indexeddb/cursor-index-delete-expected.txt b/LayoutTests/storage/indexeddb/cursor-index-delete-expected.txt
index 27f3117..a477a25 100644
--- a/LayoutTests/storage/indexeddb/cursor-index-delete-expected.txt
+++ b/LayoutTests/storage/indexeddb/cursor-index-delete-expected.txt
@@ -49,8 +49,8 @@ objectStore.add({x: 2}, 'myKey2')
objectStore.add({x: 3}, 'myKey3')
objectStore.add({x: 4}, 'myKey4')
openCursor1
-trans = db.transaction({objectStoreNames: 'test', mode: webkitIDBTransaction.READ_WRITE})
-trans.objectStore('test').index('testIndex').openCursor({range: keyRange})
+trans = db.transaction(['test'], webkitIDBTransaction.READ_WRITE)
+trans.objectStore('test').index('testIndex').openCursor(keyRange)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
PASS 'readyState' in result is true
@@ -69,7 +69,7 @@ event.result.delete()
PASS event.result.key is counter++
event.result.continue()
PASS counter is 5
-trans.objectStore('test').index('testIndex').openCursor({range: keyRange})
+trans.objectStore('test').index('testIndex').openCursor(keyRange)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
PASS 'readyState' in result is true
@@ -87,7 +87,7 @@ PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
PASS event.result is null
-trans = db.transaction({objectStoreNames: 'test', mode: webkitIDBTransaction.READ_WRITE})
+trans = db.transaction(['test'], webkitIDBTransaction.READ_WRITE)
objectStore = trans.objectStore('test')
objectStore.add({x: 1}, 'myKey1')
PASS 'onsuccess' in result is true
@@ -97,7 +97,7 @@ An event should fire shortly...
openCursor2
index = event.source.index('testIndex')
-index.openCursor({range: keyRange})
+index.openCursor(keyRange)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
PASS 'readyState' in result is true
@@ -128,6 +128,7 @@ PASS 'onerror' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
+event.preventDefault()
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/storage/indexeddb/cursor-index-delete.html b/LayoutTests/storage/indexeddb/cursor-index-delete.html
index 1bddf63..852a7eb 100644
--- a/LayoutTests/storage/indexeddb/cursor-index-delete.html
+++ b/LayoutTests/storage/indexeddb/cursor-index-delete.html
@@ -61,9 +61,9 @@ function createAndPopulateObjectStoreAndIndex()
function openCursor()
{
debug("openCursor1");
- evalAndLog("trans = db.transaction({objectStoreNames: 'test', mode: webkitIDBTransaction.READ_WRITE})");
+ evalAndLog("trans = db.transaction(['test'], webkitIDBTransaction.READ_WRITE)");
keyRange = webkitIDBKeyRange.lowerBound(1);
- result = evalAndLog("trans.objectStore('test').index('testIndex').openCursor({range: keyRange})");
+ result = evalAndLog("trans.objectStore('test').index('testIndex').openCursor(keyRange)");
verifyResult(result);
result.onsuccess = cursorSuccess;
result.onerror = unexpectedErrorCallback;
@@ -74,7 +74,7 @@ function cursorSuccess()
{
if (event.result == null) {
shouldBe("counter", "5");
- result = evalAndLog("trans.objectStore('test').index('testIndex').openCursor({range: keyRange})");
+ result = evalAndLog("trans.objectStore('test').index('testIndex').openCursor(keyRange)");
verifyResult(result);
result.onsuccess = cursorEmpty;
result.onerror = unexpectedErrorCallback;
@@ -95,7 +95,7 @@ function cursorEmpty()
function addObject()
{
- evalAndLog("trans = db.transaction({objectStoreNames: 'test', mode: webkitIDBTransaction.READ_WRITE})");
+ evalAndLog("trans = db.transaction(['test'], webkitIDBTransaction.READ_WRITE)");
objectStore = evalAndLog("objectStore = trans.objectStore('test')");
result = evalAndLog("objectStore.add({x: 1}, 'myKey1')");
verifyResult(result);
@@ -107,7 +107,7 @@ function openCursor2()
{
debug("openCursor2");
evalAndLog("index = event.source.index('testIndex')");
- result = evalAndLog("index.openCursor({range: keyRange})");
+ result = evalAndLog("index.openCursor(keyRange)");
verifyResult(result);
result.onsuccess = deleteObject;
result.onerror = unexpectedErrorCallback;
@@ -126,6 +126,7 @@ function deleteObject()
function verifyObjectDeleted()
{
verifyErrorEvent(event);
+ evalAndLog("event.preventDefault()");
done();
}
diff --git a/LayoutTests/storage/indexeddb/cursor-skip-deleted-expected.txt b/LayoutTests/storage/indexeddb/cursor-skip-deleted-expected.txt
new file mode 100644
index 0000000..f1bb3f7
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/cursor-skip-deleted-expected.txt
@@ -0,0 +1,185 @@
+Test IndexedDB's cursor skips deleted entries.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+webkitIndexedDB.open('name')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+db = event.result
+db.setVersion('new version')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+setVersionSuccess():
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+trans = event.result
+PASS trans !== null is true
+Deleted all object stores.
+createAndPopulateObjectStore():
+objectStore = db.createObjectStore('store', {keyPath: 'id'})
+objectStore.createIndex('nameIndex', 'name')
+
+resetObjectStore():
+
+basicCursorTest()
+trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
+
+testCursor():
+trans.objectStore('store').openCursor(webkitIDBKeyRange.lowerBound(0))
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+0: Alpha
+1: Bravo
+request = trans.objectStore('store').delete(0)
+2: Charlie
+request = trans.objectStore('store').delete(25)
+3: Delta
+request = trans.objectStore('store').delete(5)
+request = trans.objectStore('store').delete(6)
+request = trans.objectStore('store').delete(7)
+4: Echo
+8: India
+9: Juliet
+10: Kilo
+request = trans.objectStore('store').delete(10)
+11: Lima
+12: Mike
+request = trans.objectStore('store').delete(13)
+14: Oscar
+15: Papa
+request = trans.objectStore('store').delete(14)
+16: Quebec
+17: Romeo
+18: Sierra
+19: Tango
+20: Uniform
+request = trans.objectStore('store').delete(17)
+request = trans.objectStore('store').delete(18)
+21: Victor
+22: Whiskey
+23: X-ray
+24: Yankee
+
+
+resetObjectStore():
+
+reverseCursorTest():
+
+testCursor():
+trans.objectStore('store').openCursor(webkitIDBKeyRange.lowerBound(0), webkitIDBCursor.PREV)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+25: Zulu
+24: Yankee
+request = trans.objectStore('store').delete(25)
+23: X-ray
+request = trans.objectStore('store').delete(0)
+22: Whiskey
+request = trans.objectStore('store').delete(20)
+request = trans.objectStore('store').delete(19)
+request = trans.objectStore('store').delete(18)
+21: Victor
+17: Romeo
+16: Quebec
+15: Papa
+request = trans.objectStore('store').delete(15)
+14: Oscar
+13: November
+request = trans.objectStore('store').delete(12)
+11: Lima
+10: Kilo
+request = trans.objectStore('store').delete(11)
+9: Juliet
+8: India
+7: Hotel
+6: Golf
+5: Foxtrot
+request = trans.objectStore('store').delete(7)
+request = trans.objectStore('store').delete(8)
+4: Echo
+3: Delta
+2: Charlie
+1: Bravo
+
+
+resetObjectStore():
+
+indexCursorTest():
+
+testCursor():
+trans.objectStore('store').index('nameIndex').openCursor(webkitIDBKeyRange.lowerBound('Alpha'))
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+0: Alpha
+1: Bravo
+request = trans.objectStore('store').delete(0)
+2: Charlie
+request = trans.objectStore('store').delete(25)
+3: Delta
+request = trans.objectStore('store').delete(5)
+request = trans.objectStore('store').delete(6)
+request = trans.objectStore('store').delete(7)
+4: Echo
+8: India
+9: Juliet
+10: Kilo
+request = trans.objectStore('store').delete(10)
+11: Lima
+12: Mike
+request = trans.objectStore('store').delete(13)
+14: Oscar
+15: Papa
+request = trans.objectStore('store').delete(14)
+16: Quebec
+17: Romeo
+18: Sierra
+19: Tango
+20: Uniform
+request = trans.objectStore('store').delete(17)
+request = trans.objectStore('store').delete(18)
+21: Victor
+22: Whiskey
+23: X-ray
+24: Yankee
+
+transactionComplete():
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/indexeddb/cursor-skip-deleted.html b/LayoutTests/storage/indexeddb/cursor-skip-deleted.html
new file mode 100644
index 0000000..a97c4af
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/cursor-skip-deleted.html
@@ -0,0 +1,218 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../fast/js/resources/js-test-post-function.js"></script>
+<script src="resources/shared.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("Test IndexedDB's cursor skips deleted entries.");
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+var names = ['Alpha', 'Bravo', 'Charlie', 'Delta', 'Echo', 'Foxtrot', 'Golf',
+ 'Hotel', 'India', 'Juliet', 'Kilo', 'Lima', 'Mike', 'November',
+ 'Oscar', 'Papa', 'Quebec', 'Romeo', 'Sierra', 'Tango', 'Uniform',
+ 'Victor', 'Whiskey', 'X-ray', 'Yankee', 'Zulu'];
+
+test();
+
+function test()
+{
+ result = evalAndLog("webkitIndexedDB.open('name')");
+ verifyResult(result);
+ result.onsuccess = openSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function openSuccess()
+{
+ verifySuccessEvent(event);
+ var db = evalAndLog("db = event.result");
+
+ result = evalAndLog("db.setVersion('new version')");
+ verifyResult(result);
+ result.onsuccess = setVersionSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function setVersionSuccess()
+{
+ debug("setVersionSuccess():");
+ verifySuccessEvent(event);
+ window.trans = evalAndLog("trans = event.result");
+ shouldBeTrue("trans !== null");
+ trans.onabort = unexpectedAbortCallback;
+ trans.oncomplete = basicCursorTest;
+
+ deleteAllObjectStores(db, createAndPopulateObjectStore);
+}
+
+function createAndPopulateObjectStore()
+{
+ debug("createAndPopulateObjectStore():");
+
+ var objectStore = evalAndLog("objectStore = db.createObjectStore('store', {keyPath: 'id'})");
+ evalAndLog("objectStore.createIndex('nameIndex', 'name')");
+ resetObjectStore(function() {});
+}
+
+var silentErrorHandler = function() { event.preventDefault(); }
+
+function resetObjectStore(callback)
+{
+ debug("\nresetObjectStore():");
+ if (callback === undefined)
+ callback = function () {};
+
+ var objectStore = trans.objectStore('store');
+ for (var i = 0; i < names.length; i++)
+ objectStore.delete(i).onerror = silentErrorHandler;
+ for (var i = 0; i < names.length; i++)
+ objectStore.add({id: i, name: names[i]}).onerror = unexpectedErrorCallback;
+
+ debug("");
+ callback();
+}
+
+function contains(arr, obj)
+{
+ for (var i = 0; i < arr.length; i++) {
+ if (arr[i] == obj)
+ return true;
+ }
+ return false;
+}
+
+var cursor;
+var deleted;
+var seen;
+
+function testCursor(deleteList, createCursorCommand, callback)
+{
+ debug("\ntestCursor():");
+ deleted = [];
+ seen = [];
+
+ // Create the cursor.
+ request = evalAndLog(createCursorCommand);
+ verifyResult(request);
+
+ request.onerror = unexpectedErrorCallback;
+ request.onsuccess = function () {
+ if (event.result == null) {
+ // Make sure we have seen every non-deleted item.
+ for (var i = 0; i < names.length; i++) {
+ if (contains(deleted, i))
+ continue;
+
+ if (!contains(seen, i))
+ testFailed("Cursor did not see item with id: " + i);
+ }
+
+ // Make sure we used every rule in |deleteList|.
+ for (var i = 0; i < deleteList.length; i++) {
+ if (!contains(seen, deleteList[i].id))
+ testFailed("deleteList rule with id: " + deleteList[i].id + " was never used.");
+ }
+
+ debug("");
+ callback();
+ return;
+ }
+
+ cursor = event.result;
+ debug(event.result.value.id + ": " + event.result.value.name);
+ seen.push(event.result.value.id);
+
+ // Make sure we don't see any deleted items.
+ if (contains(deleted, event.result.value.id))
+ testFailed("Cursor hit previously deleted element.");
+
+ for (var i = 0; i < deleteList.length; i++) {
+ if (event.result.value.id == deleteList[i].id) {
+ // Delete objects targeted by this id.
+ var targets = deleteList[i].targets;
+ for (var j = 0; j < targets.length; j++) {
+ deleted.push(targets[j]);
+ request = evalAndLog("request = trans.objectStore('store').delete(" + targets[j] + ")");
+ request.onerror = unexpectedErrorCallback;
+ if (j == targets.length - 1)
+ request.onsuccess = function() { cursor.continue(); }
+ }
+ return;
+ }
+ }
+
+ cursor.continue();
+ }
+}
+
+function basicCursorTest()
+{
+ debug("basicCursorTest()");
+
+ evalAndLog("trans = db.transaction([], webkitIDBTransaction.READ_WRITE)");
+ trans.onabort = unexpectedAbortCallback;
+ trans.oncomplete = transactionComplete;
+
+ var deletes = [{id: 1, targets: [0]},
+ {id: 2, targets: [names.length - 1]},
+ {id: 3, targets: [5,6,7]},
+ {id: 10, targets: [10]},
+ {id: 12, targets: [13]},
+ {id: 15, targets: [14]},
+ {id: 20, targets: [17,18]}
+ ];
+
+ testCursor(deletes, "trans.objectStore('store').openCursor(webkitIDBKeyRange.lowerBound(0))", function() { resetObjectStore(reverseCursorTest); });
+}
+
+function reverseCursorTest()
+{
+ debug("reverseCursorTest():");
+
+ var deletes = [{id: 24, targets: [names.length - 1]},
+ {id: 23, targets: [0]},
+ {id: 22, targets: [20, 19, 18]},
+ {id: 15, targets: [15]},
+ {id: 13, targets: [12]},
+ {id: 10, targets: [11]},
+ {id: 5, targets: [7,8]}
+ ];
+
+
+ testCursor(deletes, "trans.objectStore('store').openCursor(webkitIDBKeyRange.lowerBound(0), webkitIDBCursor.PREV)", function() { resetObjectStore(indexCursorTest); });
+}
+
+function indexCursorTest()
+{
+ debug("indexCursorTest():");
+
+ var deletes = [{id: 1, targets: [0]},
+ {id: 2, targets: [names.length - 1]},
+ {id: 3, targets: [5,6,7]},
+ {id: 10, targets: [10]},
+ {id: 12, targets: [13]},
+ {id: 15, targets: [14]},
+ {id: 20, targets: [17,18]}
+ ];
+
+ testCursor(deletes, "trans.objectStore('store').index('nameIndex').openCursor(webkitIDBKeyRange.lowerBound('Alpha'))", function() { });
+}
+
+function transactionComplete()
+{
+ debug("transactionComplete():");
+ done();
+}
+
+var successfullyParsed = true;
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/indexeddb/cursor-update-expected.txt b/LayoutTests/storage/indexeddb/cursor-update-expected.txt
new file mode 100644
index 0000000..4f2e659
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/cursor-update-expected.txt
@@ -0,0 +1,283 @@
+Test IndexedDB's cursor update.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+webkitIndexedDB.open('name')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+db = event.result
+db.setVersion('new version')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+setVersionSuccess():
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+trans = event.result
+PASS trans !== null is true
+Deleted all object stores.
+createAndPopulateObjectStore():
+objectStore = db.createObjectStore('basicStore')
+objectStore.add('myValue1', 'myKey1').onerror = unexpectedErrorCallback
+objectStore.add('myValue2', 'myKey2').onerror = unexpectedErrorCallback
+objectStore.add('myValue3', 'myKey3').onerror = unexpectedErrorCallback
+objectStore.add('myValue4', 'myKey4').onerror = unexpectedErrorCallback
+objectStore = db.createObjectStore('autoIncrementStore', {autoIncrement: true})
+objectStore.add('foo1').onerror = unexpectedErrorCallback
+objectStore.add('foo2').onerror = unexpectedErrorCallback
+objectStore.add('foo3').onerror = unexpectedErrorCallback
+objectStore.add('foo4').onerror = unexpectedErrorCallback
+objectStore = db.createObjectStore('keyPathStore', {keyPath: 'id'})
+objectStore.createIndex('numberIndex', 'number')
+objectStore.add({number: 1, id: 1}).onerror = unexpectedErrorCallback
+objectStore.add({number: 2, id: 2}).onerror = unexpectedErrorCallback
+objectStore.add({number: 3, id: 3}).onerror = unexpectedErrorCallback
+objectStore.add({number: 4, id: 4}).onerror = unexpectedErrorCallback
+openBasicCursor()
+trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
+trans.objectStore('basicStore').openCursor(keyRange)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+basicUpdateCursor()
+event.result.update('myUpdatedValue' + counter++)
+event.source.continue()
+basicUpdateCursor()
+event.result.update('myUpdatedValue' + counter++)
+event.source.continue()
+basicUpdateCursor()
+event.result.update('myUpdatedValue' + counter++)
+event.source.continue()
+basicUpdateCursor()
+event.result.update('myUpdatedValue' + counter++)
+event.source.continue()
+basicUpdateCursor()
+PASS counter is 5
+trans.objectStore('basicStore').openCursor(keyRange)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+basicCheckCursor()
+PASS event.result.key is "myKey1"
+PASS event.result.value is "myUpdatedValue1"
+event.result.continue()
+basicCheckCursor()
+PASS event.result.key is "myKey2"
+PASS event.result.value is "myUpdatedValue2"
+event.result.continue()
+basicCheckCursor()
+PASS event.result.key is "myKey3"
+PASS event.result.value is "myUpdatedValue3"
+event.result.continue()
+basicCheckCursor()
+PASS event.result.key is "myKey4"
+PASS event.result.value is "myUpdatedValue4"
+event.result.continue()
+basicCheckCursor()
+PASS counter is 5
+trans.objectStore('autoIncrementStore').openCursor(keyRange)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+autoIncrementUpdateCursor()
+event.result.update('myUpdatedFoo' + counter++)
+event.source.continue()
+autoIncrementUpdateCursor()
+event.result.update('myUpdatedFoo' + counter++)
+event.source.continue()
+autoIncrementUpdateCursor()
+event.result.update('myUpdatedFoo' + counter++)
+event.source.continue()
+autoIncrementUpdateCursor()
+event.result.update('myUpdatedFoo' + counter++)
+event.source.continue()
+autoIncrementUpdateCursor()
+PASS counter is 5
+trans.objectStore('autoIncrementStore').openCursor(keyRange)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+autoIncrementCheckCursor()
+PASS event.result.key is counter
+PASS event.result.value is "myUpdatedFoo1"
+event.result.continue()
+autoIncrementCheckCursor()
+PASS event.result.key is counter
+PASS event.result.value is "myUpdatedFoo2"
+event.result.continue()
+autoIncrementCheckCursor()
+PASS event.result.key is counter
+PASS event.result.value is "myUpdatedFoo3"
+event.result.continue()
+autoIncrementCheckCursor()
+PASS event.result.key is counter
+PASS event.result.value is "myUpdatedFoo4"
+event.result.continue()
+autoIncrementCheckCursor()
+PASS counter is 5
+trans.objectStore('keyPathStore').openCursor(keyRange)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+keyPathUpdateCursor()
+event.result.update({id: 100 + counter, number: 100 + counter})
+Error event fired:
+PASS 'result' in event is false
+PASS 'code' in event is true
+PASS 'message' in event is true
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.code is webkitIDBDatabaseException.DATA_ERR
+event.preventDefault()
+event.source.update({id: counter, number: 100 + counter++})
+event.source.continue()
+keyPathUpdateCursor()
+event.result.update({id: 100 + counter, number: 100 + counter})
+Error event fired:
+PASS 'result' in event is false
+PASS 'code' in event is true
+PASS 'message' in event is true
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.code is webkitIDBDatabaseException.DATA_ERR
+event.preventDefault()
+event.source.update({id: counter, number: 100 + counter++})
+event.source.continue()
+keyPathUpdateCursor()
+event.result.update({id: 100 + counter, number: 100 + counter})
+Error event fired:
+PASS 'result' in event is false
+PASS 'code' in event is true
+PASS 'message' in event is true
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.code is webkitIDBDatabaseException.DATA_ERR
+event.preventDefault()
+event.source.update({id: counter, number: 100 + counter++})
+event.source.continue()
+keyPathUpdateCursor()
+event.result.update({id: 100 + counter, number: 100 + counter})
+Error event fired:
+PASS 'result' in event is false
+PASS 'code' in event is true
+PASS 'message' in event is true
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.code is webkitIDBDatabaseException.DATA_ERR
+event.preventDefault()
+event.source.update({id: counter, number: 100 + counter++})
+event.source.continue()
+keyPathUpdateCursor()
+PASS counter is 5
+trans.objectStore('keyPathStore').openCursor(keyRange)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+keyPathCheckCursor()
+PASS event.result.key is counter
+PASS event.result.value.id is counter
+PASS event.result.value.number is 101
+event.result.continue()
+keyPathCheckCursor()
+PASS event.result.key is counter
+PASS event.result.value.id is counter
+PASS event.result.value.number is 102
+event.result.continue()
+keyPathCheckCursor()
+PASS event.result.key is counter
+PASS event.result.value.id is counter
+PASS event.result.value.number is 103
+event.result.continue()
+keyPathCheckCursor()
+PASS event.result.key is counter
+PASS event.result.value.id is counter
+PASS event.result.value.number is 104
+event.result.continue()
+keyPathCheckCursor()
+PASS counter is 5
+trans.objectStore('keyPathStore').index('numberIndex').openKeyCursor(keyRange)
+keyCursor()
+PASS event.result.key is counter + 100
+PASS event.result.value is counter
+event.result.update({id: counter, number: counter + 200})
+PASS code is webkitIDBDatabaseException.NOT_ALLOWED_ERR
+keyCursor()
+PASS event.result.key is counter + 100
+PASS event.result.value is counter
+event.result.update({id: counter, number: counter + 200})
+PASS code is webkitIDBDatabaseException.NOT_ALLOWED_ERR
+keyCursor()
+PASS event.result.key is counter + 100
+PASS event.result.value is counter
+event.result.update({id: counter, number: counter + 200})
+PASS code is webkitIDBDatabaseException.NOT_ALLOWED_ERR
+keyCursor()
+PASS event.result.key is counter + 100
+PASS event.result.value is counter
+event.result.update({id: counter, number: counter + 200})
+PASS code is webkitIDBDatabaseException.NOT_ALLOWED_ERR
+keyCursor()
+PASS counter is 5
+transactionComplete()
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/indexeddb/cursor-update.html b/LayoutTests/storage/indexeddb/cursor-update.html
new file mode 100644
index 0000000..0a80b84
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/cursor-update.html
@@ -0,0 +1,249 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../fast/js/resources/js-test-post-function.js"></script>
+<script src="resources/shared.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("Test IndexedDB's cursor update.");
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+test();
+
+function test()
+{
+ result = evalAndLog("webkitIndexedDB.open('name')");
+ verifyResult(result);
+ result.onsuccess = openSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function openSuccess()
+{
+ verifySuccessEvent(event);
+ var db = evalAndLog("db = event.result");
+
+ result = evalAndLog("db.setVersion('new version')");
+ verifyResult(result);
+ result.onsuccess = setVersionSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function setVersionSuccess()
+{
+ debug("setVersionSuccess():");
+ verifySuccessEvent(event);
+ window.trans = evalAndLog("trans = event.result");
+ shouldBeTrue("trans !== null");
+ trans.onabort = unexpectedAbortCallback;
+ trans.oncomplete = openBasicCursor;
+
+ deleteAllObjectStores(db, createAndPopulateObjectStore);
+}
+
+function createAndPopulateObjectStore()
+{
+ debug("createAndPopulateObjectStore():");
+ var objectStore = evalAndLog("objectStore = db.createObjectStore('basicStore')");
+ evalAndLog("objectStore.add('myValue1', 'myKey1').onerror = unexpectedErrorCallback");
+ evalAndLog("objectStore.add('myValue2', 'myKey2').onerror = unexpectedErrorCallback");
+ evalAndLog("objectStore.add('myValue3', 'myKey3').onerror = unexpectedErrorCallback");
+ evalAndLog("objectStore.add('myValue4', 'myKey4').onerror = unexpectedErrorCallback");
+
+ var objectStore = evalAndLog("objectStore = db.createObjectStore('autoIncrementStore', {autoIncrement: true})");
+ evalAndLog("objectStore.add('foo1').onerror = unexpectedErrorCallback");
+ evalAndLog("objectStore.add('foo2').onerror = unexpectedErrorCallback");
+ evalAndLog("objectStore.add('foo3').onerror = unexpectedErrorCallback");
+ evalAndLog("objectStore.add('foo4').onerror = unexpectedErrorCallback");
+
+ var objectStore = evalAndLog("objectStore = db.createObjectStore('keyPathStore', {keyPath: 'id'})");
+ evalAndLog("objectStore.createIndex('numberIndex', 'number')");
+ evalAndLog("objectStore.add({number: 1, id: 1}).onerror = unexpectedErrorCallback");
+ evalAndLog("objectStore.add({number: 2, id: 2}).onerror = unexpectedErrorCallback");
+ evalAndLog("objectStore.add({number: 3, id: 3}).onerror = unexpectedErrorCallback");
+ evalAndLog("objectStore.add({number: 4, id: 4}).onerror = unexpectedErrorCallback");
+}
+
+function openBasicCursor()
+{
+ debug("openBasicCursor()");
+ evalAndLog("trans = db.transaction([], webkitIDBTransaction.READ_WRITE)");
+ trans.onabort = unexpectedAbortCallback;
+ trans.oncomplete = transactionComplete;
+
+ keyRange = webkitIDBKeyRange.lowerBound("myKey1");
+ result = evalAndLog("trans.objectStore('basicStore').openCursor(keyRange)");
+ verifyResult(result);
+ result.onsuccess = basicUpdateCursor;
+ result.onerror = unexpectedErrorCallback;
+ counter = 1;
+}
+
+function basicUpdateCursor()
+{
+ debug("basicUpdateCursor()");
+ if (event.result == null) {
+ shouldBe("counter", "5");
+ counter = 1;
+
+ result = evalAndLog("trans.objectStore('basicStore').openCursor(keyRange)");
+ verifyResult(result);
+ result.onsuccess = basicCheckCursor;
+ result.onerror = unexpectedErrorCallback;
+ return;
+ }
+
+ result = evalAndLog("event.result.update('myUpdatedValue' + counter++)");
+ result.onsuccess = function() { evalAndLog("event.source.continue()"); }
+ result.onerror = unexpectedErrorCallback;
+}
+
+function basicCheckCursor()
+{
+ debug("basicCheckCursor()");
+ if (event.result == null) {
+ shouldBe("counter", "5");
+ counter = 1;
+
+ keyRange = webkitIDBKeyRange.lowerBound(1);
+ result = evalAndLog("trans.objectStore('autoIncrementStore').openCursor(keyRange)");
+ verifyResult(result);
+ result.onsuccess = autoIncrementUpdateCursor;
+ result.onerror = unexpectedErrorCallback;
+ return;
+ }
+
+ shouldBeEqualToString("event.result.key", "myKey" + counter);
+ shouldBeEqualToString("event.result.value", "myUpdatedValue" + counter++);
+ evalAndLog("event.result.continue()");
+}
+
+function autoIncrementUpdateCursor()
+{
+ debug("autoIncrementUpdateCursor()");
+ if (event.result == null) {
+ shouldBe("counter", "5");
+ counter = 1;
+
+ result = evalAndLog("trans.objectStore('autoIncrementStore').openCursor(keyRange)");
+ verifyResult(result);
+ result.onsuccess = autoIncrementCheckCursor;
+ result.onerror = unexpectedErrorCallback;
+ return;
+ }
+
+ result = evalAndLog("event.result.update('myUpdatedFoo' + counter++)");
+ result.onsuccess = function() { evalAndLog("event.source.continue()"); }
+ result.onerror = unexpectedErrorCallback;
+}
+
+function autoIncrementCheckCursor()
+{
+ debug("autoIncrementCheckCursor()");
+ if (event.result == null) {
+ shouldBe("counter", "5");
+ counter = 1;
+
+ keyRange = webkitIDBKeyRange.lowerBound(1);
+ result = evalAndLog("trans.objectStore('keyPathStore').openCursor(keyRange)");
+ verifyResult(result);
+ result.onsuccess = keyPathUpdateCursor;
+ result.onerror = unexpectedErrorCallback;
+ return;
+ }
+
+ shouldBe("event.result.key", "counter");
+ shouldBeEqualToString("event.result.value", "myUpdatedFoo" + counter++);
+ evalAndLog("event.result.continue()");
+}
+
+function keyPathUpdateCursor()
+{
+ debug("keyPathUpdateCursor()");
+ if (event.result == null) {
+ shouldBe("counter", "5");
+ counter = 1;
+
+ result = evalAndLog("trans.objectStore('keyPathStore').openCursor(keyRange)");
+ verifyResult(result);
+ result.onsuccess = keyPathCheckCursor;
+ result.onerror = unexpectedErrorCallback;
+ return;
+ }
+
+ result = evalAndLog("event.result.update({id: 100 + counter, number: 100 + counter})");
+ result.onsuccess = unexpectedSuccessCallback;
+ result.onerror = function() {
+ verifyErrorEvent(event);
+ shouldBe("event.code", "webkitIDBDatabaseException.DATA_ERR");
+
+ evalAndLog("event.preventDefault()");
+
+ result = evalAndLog("event.source.update({id: counter, number: 100 + counter++})");
+ result.onsuccess = function() { evalAndLog("event.source.continue()") };
+ result.onerror = unexpectedErrorCallback;
+ }
+}
+
+function keyPathCheckCursor()
+{
+ debug("keyPathCheckCursor()");
+ if (event.result == null) {
+ shouldBe("counter", "5");
+ counter = 1;
+
+ keyRange = webkitIDBKeyRange.lowerBound(101);
+ result = evalAndLog("trans.objectStore('keyPathStore').index('numberIndex').openKeyCursor(keyRange)");
+ result.onsuccess = keyCursor;
+ result.onerror = unexpectedErrorCallback;
+ return;
+ }
+
+ shouldBe("event.result.key", "counter");
+ shouldBe("event.result.value.id", "counter");
+ shouldBe("event.result.value.number", (counter + 100).toString());
+ counter++;
+ evalAndLog("event.result.continue()");
+}
+
+function keyCursor()
+{
+ debug("keyCursor()");
+ if (event.result == null) {
+ shouldBe("counter", "5");
+ return;
+ }
+
+ shouldBe("event.result.key", "counter + 100");
+ shouldBe("event.result.value", "counter");
+
+ try {
+ debug("event.result.update({id: counter, number: counter + 200})");
+ event.result.update({id: counter, number: counter + 200});
+ testFailed("Expected exception.");
+ } catch (e) {
+ code = e.code;
+ shouldBe("code", "webkitIDBDatabaseException.NOT_ALLOWED_ERR");
+ }
+
+ counter++;
+ event.result.continue();
+}
+
+function transactionComplete()
+{
+ debug("transactionComplete()");
+ done();
+}
+
+var successfullyParsed = true;
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/indexeddb/data-corruption-expected.txt b/LayoutTests/storage/indexeddb/data-corruption-expected.txt
new file mode 100644
index 0000000..ac7116a
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/data-corruption-expected.txt
@@ -0,0 +1,69 @@
+Test that data inserted into IndexedDB does not get corrupted on disk.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+webkitIndexedDB.open('name')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+openSuccess():
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+db = event.result
+db.setVersion('new version')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+setVersionSuccess():
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+trans = event.result
+PASS trans !== null is true
+Deleted all object stores.
+createObjectStore():
+db.createObjectStore('storeName')
+addData():
+transaction = db.transaction([], webkitIDBTransaction.READ_WRITE)
+result = transaction.objectStore('storeName').add({x: testDate}, 'key')
+addData():
+transaction = db.transaction([], webkitIDBTransaction.READ_ONLY)
+result = transaction.objectStore('storeName').get('key')
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result.x.toString() == testDate.toString() is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/indexeddb/data-corruption.html b/LayoutTests/storage/indexeddb/data-corruption.html
new file mode 100644
index 0000000..664ff6d
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/data-corruption.html
@@ -0,0 +1,88 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../fast/js/resources/js-test-post-function.js"></script>
+<script src="resources/shared.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("Test that data inserted into IndexedDB does not get corrupted on disk.");
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+function test()
+{
+ result = evalAndLog("webkitIndexedDB.open('name')");
+ verifyResult(result);
+ result.onsuccess = openSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function openSuccess()
+{
+ debug("openSuccess():");
+ verifySuccessEvent(event);
+ window.db = evalAndLog("db = event.result");
+
+ result = evalAndLog("db.setVersion('new version')");
+ verifyResult(result);
+ result.onsuccess = setVersionSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function setVersionSuccess()
+{
+ debug("setVersionSuccess():");
+ verifySuccessEvent(event);
+ window.trans = evalAndLog("trans = event.result");
+ shouldBeTrue("trans !== null");
+ trans.onabort = unexpectedAbortCallback;
+ trans.oncomplete = addData;
+
+ deleteAllObjectStores(db, createObjectStore);
+}
+
+function createObjectStore()
+{
+ debug("createObjectStore():");
+ evalAndLog("db.createObjectStore('storeName')");
+}
+
+var testDate = new Date('February 24, 1955 12:00:08');
+
+function addData()
+{
+ debug("addData():");
+ var transaction = evalAndLog("transaction = db.transaction([], webkitIDBTransaction.READ_WRITE)");
+ var result = evalAndLog("result = transaction.objectStore('storeName').add({x: testDate}, 'key')");
+ result.onerror = unexpectedErrorCallback;
+ transaction.oncomplete = getData;
+}
+
+function getData()
+{
+ debug("addData():");
+ var transaction = evalAndLog("transaction = db.transaction([], webkitIDBTransaction.READ_ONLY)");
+ var result = evalAndLog("result = transaction.objectStore('storeName').get('key')");
+ result.onerror = unexpectedErrorCallback;
+ result.onsuccess = doCheck;
+}
+
+function doCheck()
+{
+ verifySuccessEvent(event);
+ shouldBeTrue("event.result.x.toString() == testDate.toString()");
+ done();
+}
+
+test();
+
+var successfullyParsed = true;
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/indexeddb/database-quota-expected.txt b/LayoutTests/storage/indexeddb/database-quota-expected.txt
index 0f06145..876d412 100644
--- a/LayoutTests/storage/indexeddb/database-quota-expected.txt
+++ b/LayoutTests/storage/indexeddb/database-quota-expected.txt
@@ -64,7 +64,7 @@ PASS db.objectStoreNames.length is 1
PASS db.objectStoreNames.contains('') is false
PASS db.objectStoreNames.contains('test456') is false
PASS db.objectStoreNames.contains('test123') is true
-trans = db.transaction({mode: webkitIDBTransaction.READ_WRITE})
+trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
Creating 'data' which contains 64K of data
PASS data.length is 65536
store = trans.objectStore('test123')
@@ -80,6 +80,7 @@ PASS 'onerror' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
+event.preventDefault()
PASS Adding data failed due to quota error. Data added was about 5 MB
PASS successfullyParsed is true
diff --git a/LayoutTests/storage/indexeddb/database-quota.html b/LayoutTests/storage/indexeddb/database-quota.html
index d21b051..b447505 100644
--- a/LayoutTests/storage/indexeddb/database-quota.html
+++ b/LayoutTests/storage/indexeddb/database-quota.html
@@ -74,7 +74,7 @@ function commitAndContinue()
function checkQuotaEnforcing()
{
- var trans = evalAndLog("trans = db.transaction({mode: webkitIDBTransaction.READ_WRITE})");
+ var trans = evalAndLog("trans = db.transaction([], webkitIDBTransaction.READ_WRITE)");
trans.onabort = testComplete;
trans.oncomplete = unexpectedCompleteCallback;
debug("Creating 'data' which contains 64K of data");
@@ -107,6 +107,7 @@ function logError()
{
debug("Error function called: (" + event.code + ") " + event.message);
verifyErrorEvent(event);
+ evalAndLog("event.preventDefault()");
}
function testComplete()
diff --git a/LayoutTests/storage/indexeddb/duplicates-expected.txt b/LayoutTests/storage/indexeddb/duplicates-expected.txt
index 8de488c..551b0bb 100644
--- a/LayoutTests/storage/indexeddb/duplicates-expected.txt
+++ b/LayoutTests/storage/indexeddb/duplicates-expected.txt
@@ -133,6 +133,7 @@ PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
PASS event.code is webkitIDBDatabaseException.NOT_FOUND_ERR
+event.preventDefault()
indexObject.get('does not exist')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
@@ -151,6 +152,7 @@ PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
PASS event.code is webkitIDBDatabaseException.NOT_FOUND_ERR
+event.preventDefault()
indexObject.openKeyCursor()
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
@@ -399,6 +401,7 @@ PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
PASS event.code is webkitIDBDatabaseException.NOT_FOUND_ERR
+event.preventDefault()
indexObject.get('does not exist')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
@@ -417,6 +420,7 @@ PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
PASS event.code is webkitIDBDatabaseException.NOT_FOUND_ERR
+event.preventDefault()
indexObject.openKeyCursor()
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
diff --git a/LayoutTests/storage/indexeddb/duplicates.html b/LayoutTests/storage/indexeddb/duplicates.html
index 352367f..cdfdcaa 100644
--- a/LayoutTests/storage/indexeddb/duplicates.html
+++ b/LayoutTests/storage/indexeddb/duplicates.html
@@ -111,6 +111,8 @@ function getObjectDataFail()
verifyErrorEvent(event);
shouldBe("event.code", "webkitIDBDatabaseException.NOT_FOUND_ERR");
+ evalAndLog("event.preventDefault()");
+
result = evalAndLog("indexObject.get('does not exist')");
verifyResult(result);
result.onsuccess = unexpectedSuccessCallback;
@@ -122,6 +124,8 @@ function openKeyCursor()
verifyErrorEvent(event);
shouldBe("event.code", "webkitIDBDatabaseException.NOT_FOUND_ERR");
+ evalAndLog("event.preventDefault()");
+
window.result = evalAndLog("indexObject.openKeyCursor()");
verifyResult(result);
result.onsuccess = cursor1Continue;
diff --git a/LayoutTests/storage/indexeddb/error-causes-abort-by-default-expected.txt b/LayoutTests/storage/indexeddb/error-causes-abort-by-default-expected.txt
new file mode 100644
index 0000000..dd8fd61
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/error-causes-abort-by-default-expected.txt
@@ -0,0 +1,107 @@
+Verify that a transaction with an error aborts unless preventDefault() is called.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+webkitIndexedDB.open('name')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+db = event.result
+db.setVersion('new version')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+setVersionSuccess():
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+trans = event.result
+PASS trans !== null is true
+trans.oncomplete = addData
+Deleted all object stores.
+db.createObjectStore('storeName', null)
+trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
+trans.onabort = unexpectedAbortCallback
+trans.oncomplete = transactionCompleted
+store = trans.objectStore('storeName')
+store.add({x: 'value', y: 'zzz'}, 'key')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+event.source.add({x: 'value', y: 'zzz'}, 'key')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+event.preventDefault()
+PASS Transaction completed
+
+
+trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
+trans.onabort = transactionAborted1
+trans.oncomplete = unexpectedCompleteCallback
+store = trans.objectStore('storeName')
+store.add({x: 'value', y: 'zzz'}, 'key')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Doing nothing to prevent the default action...
+PASS Transaction aborted
+
+
+trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
+trans.onabort = transactionAborted2
+trans.oncomplete = unexpectedCompleteCallback
+store = trans.objectStore('storeName')
+store.add({x: 'value', y: 'zzz'}, 'key')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Omitting an onerror handler
+PASS Transaction aborted
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/indexeddb/error-causes-abort-by-default.html b/LayoutTests/storage/indexeddb/error-causes-abort-by-default.html
new file mode 100644
index 0000000..ab4c58a
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/error-causes-abort-by-default.html
@@ -0,0 +1,127 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../fast/js/resources/js-test-post-function.js"></script>
+<script src="resources/shared.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("Verify that a transaction with an error aborts unless preventDefault() is called.");
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+function test()
+{
+ result = evalAndLog("webkitIndexedDB.open('name')");
+ verifyResult(result);
+ result.onsuccess = setVersion;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function setVersion()
+{
+ verifySuccessEvent(event);
+ db = evalAndLog("db = event.result");
+
+ result = evalAndLog("db.setVersion('new version')");
+ verifyResult(result);
+ result.onsuccess = deleteExisting;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function deleteExisting()
+{
+ debug("setVersionSuccess():");
+ verifySuccessEvent(event);
+ window.trans = evalAndLog("trans = event.result");
+ shouldBeTrue("trans !== null");
+ trans.onabort = unexpectedAbortCallback;
+ evalAndLog("trans.oncomplete = addData");
+
+ deleteAllObjectStores(db, createObjectStore);
+}
+
+function createObjectStore()
+{
+ evalAndLog("db.createObjectStore('storeName', null)");
+}
+
+function addData()
+{
+ trans = evalAndLog("trans = db.transaction([], webkitIDBTransaction.READ_WRITE)");
+ evalAndLog("trans.onabort = unexpectedAbortCallback");
+ evalAndLog("trans.oncomplete = transactionCompleted");
+ store = evalAndLog("store = trans.objectStore('storeName')");
+ result = evalAndLog("store.add({x: 'value', y: 'zzz'}, 'key')");
+ verifyResult(result);
+ result.onsuccess = addMore;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function addMore()
+{
+ verifySuccessEvent(event);
+
+ result = evalAndLog("event.source.add({x: 'value', y: 'zzz'}, 'key')");
+ verifyResult(result);
+ result.onsuccess = unexpectedSuccessCallback;
+ result.addEventListener("error", preventTheDefault);
+}
+
+function preventTheDefault()
+{
+ evalAndLog("event.preventDefault()");
+}
+
+function transactionCompleted()
+{
+ testPassed("Transaction completed");
+ debug("");
+ debug("");
+ trans = evalAndLog("trans = db.transaction([], webkitIDBTransaction.READ_WRITE)");
+ evalAndLog("trans.onabort = transactionAborted1");
+ evalAndLog("trans.oncomplete = unexpectedCompleteCallback");
+ store = evalAndLog("store = trans.objectStore('storeName')");
+ result = evalAndLog("store.add({x: 'value', y: 'zzz'}, 'key')");
+ verifyResult(result);
+ result.onsuccess = unexpectedSuccessCallback;
+ result.onerror = allowDefault;
+}
+
+function allowDefault()
+{
+ debug("Doing nothing to prevent the default action...");
+}
+
+function transactionAborted1()
+{
+ testPassed("Transaction aborted");
+ debug("");
+ debug("");
+ trans = evalAndLog("trans = db.transaction([], webkitIDBTransaction.READ_WRITE)");
+ evalAndLog("trans.onabort = transactionAborted2");
+ evalAndLog("trans.oncomplete = unexpectedCompleteCallback");
+ store = evalAndLog("store = trans.objectStore('storeName')");
+ result = evalAndLog("store.add({x: 'value', y: 'zzz'}, 'key')");
+ verifyResult(result);
+ result.onsuccess = unexpectedSuccessCallback;
+ debug("Omitting an onerror handler");
+}
+
+function transactionAborted2()
+{
+ testPassed("Transaction aborted");
+ done();
+}
+
+test();
+
+var successfullyParsed = true;
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/indexeddb/index-basics-expected.txt b/LayoutTests/storage/indexeddb/index-basics-expected.txt
index 099dde3..d18a09a 100644
--- a/LayoutTests/storage/indexeddb/index-basics-expected.txt
+++ b/LayoutTests/storage/indexeddb/index-basics-expected.txt
@@ -183,6 +183,7 @@ PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
PASS event.code is webkitIDBDatabaseException.NOT_FOUND_ERR
+event.preventDefault()
indexObject.get('does not exist')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
@@ -201,6 +202,7 @@ PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
PASS event.code is webkitIDBDatabaseException.NOT_FOUND_ERR
+event.preventDefault()
indexObject.openKeyCursor()
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
diff --git a/LayoutTests/storage/indexeddb/index-basics.html b/LayoutTests/storage/indexeddb/index-basics.html
index d5eec0a..863566a 100644
--- a/LayoutTests/storage/indexeddb/index-basics.html
+++ b/LayoutTests/storage/indexeddb/index-basics.html
@@ -144,6 +144,8 @@ function getObjectDataFail()
verifyErrorEvent(event);
shouldBe("event.code", "webkitIDBDatabaseException.NOT_FOUND_ERR");
+ evalAndLog("event.preventDefault()");
+
result = evalAndLog("indexObject.get('does not exist')");
verifyResult(result);
result.onsuccess = unexpectedSuccessCallback;
@@ -155,6 +157,8 @@ function openKeyCursor()
verifyErrorEvent(event);
shouldBe("event.code", "webkitIDBDatabaseException.NOT_FOUND_ERR");
+ evalAndLog("event.preventDefault()");
+
window.result = evalAndLog("indexObject.openKeyCursor()");
verifyResult(result);
result.onsuccess = cursor1Continue;
diff --git a/LayoutTests/storage/indexeddb/index-cursor.html b/LayoutTests/storage/indexeddb/index-cursor.html
index 1a04d57..97985a4 100644
--- a/LayoutTests/storage/indexeddb/index-cursor.html
+++ b/LayoutTests/storage/indexeddb/index-cursor.html
@@ -187,7 +187,7 @@ function runNextTest()
else
keyRange = webkitIDBKeyRange.upperBound(testData[upper], upperIsOpen);
- var request = indexObject.openKeyCursor({range: keyRange, direction: ascending ? webkitIDBCursor.NEXT : webkitIDBCursor.PREV});
+ var request = indexObject.openKeyCursor(keyRange, ascending ? webkitIDBCursor.NEXT : webkitIDBCursor.PREV);
request.onsuccess = cursorIteration;
request.onerror = unexpectedErrorCallback;
}
@@ -254,7 +254,7 @@ function testNullKeyRange()
debug("");
debug(str);
- var request = indexObject.openKeyCursor({direction: ascending ? webkitIDBCursor.NEXT : webkitIDBCursor.PREV});
+ var request = indexObject.openKeyCursor(null, ascending ? webkitIDBCursor.NEXT : webkitIDBCursor.PREV);
request.onsuccess = cursorIteration;
request.onerror = unexpectedErrorCallback;
}
diff --git a/LayoutTests/storage/indexeddb/objectstore-autoincrement-expected.txt b/LayoutTests/storage/indexeddb/objectstore-autoincrement-expected.txt
index 8e36c96..5ba278b 100644
--- a/LayoutTests/storage/indexeddb/objectstore-autoincrement-expected.txt
+++ b/LayoutTests/storage/indexeddb/objectstore-autoincrement-expected.txt
@@ -55,15 +55,15 @@ PASS storeNames.contains('StoreWithAutoIncrement') is true
PASS storeNames.contains('PlainOldStore') is true
PASS storeNames.length is 3
setVersionCompleted():
-trans = db.transaction({mode: webkitIDBTransaction.READ_WRITE})
+trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
store = trans.objectStore('StoreWithKeyPath')
-Insert in object store with key gen and key path
-store.add({name: 'Lincoln', number: '7012'})
-addLincolnError():
-Error event fired:
-PASS 'result' in event is false
-PASS 'code' in event is true
-PASS 'message' in event is true
+Insert into object store with auto increment and key path, with key in the object.
+store.add({name: 'Jeffersson', number: '7010', id: 3})
+addJefferssonSuccess():
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
PASS 'source' in event is true
PASS event.source != null is true
PASS 'onsuccess' in event.target is true
@@ -71,11 +71,10 @@ PASS 'onerror' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
-PASS event.code is webkitIDBDatabaseException.UNKNOWN_ERR
-store = trans.objectStore('StoreWithAutoIncrement')
-Insert into object store with key gen using explicit key
-store.add({name: 'Lincoln'}, 1)
-addWithExplicitKeyError():
+PASS event.result is 3
+Insert into object store with auto increment and key path, without key in the object.
+store.add({name: 'Lincoln', number: '7012'})
+addLincolnError():
Error event fired:
PASS 'result' in event is false
PASS 'code' in event is true
@@ -87,9 +86,11 @@ PASS 'onerror' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
-PASS event.code is webkitIDBDatabaseException.DATA_ERR
-Insert into object store with key gen and no key path
-store.add({name: 'Lincoln', number: '7012'})
+PASS event.code is webkitIDBDatabaseException.UNKNOWN_ERR
+event.preventDefault()
+store = trans.objectStore('StoreWithAutoIncrement')
+Insert into object store with key gen using explicit key
+store.add({name: 'Lincoln', number: '7012'}, 5)
addLincolnSuccess():
Success event fired:
PASS 'result' in event is true
@@ -102,8 +103,8 @@ PASS 'onerror' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
-PASS event.result is 1
-store.get(1)
+PASS event.result is 5
+store.get(5)
getLincolnSuccess():
Success event fired:
PASS 'result' in event is true
@@ -131,8 +132,8 @@ PASS 'onerror' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
-PASS event.result is 2
-store.get(2)
+PASS event.result is 6
+store.get(6)
getAbrahamSuccess():
Success event fired:
PASS 'result' in event is true
@@ -163,6 +164,7 @@ PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
PASS event.code is webkitIDBDatabaseException.DATA_ERR
+event.preventDefault()
store.add({name: 'Adam'}, 1)
addAdamSuccess():
Success event fired:
diff --git a/LayoutTests/storage/indexeddb/objectstore-autoincrement.html b/LayoutTests/storage/indexeddb/objectstore-autoincrement.html
index 2b44a7a..0c0e9f5 100644
--- a/LayoutTests/storage/indexeddb/objectstore-autoincrement.html
+++ b/LayoutTests/storage/indexeddb/objectstore-autoincrement.html
@@ -68,13 +68,25 @@ function setVersionCompleted()
{
debug("setVersionCompleted():");
- window.trans = evalAndLog("trans = db.transaction({mode: webkitIDBTransaction.READ_WRITE})");
+ window.trans = evalAndLog("trans = db.transaction([], webkitIDBTransaction.READ_WRITE)");
trans.onabort = unexpectedAbortCallback;
trans.oncomplete = done;
window.store = evalAndLog("store = trans.objectStore('StoreWithKeyPath')");
- debug("Insert in object store with key gen and key path");
+ debug("Insert into object store with auto increment and key path, with key in the object.");
+ result = evalAndLog("store.add({name: 'Jeffersson', number: '7010', id: 3})");
+ result.onsuccess = addJefferssonSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function addJefferssonSuccess()
+{
+ debug("addJefferssonSuccess():");
+ verifySuccessEvent(event);
+ shouldBe("event.result", "3");
+
+ debug("Insert into object store with auto increment and key path, without key in the object.");
result = evalAndLog("store.add({name: 'Lincoln', number: '7012'})");
result.onsuccess = unexpectedSuccessCallback;
result.onerror = addLincolnError;
@@ -87,32 +99,21 @@ function addLincolnError()
// FIXME: This should be implemented, but we make it an error for now.
shouldBe("event.code", "webkitIDBDatabaseException.UNKNOWN_ERR");
+ evalAndLog("event.preventDefault()");
+
window.store = evalAndLog("store = trans.objectStore('StoreWithAutoIncrement')");
debug("Insert into object store with key gen using explicit key");
- result = evalAndLog("store.add({name: 'Lincoln'}, 1)");
- result.onsuccess = unexpectedSuccessCallback;
- result.onerror = addWithExplicitKeyError;
-}
-
-function addWithExplicitKeyError()
-{
- debug("addWithExplicitKeyError():");
- verifyErrorEvent(event);
- shouldBe("event.code", "webkitIDBDatabaseException.DATA_ERR");
-
- debug("Insert into object store with key gen and no key path");
- result = evalAndLog("store.add({name: 'Lincoln', number: '7012'})");
+ result = evalAndLog("store.add({name: 'Lincoln', number: '7012'}, 5)");
result.onsuccess = addLincolnSuccess;
- result.onerror = unexpectedErrorCallback;
}
function addLincolnSuccess()
{
debug("addLincolnSuccess():");
verifySuccessEvent(event);
- shouldBe("event.result", "1");
+ shouldBe("event.result", "5");
- result = evalAndLog("store.get(1)");
+ result = evalAndLog("store.get(5)");
result.onsuccess = getLincolnSuccess;
result.onerror = unexpectedErrorCallback;
}
@@ -133,9 +134,9 @@ function putAbrahamSuccess()
{
debug("putAbrahamSuccess():");
verifySuccessEvent(event);
- shouldBe("event.result", "2");
+ shouldBe("event.result", "6");
- result = evalAndLog("store.get(2)");
+ result = evalAndLog("store.get(6)");
result.onsuccess = getAbrahamSuccess;
result.onerror = unexpectedErrorCallback;
}
@@ -160,6 +161,8 @@ function addAdamError()
verifyErrorEvent(event);
shouldBe("event.code", "webkitIDBDatabaseException.DATA_ERR");
+ evalAndLog("event.preventDefault()");
+
result = evalAndLog("store.add({name: 'Adam'}, 1)");
result.onsuccess = addAdamSuccess;
result.onerror = unexpectedErrorCallback;
diff --git a/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt b/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
index b842dcc..cfbdbbf 100644
--- a/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
+++ b/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
@@ -95,7 +95,7 @@ PASS store.indexNames[1] is null
PASS store.indexNames[100] is null
PASS store.indexNames.item(1) is null
PASS store.indexNames.item(100) is null
-transaction = db.transaction({mode: webkitIDBTransaction.READ_WRITE})
+transaction = db.transaction([], webkitIDBTransaction.READ_WRITE)
store = transaction.objectStore('storeName')
Try to insert data with a Date key:
store.add({x: 'foo'}, testDate)
@@ -137,7 +137,8 @@ PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
PASS event.code is webkitIDBDatabaseException.UNKNOWN_ERR
-db.transaction({mode: webkitIDBTransaction.READ_WRITE})
+event.preventDefault()
+db.transaction([], webkitIDBTransaction.READ_WRITE)
store = transaction.objectStore('storeName')
store.add({x: 'othervalue'}, null)
PASS 'onsuccess' in result is true
@@ -158,7 +159,8 @@ PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
PASS event.code is webkitIDBDatabaseException.DATA_ERR
-db.transaction({mode: webkitIDBTransaction.READ_WRITE})
+event.preventDefault()
+db.transaction([], webkitIDBTransaction.READ_WRITE)
store = transaction.objectStore('storeName')
store.add({x: null}, 'validkey')
PASS 'onsuccess' in result is true
@@ -179,7 +181,8 @@ PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
PASS event.code is webkitIDBDatabaseException.DATA_ERR
-db.transaction({mode: webkitIDBTransaction.READ_WRITE})
+event.preventDefault()
+db.transaction([], webkitIDBTransaction.READ_WRITE)
store = transaction.objectStore('storeName')
store.get('key')
PASS 'onsuccess' in result is true
diff --git a/LayoutTests/storage/indexeddb/objectstore-basics.html b/LayoutTests/storage/indexeddb/objectstore-basics.html
index d388aa0..46b771e 100644
--- a/LayoutTests/storage/indexeddb/objectstore-basics.html
+++ b/LayoutTests/storage/indexeddb/objectstore-basics.html
@@ -141,7 +141,7 @@ var testDateB = new Date("Wed Jan 05 2011 15:54:49");
function addData()
{
- var transaction = evalAndLog("transaction = db.transaction({mode: webkitIDBTransaction.READ_WRITE})");
+ var transaction = evalAndLog("transaction = db.transaction([], webkitIDBTransaction.READ_WRITE)");
transaction.onabort = unexpectedAbortCallback;
window.store = evalAndLog("store = transaction.objectStore('storeName')");
@@ -179,7 +179,7 @@ function addSuccess()
result = evalAndLog("event.source.add({x: 'foo'}, 'zzz')");
verifyResult(result);
result.onsuccess = unexpectedSuccessCallback;
- result.onerror = addAgainFailure;
+ result.addEventListener('error', addAgainFailure, false);
}
function addAgainFailure()
@@ -189,14 +189,16 @@ function addAgainFailure()
// FIXME: This error code needs to be specced.
shouldBe("event.code", "webkitIDBDatabaseException.UNKNOWN_ERR");
- transaction = evalAndLog("db.transaction({mode: webkitIDBTransaction.READ_WRITE})");
+ evalAndLog("event.preventDefault()");
+
+ transaction = evalAndLog("db.transaction([], webkitIDBTransaction.READ_WRITE)");
transaction.onabort = unexpectedErrorCallback;
var store = evalAndLog("store = transaction.objectStore('storeName')");
result = evalAndLog("store.add({x: 'othervalue'}, null)");
verifyResult(result);
result.onsuccess = unexpectedSuccessCallback;
- result.onerror = addWithNullKeyFailure;
+ result.addEventListener('error', addWithNullKeyFailure, true);
}
function addWithNullKeyFailure()
@@ -205,7 +207,9 @@ function addWithNullKeyFailure()
verifyErrorEvent(event);
shouldBe("event.code", "webkitIDBDatabaseException.DATA_ERR");
- transaction = evalAndLog("db.transaction({mode: webkitIDBTransaction.READ_WRITE})");
+ evalAndLog("event.preventDefault()");
+
+ transaction = evalAndLog("db.transaction([], webkitIDBTransaction.READ_WRITE)");
transaction.onabort = unexpectedErrorCallback;
var store = evalAndLog("store = transaction.objectStore('storeName')");
@@ -221,13 +225,15 @@ function addWithNullIndexFailure()
verifyErrorEvent(event);
shouldBe("event.code", "webkitIDBDatabaseException.DATA_ERR");
- transaction = evalAndLog("db.transaction({mode: webkitIDBTransaction.READ_WRITE})");
+ evalAndLog("event.preventDefault()");
+
+ transaction = evalAndLog("db.transaction([], webkitIDBTransaction.READ_WRITE)");
transaction.onabort = unexpectedErrorCallback;
var store = evalAndLog("store = transaction.objectStore('storeName')");
result = evalAndLog("store.get('key')");
verifyResult(result);
- result.onsuccess = getSuccess;
+ result.addEventListener('success', getSuccess, true);
result.onerror = unexpectedErrorCallback;
}
@@ -239,7 +245,7 @@ function getSuccess()
var store = evalAndLog("store = event.source");
result = evalAndLog("store.get(testDate)");
- result.onsuccess = getSuccessDateKey;
+ result.addEventListener('success', getSuccessDateKey, false);
result.onerror = unexpectedErrorCallback;
}
diff --git a/LayoutTests/storage/indexeddb/objectstore-clear-expected.txt b/LayoutTests/storage/indexeddb/objectstore-clear-expected.txt
new file mode 100644
index 0000000..5d99fcb
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/objectstore-clear-expected.txt
@@ -0,0 +1,151 @@
+Test IndexedDB's webkitIDBObjectStore.clear().
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+webkitIndexedDB.open('name')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+db = event.result
+db.setVersion('new version')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+trans = event.result
+PASS trans !== null is true
+Deleted all object stores.
+store = db.createObjectStore('storeName', null)
+store.createIndex('indexName', '')
+PASS store.indexNames.contains('indexName') is true
+store.add('value', 'key')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+otherStore = db.createObjectStore('otherStoreName', null)
+otherStore.add('value', 'key')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+store.clear()
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result is undefined.
+store.openCursor()
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result is null
+index = store.index('indexName')
+index.openKeyCursor()
+openKeyCursorSuccess():
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result is null
+db.transaction({mode: webkitIDBTransaction.READ_WRITE})
+otherStore = transaction.objectStore('otherStoreName')
+otherStore.get('key')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result is "value"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/indexeddb/objectstore-clear.html b/LayoutTests/storage/indexeddb/objectstore-clear.html
new file mode 100644
index 0000000..7f4034f
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/objectstore-clear.html
@@ -0,0 +1,130 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../fast/js/resources/js-test-post-function.js"></script>
+<script src="resources/shared.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("Test IndexedDB's webkitIDBObjectStore.clear().");
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+function test()
+{
+ result = evalAndLog("webkitIndexedDB.open('name')");
+ verifyResult(result);
+ result.onsuccess = startSetVersion;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function startSetVersion()
+{
+ verifySuccessEvent(event);
+ db = evalAndLog("db = event.result");
+
+ result = evalAndLog("db.setVersion('new version')");
+ verifyResult(result);
+ result.onsuccess = deleteExisting;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function deleteExisting()
+{
+ verifySuccessEvent(event);
+ window.trans = evalAndLog("trans = event.result");
+ shouldBeTrue("trans !== null");
+
+ deleteAllObjectStores(db, createObjectStoreAndAddValue);
+}
+
+function createObjectStoreAndAddValue()
+{
+ store = evalAndLog("store = db.createObjectStore('storeName', null)");
+
+ window.index = evalAndLog("store.createIndex('indexName', '')");
+ shouldBeTrue("store.indexNames.contains('indexName')");
+
+ result = evalAndLog("store.add('value', 'key')");
+ verifyResult(result);
+ result.onsuccess = createSecondObjectStoreAndAddValue;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function createSecondObjectStoreAndAddValue()
+{
+ verifySuccessEvent(event);
+
+ otherStore = evalAndLog("otherStore = db.createObjectStore('otherStoreName', null)");
+
+ result = evalAndLog("otherStore.add('value', 'key')");
+ verifyResult(result);
+ result.onsuccess = clearObjectStore;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function clearObjectStore()
+{
+ verifySuccessEvent(event);
+
+ result = evalAndLog("store.clear()");
+ verifyResult(result);
+ result.onsuccess = clearSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function clearSuccess()
+{
+ verifySuccessEvent(event);
+ shouldBeUndefined("event.result");
+
+ result = evalAndLog("store.openCursor()");
+ result.onsuccess = openCursorSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function openCursorSuccess()
+{
+ verifySuccessEvent(event);
+ shouldBeNull("event.result");
+
+ index = evalAndLog("index = store.index('indexName')");
+ result = evalAndLog("index.openKeyCursor()");
+ result.onsuccess = openKeyCursorSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function openKeyCursorSuccess()
+{
+ debug("openKeyCursorSuccess():");
+ verifySuccessEvent(event);
+ shouldBeNull("event.result");
+
+ transaction = evalAndLog("db.transaction({mode: webkitIDBTransaction.READ_WRITE})");
+ transaction.onabort = unexpectedErrorCallback;
+ var otherStore = evalAndLog("otherStore = transaction.objectStore('otherStoreName')");
+
+ result = evalAndLog("otherStore.get('key')");
+ verifyResult(result);
+ result.onsuccess = getSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function getSuccess()
+{
+ verifySuccessEvent(event);
+ shouldBeEqualToString("event.result", "value");
+
+ done();
+}
+
+test();
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/indexeddb/objectstore-cursor.html b/LayoutTests/storage/indexeddb/objectstore-cursor.html
index e0db08f..bb7b65b 100644
--- a/LayoutTests/storage/indexeddb/objectstore-cursor.html
+++ b/LayoutTests/storage/indexeddb/objectstore-cursor.html
@@ -165,7 +165,7 @@ function runNextTest()
else
keyRange = webkitIDBKeyRange.upperBound(testData[upper], upperIsOpen);
- var request = objectStore.openCursor({range: keyRange, direction: ascending ? webkitIDBCursor.NEXT : webkitIDBCursor.PREV});
+ var request = objectStore.openCursor(keyRange, ascending ? webkitIDBCursor.NEXT : webkitIDBCursor.PREV);
request.onsuccess = cursorIteration;
request.onerror = unexpectedErrorCallback;
}
@@ -231,7 +231,7 @@ function testNullKeyRange()
debug("");
debug(str);
- var request = objectStore.openCursor({direction: ascending ? webkitIDBCursor.NEXT : webkitIDBCursor.PREV});
+ var request = objectStore.openCursor(null, ascending ? webkitIDBCursor.NEXT : webkitIDBCursor.PREV);
request.onsuccess = cursorIteration;
request.onerror = unexpectedErrorCallback;
}
diff --git a/LayoutTests/storage/indexeddb/open-cursor-expected.txt b/LayoutTests/storage/indexeddb/open-cursor-expected.txt
index d40436c..ddaa51a 100644
--- a/LayoutTests/storage/indexeddb/open-cursor-expected.txt
+++ b/LayoutTests/storage/indexeddb/open-cursor-expected.txt
@@ -50,7 +50,7 @@ PASS 'readyState' in result is true
An event should fire shortly...
Opening cursor
-event.source.openCursor({range: keyRange})
+event.source.openCursor(keyRange)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
PASS 'readyState' in result is true
@@ -76,7 +76,7 @@ Passing an invalid key into .continue().
PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17
Opening an empty cursor.
-objectStore.openCursor({range: keyRange})
+objectStore.openCursor(keyRange)
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
PASS 'readyState' in result is true
diff --git a/LayoutTests/storage/indexeddb/open-cursor.html b/LayoutTests/storage/indexeddb/open-cursor.html
index e4dc8f0..17ed9ab 100644
--- a/LayoutTests/storage/indexeddb/open-cursor.html
+++ b/LayoutTests/storage/indexeddb/open-cursor.html
@@ -26,7 +26,7 @@ function openEmptyCursor()
{
debug("Opening an empty cursor.");
keyRange = webkitIDBKeyRange.lowerBound("InexistentKey");
- result = evalAndLog("objectStore.openCursor({range: keyRange})");
+ result = evalAndLog("objectStore.openCursor(keyRange)");
verifyResult(result);
result.onsuccess = emptyCursorSuccess;
result.onerror = unexpectedErrorCallback;
@@ -56,7 +56,7 @@ function openCursor()
{
debug("Opening cursor");
keyRange = webkitIDBKeyRange.lowerBound("myKey");
- result = evalAndLog("event.source.openCursor({range: keyRange})");
+ result = evalAndLog("event.source.openCursor(keyRange)");
verifyResult(result);
result.onsuccess = cursorSuccess;
result.onerror = unexpectedErrorCallback;
diff --git a/LayoutTests/storage/indexeddb/request-event-propagation-expected.txt b/LayoutTests/storage/indexeddb/request-event-propagation-expected.txt
new file mode 100644
index 0000000..deda6a7
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/request-event-propagation-expected.txt
@@ -0,0 +1,166 @@
+Test event propogation on IDBRequest.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+webkitIndexedDB.open('name')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+db = event.result
+db.setVersion('new version')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+setVersionSuccess():
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+trans = event.result
+PASS trans !== null is true
+trans.oncomplete = startTest
+Deleted all object stores.
+store = db.createObjectStore('storeName', null)
+store.add({x: 'value', y: 'zzz'}, 'key')
+Verify that handler fires and that not preventing default will result in an abort
+trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
+trans.onabort = transactionAborted
+trans.oncomplete = unexpectedCompleteCallback
+trans.onerror = allowDefault
+store = trans.objectStore('storeName')
+store.add({x: 'value', y: 'zzz'}, 'key')
+PASS Event handler fired
+Doing nothing to prevent the default action...
+PASS handlerFired is true
+
+Verifing error
+trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
+trans.onabort = transactionAborted2
+trans.oncomplete = unexpectedAbortCallback
+trans.addEventListener('error', errorCaptureCallback, true)
+trans.addEventListener('error', errorBubbleCallback, false)
+trans.addEventListener('success', unexpectedSuccessCallback, true)
+trans.addEventListener('success', unexpectedSuccessCallback, false)
+db.addEventListener('error', dbErrorCaptureCallback, true)
+db.addEventListener('error', dbErrorBubbleCallback, false)
+db.addEventListener('success', unexpectedSuccessCallback, true)
+db.addEventListener('success', unexpectedSuccessCallback, false)
+store = trans.objectStore('storeName')
+store.add({x: 'value', y: 'zzz'}, 'key')
+
+In IDBDatabase error capture
+PASS dbCaptureFired is false
+PASS captureFired is false
+PASS requestFired is false
+PASS bubbleFired is false
+PASS dbBubbleFired is false
+
+In IDBTransaction error capture
+PASS dbCaptureFired is true
+PASS captureFired is false
+PASS requestFired is false
+PASS bubbleFired is false
+PASS dbBubbleFired is false
+
+In IDBRequest handler
+PASS dbCaptureFired is true
+PASS captureFired is true
+PASS requestFired is false
+PASS bubbleFired is false
+PASS dbBubbleFired is false
+
+In IDBTransaction error bubble
+PASS dbCaptureFired is true
+PASS captureFired is true
+PASS requestFired is true
+PASS bubbleFired is false
+PASS dbBubbleFired is false
+
+In IDBDatabase error bubble
+PASS dbCaptureFired is true
+PASS captureFired is true
+PASS requestFired is true
+PASS bubbleFired is true
+PASS dbBubbleFired is false
+
+Transaction aborted
+PASS dbCaptureFired is true
+PASS captureFired is true
+PASS requestFired is true
+PASS bubbleFired is true
+PASS dbBubbleFired is true
+
+Verifing success.
+trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
+trans.oncomplete = transactionComplete
+trans.onabort = unexpectedAbortCallback
+trans.addEventListener('success', successCaptureCallback, true)
+trans.addEventListener('success', successBubbleCallback, false)
+trans.addEventListener('error', unexpectedErrorCallback, true)
+trans.addEventListener('error', unexpectedErrorCallback, false)
+db.removeEventListener('error', dbErrorCaptureCallback, true)
+db.removeEventListener('error', dbErrorBubbleCallback, false)
+db.removeEventListener('success', unexpectedSuccessCallback, true)
+db.removeEventListener('success', unexpectedSuccessCallback, false)
+db.addEventListener('success', dbSuccessCaptureCallback, true)
+db.addEventListener('success', dbSuccessBubbleCallback, false)
+db.addEventListener('error', unexpectedErrorCallback, true)
+db.addEventListener('error', unexpectedErrorCallback, false)
+store = trans.objectStore('storeName')
+store.add({x: 'value', y: 'zzz'}, 'key2')
+
+In IDBDatabase success capture
+PASS dbCaptureFired is false
+PASS captureFired is false
+PASS requestFired is false
+PASS bubbleFired is false
+PASS dbBubbleFired is false
+
+In IDBTransaction success capture
+PASS dbCaptureFired is true
+PASS captureFired is false
+PASS requestFired is false
+PASS bubbleFired is false
+PASS dbBubbleFired is false
+
+In IDBRequest handler
+PASS dbCaptureFired is true
+PASS captureFired is true
+PASS requestFired is false
+PASS bubbleFired is false
+PASS dbBubbleFired is false
+
+Transaction completed
+PASS dbCaptureFired is true
+PASS captureFired is true
+PASS requestFired is true
+PASS bubbleFired is false
+PASS dbBubbleFired is false
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/indexeddb/request-event-propagation.html b/LayoutTests/storage/indexeddb/request-event-propagation.html
new file mode 100644
index 0000000..87f6a2d
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/request-event-propagation.html
@@ -0,0 +1,272 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../fast/js/resources/js-test-post-function.js"></script>
+<script src="resources/shared.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("Test event propogation on IDBRequest.");
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+function test()
+{
+ result = evalAndLog("webkitIndexedDB.open('name')");
+ verifyResult(result);
+ result.onsuccess = setVersion;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function setVersion()
+{
+ verifySuccessEvent(event);
+ db = evalAndLog("db = event.result");
+
+ result = evalAndLog("db.setVersion('new version')");
+ verifyResult(result);
+ result.onsuccess = deleteExisting;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function deleteExisting()
+{
+ debug("setVersionSuccess():");
+ verifySuccessEvent(event);
+ window.trans = evalAndLog("trans = event.result");
+ shouldBeTrue("trans !== null");
+ trans.onabort = unexpectedAbortCallback;
+ evalAndLog("trans.oncomplete = startTest");
+
+ deleteAllObjectStores(db, createObjectStore);
+}
+
+function createObjectStore()
+{
+ store = evalAndLog("store = db.createObjectStore('storeName', null)");
+ result = evalAndLog("store.add({x: 'value', y: 'zzz'}, 'key')");
+ result.onerror = unexpectedErrorCallback;
+}
+
+function startTest()
+{
+ debug("Verify that handler fires and that not preventing default will result in an abort");
+ trans = evalAndLog("trans = db.transaction([], webkitIDBTransaction.READ_WRITE)");
+ evalAndLog("trans.onabort = transactionAborted");
+ evalAndLog("trans.oncomplete = unexpectedCompleteCallback");
+ evalAndLog("trans.onerror = allowDefault");
+ store = evalAndLog("store = trans.objectStore('storeName')");
+ result = evalAndLog("store.add({x: 'value', y: 'zzz'}, 'key')");
+ result.onsuccess = unexpectedSuccessCallback;
+ handlerFired = false;
+}
+
+function allowDefault()
+{
+ testPassed("Event handler fired");
+ debug("Doing nothing to prevent the default action...");
+ handlerFired = true;
+}
+
+function transactionAborted()
+{
+ shouldBeTrue("handlerFired");
+ debug("");
+ debug("Verifing error");
+ trans = evalAndLog("trans = db.transaction([], webkitIDBTransaction.READ_WRITE)");
+ evalAndLog("trans.onabort = transactionAborted2");
+ evalAndLog("trans.oncomplete = unexpectedAbortCallback");
+ evalAndLog("trans.addEventListener('error', errorCaptureCallback, true)");
+ evalAndLog("trans.addEventListener('error', errorBubbleCallback, false)");
+ evalAndLog("trans.addEventListener('success', unexpectedSuccessCallback, true)");
+ evalAndLog("trans.addEventListener('success', unexpectedSuccessCallback, false)");
+ evalAndLog("db.addEventListener('error', dbErrorCaptureCallback, true)");
+ evalAndLog("db.addEventListener('error', dbErrorBubbleCallback, false)");
+ evalAndLog("db.addEventListener('success', unexpectedSuccessCallback, true)");
+ evalAndLog("db.addEventListener('success', unexpectedSuccessCallback, false)");
+ store = evalAndLog("store = trans.objectStore('storeName')");
+ result = evalAndLog("store.add({x: 'value', y: 'zzz'}, 'key')");
+ result.onsuccess = unexpectedSuccessCallback;
+ result.onerror = errorFiredCallback;
+ dbCaptureFired = false;
+ captureFired = false;
+ requestFired = false;
+ bubbleFired = false;
+ dbBubbleFired = false;
+}
+
+function dbErrorCaptureCallback()
+{
+ debug("");
+ debug("In IDBDatabase error capture");
+ shouldBeFalse("dbCaptureFired");
+ shouldBeFalse("captureFired");
+ shouldBeFalse("requestFired");
+ shouldBeFalse("bubbleFired");
+ shouldBeFalse("dbBubbleFired");
+ dbCaptureFired = true;
+}
+
+function errorCaptureCallback()
+{
+ debug("");
+ debug("In IDBTransaction error capture");
+ shouldBeTrue("dbCaptureFired");
+ shouldBeFalse("captureFired");
+ shouldBeFalse("requestFired");
+ shouldBeFalse("bubbleFired");
+ shouldBeFalse("dbBubbleFired");
+ captureFired = true;
+}
+
+function errorFiredCallback()
+{
+ debug("");
+ debug("In IDBRequest handler");
+ shouldBeTrue("dbCaptureFired");
+ shouldBeTrue("captureFired");
+ shouldBeFalse("requestFired");
+ shouldBeFalse("bubbleFired");
+ shouldBeFalse("dbBubbleFired");
+ requestFired = true;
+}
+
+function errorBubbleCallback()
+{
+ debug("");
+ debug("In IDBTransaction error bubble");
+ shouldBeTrue("dbCaptureFired");
+ shouldBeTrue("captureFired");
+ shouldBeTrue("requestFired");
+ shouldBeFalse("bubbleFired");
+ shouldBeFalse("dbBubbleFired");
+ bubbleFired = true;
+}
+
+function dbErrorBubbleCallback()
+{
+ debug("");
+ debug("In IDBDatabase error bubble");
+ shouldBeTrue("dbCaptureFired");
+ shouldBeTrue("captureFired");
+ shouldBeTrue("requestFired");
+ shouldBeTrue("bubbleFired");
+ shouldBeFalse("dbBubbleFired");
+ dbBubbleFired = true;
+}
+
+function transactionAborted2()
+{
+ debug("");
+ debug("Transaction aborted");
+ shouldBeTrue("dbCaptureFired");
+ shouldBeTrue("captureFired");
+ shouldBeTrue("requestFired");
+ shouldBeTrue("bubbleFired");
+ shouldBeTrue("dbBubbleFired");
+ debug("");
+ debug("Verifing success.");
+ trans = evalAndLog("trans = db.transaction([], webkitIDBTransaction.READ_WRITE)");
+ evalAndLog("trans.oncomplete = transactionComplete");
+ evalAndLog("trans.onabort = unexpectedAbortCallback");
+ evalAndLog("trans.addEventListener('success', successCaptureCallback, true)");
+ evalAndLog("trans.addEventListener('success', successBubbleCallback, false)");
+ evalAndLog("trans.addEventListener('error', unexpectedErrorCallback, true)");
+ evalAndLog("trans.addEventListener('error', unexpectedErrorCallback, false)");
+ evalAndLog("db.removeEventListener('error', dbErrorCaptureCallback, true)");
+ evalAndLog("db.removeEventListener('error', dbErrorBubbleCallback, false)");
+ evalAndLog("db.removeEventListener('success', unexpectedSuccessCallback, true)");
+ evalAndLog("db.removeEventListener('success', unexpectedSuccessCallback, false)");
+ evalAndLog("db.addEventListener('success', dbSuccessCaptureCallback, true)");
+ evalAndLog("db.addEventListener('success', dbSuccessBubbleCallback, false)");
+ evalAndLog("db.addEventListener('error', unexpectedErrorCallback, true)");
+ evalAndLog("db.addEventListener('error', unexpectedErrorCallback, false)");
+ store = evalAndLog("store = trans.objectStore('storeName')");
+ result = evalAndLog("store.add({x: 'value', y: 'zzz'}, 'key2')");
+ result.onerror = unexpectedErrorCallback;
+ result.onsuccess = successFiredCallback;
+ dbCaptureFired = false;
+ captureFired = false;
+ requestFired = false;
+ bubbleFired = false;
+ dbBubbleFired = false;
+}
+
+function dbSuccessCaptureCallback()
+{
+ debug("");
+ debug("In IDBDatabase success capture");
+ shouldBeFalse("dbCaptureFired");
+ shouldBeFalse("captureFired");
+ shouldBeFalse("requestFired");
+ shouldBeFalse("bubbleFired");
+ shouldBeFalse("dbBubbleFired");
+ dbCaptureFired = true;
+}
+
+function successCaptureCallback()
+{
+ debug("");
+ debug("In IDBTransaction success capture");
+ shouldBeTrue("dbCaptureFired");
+ shouldBeFalse("captureFired");
+ shouldBeFalse("requestFired");
+ shouldBeFalse("bubbleFired");
+ shouldBeFalse("dbBubbleFired");
+ captureFired = true;
+}
+
+function successFiredCallback()
+{
+ debug("");
+ debug("In IDBRequest handler");
+ shouldBeTrue("dbCaptureFired");
+ shouldBeTrue("captureFired");
+ shouldBeFalse("requestFired");
+ shouldBeFalse("bubbleFired");
+ shouldBeFalse("dbBubbleFired");
+ requestFired = true;
+}
+
+function successBubbleCallback()
+{
+ debug("");
+ debug("In IDBTransaction success bubble");
+ testFailed("Success bubble callback should NOT fire");
+ bubbleFired = true;
+}
+
+function dbSuccessBubbleCallback()
+{
+ debug("");
+ debug("In IDBDatabase success bubble");
+ testFailed("Success bubble callback should NOT fire");
+ dbBubbleFired = true;
+}
+
+function transactionComplete()
+{
+ debug("");
+ debug("Transaction completed");
+ shouldBeTrue("dbCaptureFired");
+ shouldBeTrue("captureFired");
+ shouldBeTrue("requestFired");
+ shouldBeFalse("bubbleFired");
+ shouldBeFalse("dbBubbleFired");
+ debug("");
+
+ done();
+ return;
+}
+
+test();
+
+var successfullyParsed = true;
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/indexeddb/transaction-after-close-expected.txt b/LayoutTests/storage/indexeddb/transaction-after-close-expected.txt
new file mode 100644
index 0000000..653bd87
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/transaction-after-close-expected.txt
@@ -0,0 +1,95 @@
+Test closing a database connection in IndexedDB.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS 'webkitIndexedDB' in window is true
+PASS webkitIndexedDB == null is false
+webkitIndexedDB.open('some db name')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+openSuccess():
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+db = event.result
+result = db.setVersion('version 1')
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+Deleted all object stores.
+store = db.createObjectStore('store')
+request = store.put('x', 'y')
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+running first transaction
+currentTransaction = db.transaction([], webkitIDBTransaction.READ_WRITE)
+objectStore.put('a', 'b')
+db.close()
+Expecting exception from db.transaction([], webkitIDBTransaction.READ_WRITE)
+PASS code is webkitIDBDatabaseException.NOT_ALLOWED_ERR
+
+verify that we can reopen the db after calling close
+webkitIndexedDB.open('some db name')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+second_db = event.result
+currentTransaction = second_db.transaction([], webkitIDBTransaction.READ_WRITE)
+request = store.put('1', '2')
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/indexeddb/transaction-after-close.html b/LayoutTests/storage/indexeddb/transaction-after-close.html
new file mode 100644
index 0000000..718c05a
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/transaction-after-close.html
@@ -0,0 +1,105 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../fast/js/resources/js-test-post-function.js"></script>
+<script src="resources/shared.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("Test closing a database connection in IndexedDB.");
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+function test()
+{
+ shouldBeTrue("'webkitIndexedDB' in window");
+ shouldBeFalse("webkitIndexedDB == null");
+
+ result = evalAndLog("webkitIndexedDB.open('some db name')");
+ verifyResult(result);
+ result.onsuccess = openSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function openSuccess()
+{
+ debug("openSuccess():");
+ verifySuccessEvent(event);
+ window.db = evalAndLog("db = event.result");
+ result = evalAndLog("result = db.setVersion('version 1')");
+ result.onsuccess = inSetVersion;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function inSetVersion()
+{
+ verifySuccessEvent(event);
+ deleteAllObjectStores(db, doSetVersionStuff);
+}
+
+function doSetVersionStuff()
+{
+ event.result.oncomplete = runFirstRegularTransaction;
+ event.result.onabort = unexpectedAbortCallback;
+ store = evalAndLog("store = db.createObjectStore('store')");
+ request = evalAndLog("request = store.put('x', 'y')");
+ request.onsuccess = onPutSuccess;
+ request.onerror = unexpectedErrorCallback;
+}
+
+function onPutSuccess()
+{
+ verifySuccessEvent(event);
+}
+
+function runFirstRegularTransaction()
+{
+ debug("running first transaction")
+ currentTransaction = evalAndLog("currentTransaction = db.transaction([], webkitIDBTransaction.READ_WRITE)");
+ currentTransaction.onabort = unexpectedAbortCallback;
+ currentTransaction.oncomplete = firstTransactionComplete;
+ objectStore = currentTransaction.objectStore('store');
+ result = evalAndLog("objectStore.put('a', 'b')");
+ result.onerror = unexpectedErrorCallback;
+}
+
+function firstTransactionComplete()
+{
+ evalAndLog("db.close()");
+ evalAndExpectException("db.transaction([], webkitIDBTransaction.READ_WRITE)", "webkitIDBDatabaseException.NOT_ALLOWED_ERR");
+
+ debug("")
+ debug("verify that we can reopen the db after calling close")
+ result = evalAndLog("webkitIndexedDB.open('some db name')");
+ verifyResult(result);
+ result.onsuccess = onSecondOpen
+ result.onerror = unexpectedErrorCallback;
+}
+
+function onSecondOpen() {
+ verifySuccessEvent(event);
+ second_db = evalAndLog("second_db = event.result");
+ currentTransaction = evalAndLog("currentTransaction = second_db.transaction([], webkitIDBTransaction.READ_WRITE)");
+ store = currentTransaction.objectStore('store');
+ request = evalAndLog("request = store.put('1', '2')");
+ request.onsuccess = onFinalPutSuccess;
+ request.onerror = unexpectedErrorCallback;
+ currentTransaction.oncomplete = done;
+ currentTransaction.onabort = unexpectedAbortCallback;
+}
+
+function onFinalPutSuccess() {
+ verifySuccessEvent(event);
+}
+
+var successfullyParsed = true;
+
+test();
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/indexeddb/transaction-and-objectstore-calls-expected.txt b/LayoutTests/storage/indexeddb/transaction-and-objectstore-calls-expected.txt
index df373d6..36ca01e 100644
--- a/LayoutTests/storage/indexeddb/transaction-and-objectstore-calls-expected.txt
+++ b/LayoutTests/storage/indexeddb/transaction-and-objectstore-calls-expected.txt
@@ -17,42 +17,42 @@ trans = event.result
Deleted all object stores.
db.createObjectStore('a')
db.createObjectStore('b')
-trans.oncomplete = created
+trans.addEventListener('complete', created, true)
-trans = db.transaction({objectStoreNames: 'a'})
+trans = db.transaction(['a'])
trans.objectStore('a')
Expecting exception from trans.objectStore('b')
PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
Expecting exception from trans.objectStore('x')
PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
-trans = db.transaction({objectStoreNames: ['a']})
+trans = db.transaction(['a'])
trans.objectStore('a')
Expecting exception from trans.objectStore('b')
PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
Expecting exception from trans.objectStore('x')
PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
-trans = db.transaction({objectStoreNames: ['b']})
+trans = db.transaction(['b'])
trans.objectStore('b')
Expecting exception from trans.objectStore('a')
PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
Expecting exception from trans.objectStore('x')
PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
-trans = db.transaction({objectStoreNames: ['a', 'b']})
+trans = db.transaction(['a', 'b'])
trans.objectStore('a')
trans.objectStore('b')
Expecting exception from trans.objectStore('x')
PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
-trans = db.transaction({objectStoreNames: ['b', 'a']})
+trans = db.transaction(['b', 'a'])
trans.objectStore('a')
trans.objectStore('b')
Expecting exception from trans.objectStore('x')
PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
-trans = db.transaction({objectStoreNames: []})
+trans = db.transaction([])
trans.objectStore('a')
trans.objectStore('b')
Expecting exception from trans.objectStore('x')
@@ -64,15 +64,15 @@ trans.objectStore('b')
Expecting exception from trans.objectStore('x')
PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
-Expecting exception from db.transaction({objectStoreNames: 'x'})
+Expecting exception from db.transaction(['x'])
PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
-Expecting exception from db.transaction({objectStoreNames: ['x']})
+Expecting exception from db.transaction(['x'])
PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
-Expecting exception from db.transaction({objectStoreNames: ['a', 'x']})
+Expecting exception from db.transaction(['a', 'x'])
PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
-Expecting exception from db.transaction({objectStoreNames: ['x', 'x']})
+Expecting exception from db.transaction(['x', 'x'])
PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
-Expecting exception from db.transaction({objectStoreNames: ['a', 'x', 'b']})
+Expecting exception from db.transaction(['a', 'x', 'b'])
PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
PASS successfullyParsed is true
diff --git a/LayoutTests/storage/indexeddb/transaction-and-objectstore-calls.html b/LayoutTests/storage/indexeddb/transaction-and-objectstore-calls.html
index 580ca5d..144df4f 100644
--- a/LayoutTests/storage/indexeddb/transaction-and-objectstore-calls.html
+++ b/LayoutTests/storage/indexeddb/transaction-and-objectstore-calls.html
@@ -43,43 +43,43 @@ function cleaned()
{
evalAndLog("db.createObjectStore('a')");
evalAndLog("db.createObjectStore('b')");
- evalAndLog("trans.oncomplete = created");
+ evalAndLog("trans.addEventListener('complete', created, true)");
debug("");
}
function created()
{
- trans = evalAndLog("trans = db.transaction({objectStoreNames: 'a'})");
+ trans = evalAndLog("trans = db.transaction(['a'])");
evalAndLog("trans.objectStore('a')");
evalAndExpectException("trans.objectStore('b')", "webkitIDBDatabaseException.NOT_FOUND_ERR");
evalAndExpectException("trans.objectStore('x')", "webkitIDBDatabaseException.NOT_FOUND_ERR");
debug("");
- trans = evalAndLog("trans = db.transaction({objectStoreNames: ['a']})");
+ trans = evalAndLog("trans = db.transaction(['a'])");
evalAndLog("trans.objectStore('a')");
evalAndExpectException("trans.objectStore('b')", "webkitIDBDatabaseException.NOT_FOUND_ERR");
evalAndExpectException("trans.objectStore('x')", "webkitIDBDatabaseException.NOT_FOUND_ERR");
debug("");
- trans = evalAndLog("trans = db.transaction({objectStoreNames: ['b']})");
+ trans = evalAndLog("trans = db.transaction(['b'])");
evalAndLog("trans.objectStore('b')");
evalAndExpectException("trans.objectStore('a')", "webkitIDBDatabaseException.NOT_FOUND_ERR");
evalAndExpectException("trans.objectStore('x')", "webkitIDBDatabaseException.NOT_FOUND_ERR");
debug("");
- trans = evalAndLog("trans = db.transaction({objectStoreNames: ['a', 'b']})");
+ trans = evalAndLog("trans = db.transaction(['a', 'b'])");
evalAndLog("trans.objectStore('a')");
evalAndLog("trans.objectStore('b')");
evalAndExpectException("trans.objectStore('x')", "webkitIDBDatabaseException.NOT_FOUND_ERR");
debug("");
- trans = evalAndLog("trans = db.transaction({objectStoreNames: ['b', 'a']})");
+ trans = evalAndLog("trans = db.transaction(['b', 'a'])");
evalAndLog("trans.objectStore('a')");
evalAndLog("trans.objectStore('b')");
evalAndExpectException("trans.objectStore('x')", "webkitIDBDatabaseException.NOT_FOUND_ERR");
debug("");
- trans = evalAndLog("trans = db.transaction({objectStoreNames: []})");
+ trans = evalAndLog("trans = db.transaction([])");
evalAndLog("trans.objectStore('a')");
evalAndLog("trans.objectStore('b')");
evalAndExpectException("trans.objectStore('x')", "webkitIDBDatabaseException.NOT_FOUND_ERR");
@@ -91,11 +91,11 @@ function created()
evalAndExpectException("trans.objectStore('x')", "webkitIDBDatabaseException.NOT_FOUND_ERR");
debug("");
- evalAndExpectException("db.transaction({objectStoreNames: 'x'})", "webkitIDBDatabaseException.NOT_FOUND_ERR");
- evalAndExpectException("db.transaction({objectStoreNames: ['x']})", "webkitIDBDatabaseException.NOT_FOUND_ERR");
- evalAndExpectException("db.transaction({objectStoreNames: ['a', 'x']})", "webkitIDBDatabaseException.NOT_FOUND_ERR");
- evalAndExpectException("db.transaction({objectStoreNames: ['x', 'x']})", "webkitIDBDatabaseException.NOT_FOUND_ERR");
- evalAndExpectException("db.transaction({objectStoreNames: ['a', 'x', 'b']})", "webkitIDBDatabaseException.NOT_FOUND_ERR");
+ evalAndExpectException("db.transaction(['x'])", "webkitIDBDatabaseException.NOT_FOUND_ERR");
+ evalAndExpectException("db.transaction(['x'])", "webkitIDBDatabaseException.NOT_FOUND_ERR");
+ evalAndExpectException("db.transaction(['a', 'x'])", "webkitIDBDatabaseException.NOT_FOUND_ERR");
+ evalAndExpectException("db.transaction(['x', 'x'])", "webkitIDBDatabaseException.NOT_FOUND_ERR");
+ evalAndExpectException("db.transaction(['a', 'x', 'b'])", "webkitIDBDatabaseException.NOT_FOUND_ERR");
debug("");
done();
diff --git a/LayoutTests/storage/indexeddb/transaction-basics.html b/LayoutTests/storage/indexeddb/transaction-basics.html
index 8995e6d..9626129 100644
--- a/LayoutTests/storage/indexeddb/transaction-basics.html
+++ b/LayoutTests/storage/indexeddb/transaction-basics.html
@@ -55,7 +55,7 @@ function addRemoveIDBObjects()
verifySuccessEvent(event);
var trans = evalAndLog("trans = event.result");
shouldBeTrue("trans !== null");
- trans.onabort = testSetVersionAbort2;
+ trans.addEventListener('abort', testSetVersionAbort2, true);
trans.oncomplete = unexpectedCompleteCallback;
var store = evalAndLog("store = db.createObjectStore('storeFail', null)");
@@ -80,7 +80,7 @@ function addRemoveAddIDBObjects()
verifySuccessEvent(event);
var trans = evalAndLog("trans = event.result");
shouldBeTrue("trans !== null");
- trans.onabort = testSetVersionAbort3;
+ trans.addEventListener('abort', testSetVersionAbort3, false);
trans.oncomplete = unexpectedCompleteCallback;
var store = evalAndLog("store = db.createObjectStore('storeFail', null)");
@@ -209,7 +209,7 @@ function setVersionSuccess()
window.trans = evalAndLog("trans = event.result");
shouldBeTrue("trans !== null");
trans.onabort = unexpectedAbortCallback;
- trans.oncomplete = completeCallback;
+ trans.addEventListener('complete', completeCallback, false);
window.completeEventFired = false;
deleteAllObjectStores(db, createObjectStoreAndStartTransaction);
diff --git a/LayoutTests/storage/indexeddb/transaction-event-propagation-expected.txt b/LayoutTests/storage/indexeddb/transaction-event-propagation-expected.txt
new file mode 100644
index 0000000..9d04b0a
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/transaction-event-propagation-expected.txt
@@ -0,0 +1,79 @@
+Test event propogation on IDBTransaction.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+webkitIndexedDB.open('name')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+db = event.result
+db.setVersion('new version')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+trans = event.result
+PASS trans !== null is true
+trans.oncomplete = startTest
+Deleted all object stores.
+store = db.createObjectStore('storeName', null)
+store.add({x: 'value', y: 'zzz'}, 'key')
+Verifing abort
+trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
+trans.onabort = abortFiredCallback
+trans.oncomplete = unexpectedAbortCallback
+db.addEventListener('abort', dbAbortCaptureCallback, true)
+db.addEventListener('abort', dbAbortBubbleCallback, false)
+db.addEventListener('complete', unexpectedCompleteCallback, true)
+db.addEventListener('complete', unexpectedCompleteCallback, false)
+store = trans.objectStore('storeName')
+store.add({x: 'value', y: 'zzz'}, 'key')
+
+In IDBDatabase abort capture
+PASS dbCaptureFired is false
+PASS abortFired is false
+PASS dbBubbleFired1 is false
+
+In abort handler
+PASS dbCaptureFired is true
+PASS abortFired is false
+PASS dbBubbleFired1 is false
+
+In IDBDatabase error bubble
+PASS dbCaptureFired is true
+PASS abortFired is true
+PASS dbBubbleFired1 is false
+
+Verifing success.
+trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
+trans.oncomplete = completeFiredCallback
+trans.onabort = unexpectedAbortCallback
+db.removeEventListener('abort', dbAbortCaptureCallback, true)
+db.removeEventListener('abort', dbAbortBubbleCallback, false)
+db.removeEventListener('complete', unexpectedCompleteCallback, true)
+db.removeEventListener('complete', unexpectedCompleteCallback, false)
+db.addEventListener('complete', dbCompleteCaptureCallback, true)
+db.addEventListener('complete', dbCompleteBubbleCallback, false)
+db.addEventListener('abort', unexpectedAbortCallback, true)
+db.addEventListener('abort', unexpectedAbortCallback, false)
+store = trans.objectStore('storeName')
+store.add({x: 'value', y: 'zzz'}, 'key2')
+
+In IDBDatabase complete capture
+PASS dbCaptureFired is false
+PASS completeFired is false
+PASS dbBubbleFired2 is false
+
+In IDBRequest handler
+PASS dbCaptureFired is true
+PASS completeFired is false
+PASS dbBubbleFired2 is false
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/indexeddb/transaction-event-propagation.html b/LayoutTests/storage/indexeddb/transaction-event-propagation.html
new file mode 100644
index 0000000..c31646a
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/transaction-event-propagation.html
@@ -0,0 +1,153 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../fast/js/resources/js-test-post-function.js"></script>
+<script src="resources/shared.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("Test event propogation on IDBTransaction.");
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+function test()
+{
+ result = evalAndLog("webkitIndexedDB.open('name')");
+ verifyResult(result);
+ result.onsuccess = setVersion;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function setVersion()
+{
+ db = evalAndLog("db = event.result");
+
+ result = evalAndLog("db.setVersion('new version')");
+ verifyResult(result);
+ result.onsuccess = deleteExisting;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function deleteExisting()
+{
+ window.trans = evalAndLog("trans = event.result");
+ shouldBeTrue("trans !== null");
+ trans.onabort = unexpectedAbortCallback;
+ evalAndLog("trans.oncomplete = startTest");
+
+ deleteAllObjectStores(db, createObjectStore);
+}
+
+function createObjectStore()
+{
+ store = evalAndLog("store = db.createObjectStore('storeName', null)");
+ result = evalAndLog("store.add({x: 'value', y: 'zzz'}, 'key')");
+ result.onerror = unexpectedErrorCallback;
+}
+
+function startTest()
+{
+ debug("Verifing abort");
+ trans = evalAndLog("trans = db.transaction([], webkitIDBTransaction.READ_WRITE)");
+ evalAndLog("trans.onabort = abortFiredCallback");
+ evalAndLog("trans.oncomplete = unexpectedAbortCallback");
+ evalAndLog("db.addEventListener('abort', dbAbortCaptureCallback, true)");
+ evalAndLog("db.addEventListener('abort', dbAbortBubbleCallback, false)");
+ evalAndLog("db.addEventListener('complete', unexpectedCompleteCallback, true)");
+ evalAndLog("db.addEventListener('complete', unexpectedCompleteCallback, false)");
+ store = evalAndLog("store = trans.objectStore('storeName')");
+ evalAndLog("store.add({x: 'value', y: 'zzz'}, 'key')");
+ dbCaptureFired = false;
+ abortFired = false;
+ dbBubbleFired1 = false;
+}
+
+function dbAbortCaptureCallback()
+{
+ debug("");
+ debug("In IDBDatabase abort capture");
+ shouldBeFalse("dbCaptureFired");
+ shouldBeFalse("abortFired");
+ shouldBeFalse("dbBubbleFired1");
+ dbCaptureFired = true;
+}
+
+function abortFiredCallback()
+{
+ debug("");
+ debug("In abort handler");
+ shouldBeTrue("dbCaptureFired");
+ shouldBeFalse("abortFired");
+ shouldBeFalse("dbBubbleFired1");
+ abortFired = true;
+}
+
+function dbAbortBubbleCallback()
+{
+ debug("");
+ debug("In IDBDatabase error bubble");
+ shouldBeTrue("dbCaptureFired");
+ shouldBeTrue("abortFired");
+ shouldBeFalse("dbBubbleFired1");
+ dbBubbleFired1 = true;
+ debug("");
+ debug("Verifing success.");
+ trans = evalAndLog("trans = db.transaction([], webkitIDBTransaction.READ_WRITE)");
+ evalAndLog("trans.oncomplete = completeFiredCallback");
+ evalAndLog("trans.onabort = unexpectedAbortCallback");
+ evalAndLog("db.removeEventListener('abort', dbAbortCaptureCallback, true)");
+ evalAndLog("db.removeEventListener('abort', dbAbortBubbleCallback, false)");
+ evalAndLog("db.removeEventListener('complete', unexpectedCompleteCallback, true)");
+ evalAndLog("db.removeEventListener('complete', unexpectedCompleteCallback, false)");
+ evalAndLog("db.addEventListener('complete', dbCompleteCaptureCallback, true)");
+ evalAndLog("db.addEventListener('complete', dbCompleteBubbleCallback, false)");
+ evalAndLog("db.addEventListener('abort', unexpectedAbortCallback, true)");
+ evalAndLog("db.addEventListener('abort', unexpectedAbortCallback, false)");
+ store = evalAndLog("store = trans.objectStore('storeName')");
+ evalAndLog("store.add({x: 'value', y: 'zzz'}, 'key2')");
+ dbCaptureFired = false;
+ completeFired = false;
+ dbBubbleFired2 = false;
+}
+
+function dbCompleteCaptureCallback()
+{
+ debug("");
+ debug("In IDBDatabase complete capture");
+ shouldBeFalse("dbCaptureFired");
+ shouldBeFalse("completeFired");
+ shouldBeFalse("dbBubbleFired2");
+ dbCaptureFired = true;
+}
+
+function completeFiredCallback()
+{
+ debug("");
+ debug("In IDBRequest handler");
+ shouldBeTrue("dbCaptureFired");
+ shouldBeFalse("completeFired");
+ shouldBeFalse("dbBubbleFired2");
+ completeFired = true;
+ debug("");
+ done();
+}
+
+function dbCompleteBubbleCallback()
+{
+ debug("");
+ debug("In IDBDatabase complete bubble");
+ testFailed("Complete bubble callback should NOT fire");
+ dbBubbleFired2 = true;
+}
+
+test();
+
+var successfullyParsed = true;
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/indexeddb/tutorial.html b/LayoutTests/storage/indexeddb/tutorial.html
index 445213c..0490df8 100644
--- a/LayoutTests/storage/indexeddb/tutorial.html
+++ b/LayoutTests/storage/indexeddb/tutorial.html
@@ -114,7 +114,7 @@ function onSetVersion()
{
// We are now in a setVersion transaction. Such a transaction is the only place where one
// can add or delete indexes and objectStores. The result (property of event) is an
- // IDBTransaction object that has "complete", "abort", and "timeout" event handlers which tell
+ // IDBTransaction object that has "complete" and "abort" event handlers which tell
// us when the transaction has committed, aborted, or timed out.
window.currentTransaction = event.result;
currentTransaction.oncomplete = onSetVersionComplete;
@@ -207,7 +207,7 @@ function onSetVersionComplete()
{
// Lets create a new transaction and then not schedule any work on it to watch it abort itself.
// Transactions (besides those created with setVersion) are created synchronously. Like
- // createObjectStore, transaction optionally takes in an object with various optional parameters.
+ // createObjectStore, transaction optionally takes in various optional parameters.
//
// First of all is the parameter "objectStoreNames". If you pass in a string, we lock just that
// objectStore. If you pass in an array, we lock those. Otherwise (for example, if you omit it
@@ -218,11 +218,7 @@ function onSetVersionComplete()
// Next is "mode" which specifies the locking mode. The default is READ_ONLY (i.e. a shared lock).
// That's fine for this case, but later we'll ask for IDBTransaction.READ_WRITE. At the moment,
// Chromium/WebKit pretends every transaction is READ_WRITE, which is kind of bad.
- //
- // Last is "timeout" which is measured in seconds. At the moment, Chromium/WebKit defaults to 0 which
- // means never, but it's possible we'll change this in the future and other implementations may
- // use something different, so set it if you really care.
- window.currentTransaction = db.transaction({mode: IDBTransaction.READ_WRITE, timeout: 0});
+ window.currentTransaction = db.transaction([], IDBTransaction.READ_WRITE);
currentTransaction.oncomplete = unexpectedComplete;
currentTransaction.onabort = onTransactionAborted;
@@ -272,7 +268,7 @@ function onTransactionAborted()
// Now let's make a real transaction and a person to our objectStore. Just to show it's possible,
// we'll omit the objectStoreNames parameter which means we'll lock everything even though we only
// ever access "people".
- window.currentTransaction = db.transaction({mode: IDBTransaction.READ_WRITE});
+ window.currentTransaction = db.transaction([], IDBTransaction.READ_WRITE);
currentTransaction.onabort = unexpectedAbort;
var people = currentTransaction.objectStore("people");
@@ -310,7 +306,7 @@ function onPutTransactionComplete()
// OK, now let's query the people objectStore in a couple different ways. First up, let's try get.
// It simply takes in a key and returns a request whose result will be the value. Note that here
// we're passing in an array for objectStoreNames rather than a simple string.
- window.currentTransaction = db.transaction({objectStoreNames: ["people"], mode: IDBTransaction.READ_WRITE, timeout: 0});
+ window.currentTransaction = db.transaction(["people"], IDBTransaction.READ_WRITE, 0);
currentTransaction.onabort = unexpectedAbort;
var people = currentTransaction.objectStore("people");
@@ -341,7 +337,7 @@ function onGetSuccess()
// return unique entires (only applies to indexes with unique set to false), PREV to move backwards,
// and PREV_NO_DUPLICATE.
var keyRange = IDBKeyRange.bound(1, 3, true, false);
- var request = people.openCursor({range: keyRange, direction: IDBCursor.NEXT});
+ var request = people.openCursor(keyRange, IDBCursor.NEXT);
request.onsuccess = onObjectStoreCursor;
request.onerror = unexpectedError;
}
@@ -394,10 +390,10 @@ function onIndexGetSuccess()
// different IDBKeyRanges just to demonstrate how to use them, but we won't bother to handle
// the onsuccess conditions.
var lname = event.source;
- lname.openCursor({range: IDBKeyRange.lowerBound("Doe", false), direction: IDBCursor.NEXT_NO_DUPLICATE});
- lname.openCursor({direction: IDBCursor.PREV_NO_DUPLICATE});
- lname.openCursor({range: IDBKeyRange.upperBound("ZZZZ")});
- lname.openCursor({range: IDBKeyRange.only("Doe"), direction: IDBCursor.PREV});
+ lname.openCursor(IDBKeyRange.lowerBound("Doe", false), IDBCursor.NEXT_NO_DUPLICATE);
+ lname.openCursor(null, IDBCursor.PREV_NO_DUPLICATE);
+ lname.openCursor(IDBKeyRange.upperBound("ZZZZ"));
+ lname.openCursor(IDBKeyRange.only("Doe"), IDBCursor.PREV);
lname.openCursor();
lname.openKeyCursor();