<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[195299] trunk/LayoutTests</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/195299">195299</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-01-19 11:32:06 -0800 (Tue, 19 Jan 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Modern IDB: Split all storage/indexeddb tests into separate HTML + JS format.
https://bugs.webkit.org/show_bug.cgi?id=153178

Reviewed by Sam Weinig.

* storage/indexeddb/clone-exception.html:
* storage/indexeddb/closed-cursor.html:
* storage/indexeddb/connection-leak.html:
* storage/indexeddb/cursor-cast.html:
* storage/indexeddb/cursor-leak.html:
* storage/indexeddb/cursor-overloads.html:
* storage/indexeddb/cursor-request-cycle.html:
* storage/indexeddb/deleteIndex-bug110792.html:
* storage/indexeddb/deletedatabase-transaction.html:
* storage/indexeddb/metadata-race.html:
* storage/indexeddb/noblobs.html:
* storage/indexeddb/object-lookups-in-versionchange.html:
* storage/indexeddb/open-bad-versions.html:
* storage/indexeddb/optional-arguments.html:
* storage/indexeddb/prefetch-invalidation.html:
* storage/indexeddb/prefetch-race.html:
* storage/indexeddb/primary-key-unique-to-objectstore.html:
* storage/indexeddb/request-leak.html:
* storage/indexeddb/request-result-cache.html:
* storage/indexeddb/resources/clone-exception.js: Copied from LayoutTests/storage/indexeddb/clone-exception.html.
* storage/indexeddb/resources/closed-cursor.js: Copied from LayoutTests/storage/indexeddb/closed-cursor.html.
* storage/indexeddb/resources/connection-leak.js: Copied from LayoutTests/storage/indexeddb/connection-leak.html.
* storage/indexeddb/resources/cursor-cast.js: Copied from LayoutTests/storage/indexeddb/cursor-cast.html.
* storage/indexeddb/resources/cursor-leak.js: Copied from LayoutTests/storage/indexeddb/cursor-leak.html.
* storage/indexeddb/resources/cursor-overloads.js: Copied from LayoutTests/storage/indexeddb/cursor-overloads.html.
* storage/indexeddb/resources/cursor-request-cycle.js: Copied from LayoutTests/storage/indexeddb/cursor-request-cycle.html.
* storage/indexeddb/resources/deleteIndex-bug110792.js: Copied from LayoutTests/storage/indexeddb/deleteIndex-bug110792.html.
* storage/indexeddb/resources/deletedatabase-transaction.js: Copied from LayoutTests/storage/indexeddb/deletedatabase-transaction.html.
* storage/indexeddb/resources/metadata-race.js: Copied from LayoutTests/storage/indexeddb/metadata-race.html.
* storage/indexeddb/resources/noblobs.js: Copied from LayoutTests/storage/indexeddb/noblobs.html.
* storage/indexeddb/resources/object-lookups-in-versionchange.js: Copied from LayoutTests/storage/indexeddb/object-lookups-in-versionchange.html.
* storage/indexeddb/resources/open-bad-versions.js: Copied from LayoutTests/storage/indexeddb/open-bad-versions.html.
* storage/indexeddb/resources/optional-arguments.js: Copied from LayoutTests/storage/indexeddb/optional-arguments.html.
* storage/indexeddb/resources/prefetch-invalidation.js: Copied from LayoutTests/storage/indexeddb/prefetch-invalidation.html.
* storage/indexeddb/resources/prefetch-race.js: Copied from LayoutTests/storage/indexeddb/prefetch-race.html.
* storage/indexeddb/resources/primary-key-unique-to-objectstore.js: Copied from LayoutTests/storage/indexeddb/primary-key-unique-to-objectstore.html.
* storage/indexeddb/resources/request-leak.js: Copied from LayoutTests/storage/indexeddb/request-leak.html.
* storage/indexeddb/resources/request-result-cache.js: Copied from LayoutTests/storage/indexeddb/request-result-cache.html.
* storage/indexeddb/resources/structured-clone.js: Copied from LayoutTests/storage/indexeddb/structured-clone.html.
* storage/indexeddb/resources/transaction-complete-with-js-recursion-cross-frame.js: Copied from LayoutTests/storage/indexeddb/transaction-complete-with-js-recursion-cross-frame.html.
* storage/indexeddb/resources/transaction-complete-with-js-recursion.js: Copied from LayoutTests/storage/indexeddb/transaction-complete-with-js-recursion.html.
* storage/indexeddb/resources/transaction-crash-in-tasks.js: Copied from LayoutTests/storage/indexeddb/transaction-crash-in-tasks.html.
* storage/indexeddb/resources/transaction-ordering.js: Copied from LayoutTests/storage/indexeddb/transaction-ordering.html.
* storage/indexeddb/resources/transaction-overlapping.js: Copied from LayoutTests/storage/indexeddb/transaction-overlapping.html.
* storage/indexeddb/resources/version-change-event-basic.js: Copied from LayoutTests/storage/indexeddb/version-change-event-basic.html.
* storage/indexeddb/resources/version-change-event.js: Copied from LayoutTests/storage/indexeddb/version-change-event.html.
* storage/indexeddb/structured-clone.html:
* storage/indexeddb/transaction-complete-with-js-recursion-cross-frame.html:
* storage/indexeddb/transaction-complete-with-js-recursion.html:
* storage/indexeddb/transaction-crash-in-tasks.html:
* storage/indexeddb/transaction-ordering.html:
* storage/indexeddb/transaction-overlapping.html:
* storage/indexeddb/transaction-starvation.html:
* storage/indexeddb/version-change-event-basic.html:
* storage/indexeddb/version-change-event.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbcloneexceptionhtml">trunk/LayoutTests/storage/indexeddb/clone-exception.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbclosedcursorhtml">trunk/LayoutTests/storage/indexeddb/closed-cursor.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbconnectionleakhtml">trunk/LayoutTests/storage/indexeddb/connection-leak.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbcursorcasthtml">trunk/LayoutTests/storage/indexeddb/cursor-cast.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbcursorleakhtml">trunk/LayoutTests/storage/indexeddb/cursor-leak.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbcursoroverloadshtml">trunk/LayoutTests/storage/indexeddb/cursor-overloads.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbcursorrequestcyclehtml">trunk/LayoutTests/storage/indexeddb/cursor-request-cycle.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbdeleteIndexbug110792html">trunk/LayoutTests/storage/indexeddb/deleteIndex-bug110792.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbdeletedatabasetransactionhtml">trunk/LayoutTests/storage/indexeddb/deletedatabase-transaction.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmetadataracehtml">trunk/LayoutTests/storage/indexeddb/metadata-race.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbnoblobshtml">trunk/LayoutTests/storage/indexeddb/noblobs.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbobjectlookupsinversionchangehtml">trunk/LayoutTests/storage/indexeddb/object-lookups-in-versionchange.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbopenbadversionshtml">trunk/LayoutTests/storage/indexeddb/open-bad-versions.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddboptionalargumentshtml">trunk/LayoutTests/storage/indexeddb/optional-arguments.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbprefetchinvalidationhtml">trunk/LayoutTests/storage/indexeddb/prefetch-invalidation.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbprefetchracehtml">trunk/LayoutTests/storage/indexeddb/prefetch-race.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbprimarykeyuniquetoobjectstorehtml">trunk/LayoutTests/storage/indexeddb/primary-key-unique-to-objectstore.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbrequestleakhtml">trunk/LayoutTests/storage/indexeddb/request-leak.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbrequestresultcachehtml">trunk/LayoutTests/storage/indexeddb/request-result-cache.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbstructuredclonehtml">trunk/LayoutTests/storage/indexeddb/structured-clone.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbtransactioncompletewithjsrecursioncrossframehtml">trunk/LayoutTests/storage/indexeddb/transaction-complete-with-js-recursion-cross-frame.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbtransactioncompletewithjsrecursionhtml">trunk/LayoutTests/storage/indexeddb/transaction-complete-with-js-recursion.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbtransactioncrashintaskshtml">trunk/LayoutTests/storage/indexeddb/transaction-crash-in-tasks.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbtransactionorderinghtml">trunk/LayoutTests/storage/indexeddb/transaction-ordering.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbtransactionoverlappinghtml">trunk/LayoutTests/storage/indexeddb/transaction-overlapping.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbtransactionstarvationhtml">trunk/LayoutTests/storage/indexeddb/transaction-starvation.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbversionchangeeventbasichtml">trunk/LayoutTests/storage/indexeddb/version-change-event-basic.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbversionchangeeventhtml">trunk/LayoutTests/storage/indexeddb/version-change-event.html</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcescloneexceptionjs">trunk/LayoutTests/storage/indexeddb/resources/clone-exception.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcesclosedcursorjs">trunk/LayoutTests/storage/indexeddb/resources/closed-cursor.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcesconnectionleakjs">trunk/LayoutTests/storage/indexeddb/resources/connection-leak.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcescursorcastjs">trunk/LayoutTests/storage/indexeddb/resources/cursor-cast.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcescursorleakjs">trunk/LayoutTests/storage/indexeddb/resources/cursor-leak.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcescursoroverloadsjs">trunk/LayoutTests/storage/indexeddb/resources/cursor-overloads.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcescursorrequestcyclejs">trunk/LayoutTests/storage/indexeddb/resources/cursor-request-cycle.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcesdeleteIndexbug110792js">trunk/LayoutTests/storage/indexeddb/resources/deleteIndex-bug110792.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcesdeletedatabasetransactionjs">trunk/LayoutTests/storage/indexeddb/resources/deletedatabase-transaction.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcesmetadataracejs">trunk/LayoutTests/storage/indexeddb/resources/metadata-race.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcesnoblobsjs">trunk/LayoutTests/storage/indexeddb/resources/noblobs.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcesobjectlookupsinversionchangejs">trunk/LayoutTests/storage/indexeddb/resources/object-lookups-in-versionchange.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcesopenbadversionsjs">trunk/LayoutTests/storage/indexeddb/resources/open-bad-versions.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcesoptionalargumentsjs">trunk/LayoutTests/storage/indexeddb/resources/optional-arguments.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcesprefetchinvalidationjs">trunk/LayoutTests/storage/indexeddb/resources/prefetch-invalidation.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcesprefetchracejs">trunk/LayoutTests/storage/indexeddb/resources/prefetch-race.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcesprimarykeyuniquetoobjectstorejs">trunk/LayoutTests/storage/indexeddb/resources/primary-key-unique-to-objectstore.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcesrequestleakjs">trunk/LayoutTests/storage/indexeddb/resources/request-leak.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcesrequestresultcachejs">trunk/LayoutTests/storage/indexeddb/resources/request-result-cache.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcesstructuredclonejs">trunk/LayoutTests/storage/indexeddb/resources/structured-clone.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcestransactioncompletewithjsrecursioncrossframejs">trunk/LayoutTests/storage/indexeddb/resources/transaction-complete-with-js-recursion-cross-frame.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcestransactioncompletewithjsrecursionjs">trunk/LayoutTests/storage/indexeddb/resources/transaction-complete-with-js-recursion.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcestransactioncrashintasksjs">trunk/LayoutTests/storage/indexeddb/resources/transaction-crash-in-tasks.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcestransactionorderingjs">trunk/LayoutTests/storage/indexeddb/resources/transaction-ordering.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcestransactionoverlappingjs">trunk/LayoutTests/storage/indexeddb/resources/transaction-overlapping.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcesversionchangeeventbasicjs">trunk/LayoutTests/storage/indexeddb/resources/version-change-event-basic.js</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbresourcesversionchangeeventjs">trunk/LayoutTests/storage/indexeddb/resources/version-change-event.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/ChangeLog        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,3 +1,66 @@
</span><ins>+2016-01-19  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Modern IDB: Split all storage/indexeddb tests into separate HTML + JS format.
+        https://bugs.webkit.org/show_bug.cgi?id=153178
+
+        Reviewed by Sam Weinig.
+
+        * storage/indexeddb/clone-exception.html:
+        * storage/indexeddb/closed-cursor.html:
+        * storage/indexeddb/connection-leak.html:
+        * storage/indexeddb/cursor-cast.html:
+        * storage/indexeddb/cursor-leak.html:
+        * storage/indexeddb/cursor-overloads.html:
+        * storage/indexeddb/cursor-request-cycle.html:
+        * storage/indexeddb/deleteIndex-bug110792.html:
+        * storage/indexeddb/deletedatabase-transaction.html:
+        * storage/indexeddb/metadata-race.html:
+        * storage/indexeddb/noblobs.html:
+        * storage/indexeddb/object-lookups-in-versionchange.html:
+        * storage/indexeddb/open-bad-versions.html:
+        * storage/indexeddb/optional-arguments.html:
+        * storage/indexeddb/prefetch-invalidation.html:
+        * storage/indexeddb/prefetch-race.html:
+        * storage/indexeddb/primary-key-unique-to-objectstore.html:
+        * storage/indexeddb/request-leak.html:
+        * storage/indexeddb/request-result-cache.html:
+        * storage/indexeddb/resources/clone-exception.js: Copied from LayoutTests/storage/indexeddb/clone-exception.html.
+        * storage/indexeddb/resources/closed-cursor.js: Copied from LayoutTests/storage/indexeddb/closed-cursor.html.
+        * storage/indexeddb/resources/connection-leak.js: Copied from LayoutTests/storage/indexeddb/connection-leak.html.
+        * storage/indexeddb/resources/cursor-cast.js: Copied from LayoutTests/storage/indexeddb/cursor-cast.html.
+        * storage/indexeddb/resources/cursor-leak.js: Copied from LayoutTests/storage/indexeddb/cursor-leak.html.
+        * storage/indexeddb/resources/cursor-overloads.js: Copied from LayoutTests/storage/indexeddb/cursor-overloads.html.
+        * storage/indexeddb/resources/cursor-request-cycle.js: Copied from LayoutTests/storage/indexeddb/cursor-request-cycle.html.
+        * storage/indexeddb/resources/deleteIndex-bug110792.js: Copied from LayoutTests/storage/indexeddb/deleteIndex-bug110792.html.
+        * storage/indexeddb/resources/deletedatabase-transaction.js: Copied from LayoutTests/storage/indexeddb/deletedatabase-transaction.html.
+        * storage/indexeddb/resources/metadata-race.js: Copied from LayoutTests/storage/indexeddb/metadata-race.html.
+        * storage/indexeddb/resources/noblobs.js: Copied from LayoutTests/storage/indexeddb/noblobs.html.
+        * storage/indexeddb/resources/object-lookups-in-versionchange.js: Copied from LayoutTests/storage/indexeddb/object-lookups-in-versionchange.html.
+        * storage/indexeddb/resources/open-bad-versions.js: Copied from LayoutTests/storage/indexeddb/open-bad-versions.html.
+        * storage/indexeddb/resources/optional-arguments.js: Copied from LayoutTests/storage/indexeddb/optional-arguments.html.
+        * storage/indexeddb/resources/prefetch-invalidation.js: Copied from LayoutTests/storage/indexeddb/prefetch-invalidation.html.
+        * storage/indexeddb/resources/prefetch-race.js: Copied from LayoutTests/storage/indexeddb/prefetch-race.html.
+        * storage/indexeddb/resources/primary-key-unique-to-objectstore.js: Copied from LayoutTests/storage/indexeddb/primary-key-unique-to-objectstore.html.
+        * storage/indexeddb/resources/request-leak.js: Copied from LayoutTests/storage/indexeddb/request-leak.html.
+        * storage/indexeddb/resources/request-result-cache.js: Copied from LayoutTests/storage/indexeddb/request-result-cache.html.
+        * storage/indexeddb/resources/structured-clone.js: Copied from LayoutTests/storage/indexeddb/structured-clone.html.
+        * storage/indexeddb/resources/transaction-complete-with-js-recursion-cross-frame.js: Copied from LayoutTests/storage/indexeddb/transaction-complete-with-js-recursion-cross-frame.html.
+        * storage/indexeddb/resources/transaction-complete-with-js-recursion.js: Copied from LayoutTests/storage/indexeddb/transaction-complete-with-js-recursion.html.
+        * storage/indexeddb/resources/transaction-crash-in-tasks.js: Copied from LayoutTests/storage/indexeddb/transaction-crash-in-tasks.html.
+        * storage/indexeddb/resources/transaction-ordering.js: Copied from LayoutTests/storage/indexeddb/transaction-ordering.html.
+        * storage/indexeddb/resources/transaction-overlapping.js: Copied from LayoutTests/storage/indexeddb/transaction-overlapping.html.
+        * storage/indexeddb/resources/version-change-event-basic.js: Copied from LayoutTests/storage/indexeddb/version-change-event-basic.html.
+        * storage/indexeddb/resources/version-change-event.js: Copied from LayoutTests/storage/indexeddb/version-change-event.html.
+        * storage/indexeddb/structured-clone.html:
+        * storage/indexeddb/transaction-complete-with-js-recursion-cross-frame.html:
+        * storage/indexeddb/transaction-complete-with-js-recursion.html:
+        * storage/indexeddb/transaction-crash-in-tasks.html:
+        * storage/indexeddb/transaction-ordering.html:
+        * storage/indexeddb/transaction-overlapping.html:
+        * storage/indexeddb/transaction-starvation.html:
+        * storage/indexeddb/version-change-event-basic.html:
+        * storage/indexeddb/version-change-event.html:
+
</ins><span class="cx"> 2016-01-19  Javier Fernandez  &lt;jfernandez@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [css-grid][css-align] justify-self stretch is not applied for img elements
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbcloneexceptionhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/clone-exception.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/clone-exception.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/clone-exception.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,50 +1,9 @@
</span><del>-&lt;!DOCTYPE html&gt;
</del><ins>+&lt;html&gt;
+&lt;head&gt;
</ins><span class="cx"> &lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
</span><del>-&lt;script&gt;
-
-description(&quot;Ensure DataCloneError is consistently thrown by IndexedDB methods&quot;);
-
-var NON_CLONEABLE = self;
-var INVALID_KEY = {};
-
-setDBNameFromPath();
-doFirstOpen();
-
-function doFirstOpen()
-{
-    preamble();
-    request = evalAndLog(&quot;indexedDB.open(dbname + '1')&quot;);
-    request.onupgradeneeded = function onUpgradeNeeded(e) {
-        preamble();
-        db = e.target.result;
-        evalAndExpectException(&quot;db.createObjectStore('store').put(NON_CLONEABLE, 0);&quot;, &quot;25&quot;, &quot;'DataCloneError'&quot;);
-        doSecondOpen();
-    };
-}
-
-function doSecondOpen()
-{
-    preamble();
-    request = evalAndLog(&quot;indexedDB.open(dbname + '2')&quot;);
-    request.onupgradeneeded = function onUpgradeNeeded(e) {
-        preamble();
-        db = e.target.result;
-        evalAndExpectException(&quot;db.createObjectStore('store').put(NON_CLONEABLE, 0);&quot;, &quot;25&quot;, &quot;'DataCloneError'&quot;);
-        doThirdOpen();
-    };
-}
-
-function doThirdOpen()
-{
-    preamble();
-    request = evalAndLog(&quot;indexedDB.open(dbname + '3')&quot;);
-    request.onupgradeneeded = function onUpgradeNeeded(e) {
-        preamble();
-        db = e.target.result;
-        evalAndExpectException(&quot;db.createObjectStore('store').put(NON_CLONEABLE, INVALID_KEY);&quot;, &quot;25&quot;, &quot;'DataCloneError'&quot;);
-        finishJSTest();
-    };
-}
-
-&lt;/script&gt;
</del><ins>+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/clone-exception.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbclosedcursorhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/closed-cursor.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/closed-cursor.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/closed-cursor.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,38 +1,9 @@
</span><del>-&lt;!DOCTYPE html&gt;
</del><ins>+&lt;html&gt;
+&lt;head&gt;
</ins><span class="cx"> &lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
</span><del>-&lt;script&gt;
-
-description(&quot;Verify that that cursors accessed after being closed are well behaved&quot;);
-
-indexedDBTest(prepareDatabase, onOpen);
-function prepareDatabase(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
-    evalAndLog(&quot;store.put({value: 'value'}, ['key'])&quot;);
-}
-
-function onOpen(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-    evalAndLog(&quot;tx = db.transaction('store')&quot;);
-    evalAndLog(&quot;store = tx.objectStore('store')&quot;);
-    evalAndLog(&quot;cursorRequest = store.openCursor()&quot;);
-    cursorRequest.onsuccess = function openCursorSuccess(evt) {
-        preamble(evt);
-        evalAndLog(&quot;cursor = cursorRequest.result&quot;);
-        debug(&quot;Don't continue the cursor, so it retains its key/primaryKey/value&quot;);
-    };
-    tx.oncomplete = function transactionComplete(evt) {
-        preamble(evt);
-        shouldBeEqualToString(&quot;JSON.stringify(cursor.key)&quot;, '[&quot;key&quot;]');
-        shouldBeEqualToString(&quot;JSON.stringify(cursor.primaryKey)&quot;, '[&quot;key&quot;]');
-        shouldBeEqualToString(&quot;JSON.stringify(cursor.value)&quot;, '{&quot;value&quot;:&quot;value&quot;}');
-        finishJSTest();
-    };
-}
-
-&lt;/script&gt;
</del><ins>+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/closed-cursor.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbconnectionleakhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/connection-leak.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/connection-leak.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/connection-leak.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,78 +1,9 @@
</span><del>-&lt;!DOCTYPE html&gt;
</del><ins>+&lt;html&gt;
+&lt;head&gt;
</ins><span class="cx"> &lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
</span><del>-&lt;script&gt;
-
-description(&quot;Regression test to ensure that IndexedDB connections don't leak&quot;);
-
-setDBNameFromPath();
-doFirstOpen();
-
-function doFirstOpen()
-{
-    preamble();
-
-    evalAndLog(&quot;request = indexedDB.open(dbname, 1)&quot;);
-    evalAndLog(&quot;sawUpgradeNeeded1 = false&quot;);
-    request.onerror = unexpectedErrorCallback;
-    request.onblocked = unexpectedBlockedCallback;
-    request.onupgradeneeded = function onUpgradeNeeded1() {
-        preamble();
-        evalAndLog(&quot;sawUpgradeNeeded1 = true&quot;);
-    };
-    request.onsuccess = function onOpenSuccess1() {
-        preamble();
-        shouldBeTrue(&quot;sawUpgradeNeeded1&quot;);
-        evalAndLog(&quot;db = request.result&quot;);
-        evalAndLog(&quot;db.close()&quot;);
-
-        doSecondOpen();
-    };
-}
-
-function doSecondOpen()
-{
-    preamble();
-
-    evalAndLog(&quot;request = indexedDB.open(dbname, 1)&quot;);
-    request.onerror = unexpectedErrorCallback;
-    request.onblocked = unexpectedBlockedCallback;
-    request.onupgradeneeded = unexpectedUpgradeNeededCallback;
-    request.onsuccess = function onOpenSuccess2() {
-        preamble();
-        evalAndLog(&quot;db = request.result&quot;);
-
-        evalAndLog(&quot;db = null&quot;);
-        evalAndLog(&quot;request = null&quot;);
-
-        debug(&quot;Run GC outside of request's callback via setTimeout()&quot;);
-        setTimeout( function() {
-            evalAndLog(&quot;window.gc()&quot;);
-            doThirdOpen();
-        }, 0);
-    };
-}
-
-function doThirdOpen()
-{
-    preamble();
-
-    evalAndLog(&quot;request = indexedDB.open(dbname, 2)&quot;);
-    evalAndLog(&quot;sawUpgradeNeeded3 = false&quot;);
-    request.onerror = unexpectedErrorCallback;
-    request.onblocked = unexpectedBlockedCallback;
-    request.onupgradeneeded = function onUpgradeNeeded2() {
-        preamble();
-        evalAndLog(&quot;sawUpgradeNeeded3 = true&quot;);
-    };
-    request.onsuccess = function onOpenSuccess3() {
-        preamble();
-        shouldBeTrue(&quot;sawUpgradeNeeded3&quot;);
-        evalAndLog(&quot;db = request.result&quot;);
-        evalAndLog(&quot;db.close()&quot;);
-
-        finishJSTest();
-    };
-}
-
-&lt;/script&gt;
</del><ins>+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/connection-leak.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbcursorcasthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/cursor-cast.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/cursor-cast.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/cursor-cast.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,44 +1,9 @@
</span><del>-&lt;!DOCTYPE html&gt;
</del><ins>+&lt;html&gt;
+&lt;head&gt;
</ins><span class="cx"> &lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
</span><del>-&lt;script&gt;
-
-description(&quot;Ensure cursor wrappers are created correctly.&quot;);
-
-indexedDBTest(prepareDatabase, verifyWrappers);
-function prepareDatabase(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
-    evalAndLog(&quot;store.put(0, 0)&quot;);
-}
-
-function verifyWrappers(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-    evalAndLog(&quot;tx = db.transaction('store', 'readwrite')&quot;);
-    evalAndLog(&quot;request = tx.objectStore('store').openCursor()&quot;);
-
-    request.onsuccess = function onOpenCursorSuccess(evt) {
-        preamble(evt);
-        evalAndLog(&quot;cursor = event.target.result&quot;);
-        evalAndLog(&quot;request = cursor.update(1)&quot;);
-
-        request.onsuccess = function onUpdateSuccess(evt) {
-            preamble(evt);
-            evalAndLog(&quot;cursor = null&quot;);
-            gc();
-            gc(); // FIXME: Shouldn't need to call twice. http://crbug.com/288072
-            setTimeout(checkCursorType, 0);
-        };
-    };
-}
-
-function checkCursorType() {
-    shouldBeEqualToString(&quot;request.source.toString()&quot;, &quot;[object IDBCursorWithValue]&quot;);
-    finishJSTest();
-}
-
-&lt;/script&gt;
</del><ins>+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/cursor-cast.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbcursorleakhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/cursor-leak.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/cursor-leak.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/cursor-leak.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,56 +1,9 @@
</span><del>-&lt;!DOCTYPE html&gt;
</del><ins>+&lt;html&gt;
+&lt;head&gt;
</ins><span class="cx"> &lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
</span><del>-&lt;script&gt;
-
-description(&quot;Verify that that cursors weakly hold script value properties&quot;);
-
-if (window.internals) {
-    indexedDBTest(prepareDatabase, onOpen);
-} else {
-    testFailed('This test requires access to the Internals object');
-    finishJSTest();
-}
-
-function prepareDatabase(evt)
-{
-    db = event.target.result;
-    store = db.createObjectStore('store');
-    store.put({value: 'value'}, ['key']);
-}
-
-function onOpen(evt)
-{
-    // evalAndLog() is not used as that generates new DOM nodes.
-
-    db = evt.target.result;
-    tx = db.transaction('store');
-    store = tx.objectStore('store');
-    cursorRequest = store.openCursor();
-    cursorRequest.onsuccess = function() {
-        cursor = cursorRequest.result;
-    };
-    tx.oncomplete = function() {
-        db.close();
-
-        // Try and induce a leak by a reference cycle from DOM to V8 and back.
-        // If the v8 value of cursor.key (etc) is only held by the cursor's
-        // V8 wrapper then there will be no leak.
-        cursor.key.cursor = cursor;
-        cursor.primaryKey.cursor = cursor;
-        cursor.value.cursor = cursor;
-
-        cursorObserver = internals.observeGC(cursor);
-
-        cursorRequest = null;
-        cursor = null;
-
-        gc();
-
-        shouldBeTrue(&quot;cursorObserver.wasCollected&quot;);
-        finishJSTest();
-    };
-}
-
-
-&lt;/script&gt;
</del><ins>+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/cursor-leak.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbcursoroverloadshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/cursor-overloads.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/cursor-overloads.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/cursor-overloads.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,78 +1,9 @@
</span><del>-&lt;!DOCTYPE html&gt;
</del><ins>+&lt;html&gt;
+&lt;head&gt;
</ins><span class="cx"> &lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
</span><del>-&lt;script&gt;
-description(&quot;Validate the overloads of IDBObjectStore.openCursor(), IDBIndex.openCursor() and IDBIndex.openKeyCursor().&quot;);
-
-indexedDBTest(prepareDatabase, verifyOverloads);
-function prepareDatabase()
-{
-    db = event.target.result;
-    event.target.transaction.onabort = unexpectedAbortCallback;
-    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
-    evalAndLog(&quot;index = store.createIndex('index', 'value')&quot;);
-    evalAndLog(&quot;store.put({value: 0}, 0)&quot;);
-}
-
-function verifyOverloads()
-{
-    debug(&quot;&quot;);
-    debug(&quot;verifyOverloads():&quot;);
-    evalAndLog(&quot;trans = db.transaction('store')&quot;);
-    evalAndLog(&quot;store = trans.objectStore('store')&quot;);
-    evalAndLog(&quot;index = store.index('index')&quot;);
-
-    checkCursorDirection(&quot;store.openCursor()&quot;, &quot;next&quot;);
-    checkCursorDirection(&quot;store.openCursor(0)&quot;, &quot;next&quot;);
-    checkCursorDirection(&quot;store.openCursor(0, 'next')&quot;, &quot;next&quot;);
-    checkCursorDirection(&quot;store.openCursor(0, 'nextunique')&quot;, &quot;nextunique&quot;);
-    checkCursorDirection(&quot;store.openCursor(0, 'prev')&quot;, &quot;prev&quot;);
-    checkCursorDirection(&quot;store.openCursor(0, 'prevunique')&quot;, &quot;prevunique&quot;);
-
-    checkCursorDirection(&quot;store.openCursor(IDBKeyRange.only(0))&quot;, &quot;next&quot;);
-    checkCursorDirection(&quot;store.openCursor(IDBKeyRange.only(0), 'next')&quot;, &quot;next&quot;);
-    checkCursorDirection(&quot;store.openCursor(IDBKeyRange.only(0), 'nextunique')&quot;, &quot;nextunique&quot;);
-    checkCursorDirection(&quot;store.openCursor(IDBKeyRange.only(0), 'prev')&quot;, &quot;prev&quot;);
-    checkCursorDirection(&quot;store.openCursor(IDBKeyRange.only(0), 'prevunique')&quot;, &quot;prevunique&quot;);
-
-    checkCursorDirection(&quot;index.openCursor()&quot;, &quot;next&quot;);
-    checkCursorDirection(&quot;index.openCursor(0)&quot;, &quot;next&quot;);
-    checkCursorDirection(&quot;index.openCursor(0, 'next')&quot;, &quot;next&quot;);
-    checkCursorDirection(&quot;index.openCursor(0, 'nextunique')&quot;, &quot;nextunique&quot;);
-    checkCursorDirection(&quot;index.openCursor(0, 'prev')&quot;, &quot;prev&quot;);
-    checkCursorDirection(&quot;index.openCursor(0, 'prevunique')&quot;, &quot;prevunique&quot;);
-
-    checkCursorDirection(&quot;index.openCursor(IDBKeyRange.only(0))&quot;, &quot;next&quot;);
-    checkCursorDirection(&quot;index.openCursor(IDBKeyRange.only(0), 'next')&quot;, &quot;next&quot;);
-    checkCursorDirection(&quot;index.openCursor(IDBKeyRange.only(0), 'nextunique')&quot;, &quot;nextunique&quot;);
-    checkCursorDirection(&quot;index.openCursor(IDBKeyRange.only(0), 'prev')&quot;, &quot;prev&quot;);
-    checkCursorDirection(&quot;index.openCursor(IDBKeyRange.only(0), 'prevunique')&quot;, &quot;prevunique&quot;);
-
-    checkCursorDirection(&quot;index.openKeyCursor()&quot;, &quot;next&quot;);
-    checkCursorDirection(&quot;index.openKeyCursor(0)&quot;, &quot;next&quot;);
-    checkCursorDirection(&quot;index.openKeyCursor(0, 'next')&quot;, &quot;next&quot;);
-    checkCursorDirection(&quot;index.openKeyCursor(0, 'nextunique')&quot;, &quot;nextunique&quot;);
-    checkCursorDirection(&quot;index.openKeyCursor(0, 'prev')&quot;, &quot;prev&quot;);
-    checkCursorDirection(&quot;index.openKeyCursor(0, 'prevunique')&quot;, &quot;prevunique&quot;);
-
-    checkCursorDirection(&quot;index.openKeyCursor(IDBKeyRange.only(0))&quot;, &quot;next&quot;);
-    checkCursorDirection(&quot;index.openKeyCursor(IDBKeyRange.only(0), 'next')&quot;, &quot;next&quot;);
-    checkCursorDirection(&quot;index.openKeyCursor(IDBKeyRange.only(0), 'nextunique')&quot;, &quot;nextunique&quot;);
-    checkCursorDirection(&quot;index.openKeyCursor(IDBKeyRange.only(0), 'prev')&quot;, &quot;prev&quot;);
-    checkCursorDirection(&quot;index.openKeyCursor(IDBKeyRange.only(0), 'prevunique')&quot;, &quot;prevunique&quot;);
-
-    trans.oncomplete = finishJSTest;
-}
-
-function checkCursorDirection(statement, direction)
-{
-    request = eval(statement);
-    request.onerror = unexpectedErrorCallback;
-    request.onsuccess = function() {
-        debug(statement);
-        shouldBeNonNull(&quot;event.target.result&quot;)
-        shouldBeEqualToString(&quot;event.target.result.direction&quot;, direction);
-    };
-}
-
-&lt;/script&gt;
</del><ins>+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/cursor-overloads.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbcursorrequestcyclehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/cursor-request-cycle.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/cursor-request-cycle.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/cursor-request-cycle.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,88 +1,9 @@
</span><del>-&lt;!DOCTYPE html&gt;
</del><ins>+&lt;html&gt;
+&lt;head&gt;
</ins><span class="cx"> &lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
</span><del>-&lt;script&gt;
-
-description(&quot;Verify that that cursors weakly hold request, and work if request is GC'd&quot;);
-
-indexedDBTest(prepareDatabase, onOpen);
-
-function prepareDatabase(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
-    store.put(&quot;value1&quot;, &quot;key1&quot;);
-    store.put(&quot;value2&quot;, &quot;key2&quot;);
-}
-
-function onOpen(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-    evalAndLog(&quot;tx = db.transaction('store')&quot;);
-    evalAndLog(&quot;store = tx.objectStore('store')&quot;);
-
-    evalAndLog(&quot;cursorRequest = store.openCursor()&quot;);
-    cursorRequest.onsuccess = function openCursorRequestSuccess(evt) {
-        preamble(evt);
-        debug(&quot;Result will be checked later, to ensure that lazy access is safe&quot;);
-    };
-
-    evalAndLog(&quot;otherRequest = store.get(0)&quot;);
-    otherRequest.onsuccess = function otherRequestSuccess(evt) {
-        preamble(evt);
-
-        debug(&quot;Verify that the request's result can be accessed lazily:&quot;);
-        evalAndLog(&quot;gc()&quot;);
-
-        evalAndLog(&quot;cursor = cursorRequest.result&quot;);
-        shouldBeNonNull(&quot;cursor&quot;);
-        shouldBeEqualToString(&quot;cursor.key&quot;, &quot;key1&quot;);
-        shouldBeEqualToString(&quot;cursor.value&quot;, &quot;value1&quot;);
-        evalAndLog(&quot;cursorRequest.extra = 123&quot;);
-        evalAndLog(&quot;cursor.extra = 456&quot;);
-
-        // Assign a new handler to inspect the request and cursor indirectly.
-        cursorRequest.onsuccess = function cursorContinueSuccess(evt) {
-            preamble(evt);
-            evalAndLog(&quot;cursor = event.target.result&quot;);
-            shouldBeNonNull(&quot;cursor&quot;);
-            shouldBeEqualToString(&quot;cursor.key&quot;, &quot;key2&quot;);
-            shouldBeEqualToString(&quot;cursor.value&quot;, &quot;value2&quot;);
-            shouldBe(&quot;event.target.extra&quot;, &quot;123&quot;);
-            shouldBe(&quot;cursor.extra&quot;, &quot;456&quot;);
-        };
-
-        debug(&quot;Ensure request is not released if cursor is still around.&quot;);
-        cursorRequestObservation = internals.observeGC(cursorRequest);
-        evalAndLog(&quot;cursorRequest = null&quot;);
-        evalAndLog(&quot;gc()&quot;);
-        shouldBeFalse(&quot;cursorRequestObservation.wasCollected&quot;);
-
-        evalAndLog(&quot;cursor.continue()&quot;);
-
-        cursorObservation = internals.observeGC(cursor);
-        evalAndLog(&quot;cursor = null&quot;);
-        evalAndLog(&quot;gc()&quot;);
-        shouldBeFalse(&quot;cursorObservation.wasCollected&quot;);
-
-        evalAndLog(&quot;finalRequest = store.get(0)&quot;);
-        finalRequest.onsuccess = function finalRequestSuccess(evt) {
-            preamble(evt);
-            shouldBeEqualToString(&quot;cursor.key&quot;, &quot;key2&quot;);
-            shouldBeEqualToString(&quot;cursor.value&quot;, &quot;value2&quot;);
-
-            cursorObservation = internals.observeGC(cursor);
-            evalAndLog(&quot;cursor = null&quot;);
-            evalAndLog(&quot;gc()&quot;);
-            shouldBeTrue(&quot;cursorRequestObservation.wasCollected&quot;);
-            shouldBeTrue(&quot;cursorObservation.wasCollected&quot;);
-        };
-    };
-
-    tx.oncomplete = finishJSTest;
-}
-
-
-&lt;/script&gt;
</del><ins>+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/cursor-request-cycle.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbdeleteIndexbug110792html"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/deleteIndex-bug110792.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/deleteIndex-bug110792.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/deleteIndex-bug110792.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,41 +1,9 @@
</span><del>-&lt;!DOCTYPE html&gt;
</del><ins>+&lt;html&gt;
+&lt;head&gt;
</ins><span class="cx"> &lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
</span><del>-&lt;script&gt;
-
-description(&quot;Ensure IndexedDB's IDBObjectStore.deleteIndex() works if IDBIndex object has not been fetched - regression test for bug 110792.&quot;);
-
-indexedDBTest(onFirstUpgradeNeeded, closeAndReOpen, {version: 1});
-
-function onFirstUpgradeNeeded(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
-    evalAndLog(&quot;store.createIndex('index', 'keyPath')&quot;);
-}
-
-function closeAndReOpen()
-{
-    preamble();
-    evalAndLog(&quot;db.close()&quot;);
-    debug(&quot;&quot;);
-    request = evalAndLog(&quot;indexedDB.open(dbname, 2)&quot;);
-    request.onblocked = unexpectedBlockedCallback;
-    request.onerror = unexpectedErrorCallback;
-    request.onupgradeneeded = onSecondUpgradeNeeded;
-    request.onsuccess = finishJSTest;
-}
-
-function onSecondUpgradeNeeded(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-    evalAndLog(&quot;store = event.target.transaction.objectStore('store')&quot;);
-    // Do NOT add a call to store.index('index') here (e.g. to assert it exists)
-    // or the bug disappears.
-    evalAndLog(&quot;store.deleteIndex('index')&quot;);
-    evalAndExpectException(&quot;store.index('index')&quot;, &quot;DOMException.NOT_FOUND_ERR&quot;, &quot;'NotFoundError'&quot;);
-}
-
-&lt;/script&gt;
</del><ins>+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/deleteIndex-bug110792.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbdeletedatabasetransactionhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/deletedatabase-transaction.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/deletedatabase-transaction.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/deletedatabase-transaction.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,33 +1,9 @@
</span><del>-&lt;!DOCTYPE html&gt;
</del><ins>+&lt;html&gt;
+&lt;head&gt;
</ins><span class="cx"> &lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
</span><del>-&lt;script&gt;
-description(&quot;Ensure deleteDatabase() can run concurrently with transactions in other databases&quot;);
-
-indexedDBTest(prepareDatabase, startTransaction);
-function prepareDatabase()
-{
-    db = event.target.result;
-    evalAndLog(&quot;db.createObjectStore('store')&quot;);
-}
-
-function startTransaction() {
-    debug(&quot;&quot;);
-    debug(&quot;Start a transaction against the first database:&quot;);
-    evalAndLog(&quot;trans = db.transaction('store', 'readonly')&quot;);
-    evalAndLog(&quot;trans.objectStore('store').get(0)&quot;);
-
-    debug(&quot;&quot;);
-    debug(&quot;Delete a different database:&quot;);
-    evalAndLog(&quot;dbname2 = dbname + '2'&quot;);
-    request = evalAndLog(&quot;indexedDB.deleteDatabase(dbname2)&quot;);
-    request.onblocked = unexpectedBlockedCallback;
-    request.onerror = unexpectedErrorCallback;
-    request.onsuccess = function() {
-        testPassed(&quot;success event was fired at delete request&quot;);
-    };
-
-    trans.oncomplete = finishJSTest;
-}
-
-&lt;/script&gt;
</del><ins>+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/deletedatabase-transaction.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmetadataracehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/metadata-race.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/metadata-race.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/metadata-race.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,39 +1,9 @@
</span><del>-&lt;!DOCTYPE html&gt;
</del><ins>+&lt;html&gt;
+&lt;head&gt;
</ins><span class="cx"> &lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
</span><del>-&lt;script&gt;
-
-description(&quot;Ensure IndexedDB transactions created before open onsuccess have correct metadata&quot;);
-
-indexedDBTest(prepareDatabase, onOpenSuccess);
-function prepareDatabase(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
-    evalAndLog(&quot;store.createIndex('index', 'keyPath')&quot;);
-    evalAndLog(&quot;transaction = event.target.transaction&quot;);
-    shouldNotThrow(&quot;index = transaction.objectStore('store').index('index')&quot;);
-    transaction.oncomplete = onTransactionComplete;
-}
-
-function onTransactionComplete(evt)
-{
-    preamble(evt);
-    debug(&quot;In multiprocess mode, 'complete' event may be dispatched before\n&quot; +
-          &quot;the 'success' arrives with updated metadata. Ensure the new metadata\n&quot; +
-          &quot;is still used for transactions.&quot;);
-    evalAndLog(&quot;store = db.transaction('store').objectStore('store')&quot;);
-    shouldNotThrow(&quot;index = store.index('index')&quot;);
-}
-
-function onOpenSuccess(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-    evalAndLog(&quot;store = db.transaction('store').objectStore('store')&quot;);
-    shouldNotThrow(&quot;index = store.index('index')&quot;);
-    finishJSTest();
-}
-
-&lt;/script&gt;
</del><ins>+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/metadata-race.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbnoblobshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/noblobs.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/noblobs.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/noblobs.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -5,82 +5,6 @@
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><span class="cx"> &lt;input type=&quot;file&quot; id=&quot;fileInput&quot; multiple&gt;&lt;/input&gt;
</span><del>-&lt;script&gt;
-
-description(&quot;Confirm Blob/File/FileList limitations of WebKit's IndexedDB implementation.&quot;);
-// FIXME: This verifies that blob-type data is rejected for now, rather than silently failing.
-// Tracked for the Chromium port as: http://crbug.com/108012
-
-fileInput = document.getElementById(&quot;fileInput&quot;);
-if (window.eventSender) {
-    var fileRect = fileInput.getClientRects()[0];
-    var targetX = fileRect.left + fileRect.width / 2;
-    var targetY = fileRect.top + fileRect.height / 2;
-    eventSender.beginDragWithFiles(['resources/test-data.html', 'resources/test-data.txt']);
-    eventSender.mouseMoveTo(targetX, targetY);
-    eventSender.mouseUp();
-}
-
-function prepareDatabase()
-{
-    db = event.target.result;
-    var trans = event.target.transaction;
-    evalAndLog(&quot;store = db.createObjectStore('storeName')&quot;);
-    evalAndLog(&quot;store.put('value', 'key')&quot;);
-    trans.onerror = unexpectedErrorCallback;
-    trans.onabort = unexpectedAbortCallback;
-}
-
-function testBlob()
-{
-    debug(&quot;&quot;);
-    debug(&quot;testBlob():&quot;);
-
-    shouldBeTrue(&quot;FileReader != null&quot;);
-    evalAndLog(&quot;test_content = 'This is a test. This is only a test.'&quot;);
-    evalAndLog(&quot;blob = new Blob([test_content])&quot;);
-    validateExceptions(&quot;blob&quot;, testFile);
-}
-
-function testFile()
-{
-    debug(&quot;&quot;);
-    debug(&quot;testFile():&quot;);
-    evalAndLog(&quot;file = fileInput.files[0]&quot;);
-    validateExceptions(&quot;file&quot;, testFileList);
-}
-
-function testFileList()
-{
-    debug(&quot;&quot;);
-    debug(&quot;testFileList():&quot;);
-    evalAndLog(&quot;filelist = fileInput.files&quot;);
-    validateExceptions(&quot;filelist&quot;, finishJSTest);
-}
-
-function validateExceptions(variable, onComplete)
-{
-    debug(&quot;&quot;);
-    debug(&quot;validateExceptions(&quot; + variable + &quot;):&quot;);
-    evalAndLog(&quot;transaction = db.transaction('storeName', 'readwrite')&quot;);
-    evalAndLog(&quot;store = transaction.objectStore('storeName')&quot;);
-    evalAndExpectException(&quot;store.put(&quot; + variable + &quot;, 'key')&quot;, &quot;DOMException.DATA_CLONE_ERR&quot;);
-    evalAndExpectException(&quot;store.add(&quot; + variable + &quot;, 'key')&quot;, &quot;DOMException.DATA_CLONE_ERR&quot;);
-    evalAndLog(&quot;request = store.openCursor()&quot;);
-    request.onsuccess = function () {
-        evalAndLog(&quot;cursor = request.result&quot;);
-        evalAndExpectException(&quot;cursor.update(&quot; + variable + &quot;)&quot;, &quot;DOMException.DATA_CLONE_ERR&quot;);
-    };
-    transaction.oncomplete = onComplete;
-}
-
-if (window.eventSender) {
-    indexedDBTest(prepareDatabase, testBlob);
-} else {
-    alert(&quot;Select file(s) using the input control above to initiate the test&quot;);
-    document.getElementById(&quot;fileInput&quot;).onchange = function() { indexedDBTest(prepareDatabase, testBlob); };
-}
-
-&lt;/script&gt;
</del><ins>+&lt;script src=&quot;resources/noblobs.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbobjectlookupsinversionchangehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/object-lookups-in-versionchange.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/object-lookups-in-versionchange.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/object-lookups-in-versionchange.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,20 +1,9 @@
</span><del>-&lt;!DOCTYPE html&gt;
</del><ins>+&lt;html&gt;
+&lt;head&gt;
</ins><span class="cx"> &lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
</span><del>-&lt;script&gt;
-
-description(&quot;Regression test for http://webkit.org/b/102547&quot;);
-
-indexedDBTest(prepareDatabase, finishJSTest);
-
-function prepareDatabase() {
-    evalAndLog(&quot;db = event.target.result&quot;);
-    evalAndLog(&quot;transaction = event.target.transaction&quot;);
-    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
-    debug(&quot;&quot;);
-    evalAndExpectException(&quot;transaction.objectStore('no-such-store')&quot;, &quot;DOMException.NOT_FOUND_ERR&quot;, &quot;'NotFoundError'&quot;);
-    debug(&quot;&quot;);
-    evalAndExpectException(&quot;store.index('no-such-index')&quot;, &quot;DOMException.NOT_FOUND_ERR&quot;, &quot;'NotFoundError'&quot;);
-}
-
-&lt;/script&gt;
</del><ins>+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/object-lookups-in-versionchange.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbopenbadversionshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/open-bad-versions.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/open-bad-versions.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/open-bad-versions.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -4,30 +4,6 @@
</span><span class="cx"> &lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><del>-&lt;script&gt;
-
-description(&quot;No crashes when opening and reloading with bad version numbers&quot;);
-
-function test()
-{
-  removeVendorPrefixes();
-  evalAndLog(&quot;dbname = String(window.location)&quot;);
-
-  try { indexedDB.open(dbname, -1); } catch (e) { }
-  indexedDB.open(dbname, 2);
-  try { indexedDB.open(dbname, -1); } catch (e) { }
-
-  setTimeout(function() {
-    if (!window.location.search) {
-      window.location = window.location + &quot;?2&quot;;
-    } else {
-      finishJSTest();
-    }
-  }, 500);
-}
-
-test();
-
-&lt;/script&gt;
</del><ins>+&lt;script src=&quot;resources/open-bad-versions.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddboptionalargumentshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/optional-arguments.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/optional-arguments.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/optional-arguments.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,131 +1,9 @@
</span><del>-&lt;!DOCTYPE html&gt;
</del><ins>+&lt;html&gt;
+&lt;head&gt;
</ins><span class="cx"> &lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
</span><del>-&lt;script&gt;
-
-description(&quot;Exercise optional arguments with missing vs. undefined in IndexedDB methods.&quot;);
-
-indexedDBTest(prepareDatabase, checkOptionalArguments);
-function prepareDatabase(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-    evalAndLog(&quot;store = db.createObjectStore('store', {keyPath: 'id'})&quot;);
-    evalAndLog(&quot;store.createIndex('by_name', 'name', {unique: true})&quot;);
-
-    evalAndLog(&quot;store.put({id: 1, name: 'a'})&quot;);
-}
-
-function checkOptionalArguments(event)
-{
-    evalAndLog(&quot;tx = db.transaction('store', 'readwrite')&quot;);
-    tx.oncomplete = finishJSTest;
-
-    evalAndLog(&quot;store = tx.objectStore('store')&quot;);
-    evalAndLog(&quot;index = store.index('by_name')&quot;);
-
-    shouldBe(&quot;IDBKeyRange.lowerBound(0).lowerOpen&quot;, &quot;false&quot;);
-    shouldBe(&quot;IDBKeyRange.upperBound(0).upperOpen&quot;, &quot;false&quot;);
-    shouldBe(&quot;IDBKeyRange.bound(0, 1).lowerOpen&quot;, &quot;false&quot;);
-    shouldBe(&quot;IDBKeyRange.bound(0, 1).upperOpen&quot;, &quot;false&quot;);
-
-    shouldBe(&quot;IDBKeyRange.lowerBound(0, undefined).lowerOpen&quot;, &quot;false&quot;);
-    shouldBe(&quot;IDBKeyRange.upperBound(0, undefined).upperOpen&quot;, &quot;false&quot;);
-    shouldBe(&quot;IDBKeyRange.bound(0, 1, undefined, undefined).lowerOpen&quot;, &quot;false&quot;);
-    shouldBe(&quot;IDBKeyRange.bound(0, 1, undefined, undefined).upperOpen&quot;, &quot;false&quot;);
-
-    shouldNotThrow(&quot;store.add({id: 2, name: 'b'})&quot;);
-    shouldNotThrow(&quot;store.put({id: 3, name: 'c'})&quot;);
-    shouldNotThrow(&quot;store.add({id: 4, name: 'd'}, undefined)&quot;);
-    shouldNotThrow(&quot;store.put({id: 5, name: 'e'}, undefined)&quot;);
-
-    tasks = [
-        function(callback) { verifyCursor(&quot;store.openCursor()&quot;, &quot;next&quot;, 5, callback); },
-        function(callback) { verifyCursor(&quot;store.openCursor(null)&quot;, &quot;next&quot;, 5, callback); },
-        function(callback) { verifyCursor(&quot;store.openCursor(IDBKeyRange.lowerBound(4))&quot;, &quot;next&quot;, 2, callback); },
-        function(callback) { verifyCursor(&quot;store.openCursor(3)&quot;, &quot;next&quot;, 1, callback); },
-
-        function(callback) { verifyCursor(&quot;index.openCursor()&quot;, &quot;next&quot;, 5, callback); },
-        function(callback) { verifyCursor(&quot;index.openCursor(null)&quot;, &quot;next&quot;, 5, callback); },
-        function(callback) { verifyCursor(&quot;index.openCursor(IDBKeyRange.lowerBound('b'))&quot;, &quot;next&quot;, 4, callback); },
-        function(callback) { verifyCursor(&quot;index.openCursor('c')&quot;, &quot;next&quot;, 1, callback); },
-
-        function(callback) { verifyCursor(&quot;index.openKeyCursor()&quot;, &quot;next&quot;, 5, callback); },
-        function(callback) { verifyCursor(&quot;index.openKeyCursor(null)&quot;, &quot;next&quot;, 5, callback); },
-        function(callback) { verifyCursor(&quot;index.openKeyCursor(IDBKeyRange.lowerBound('b'))&quot;, &quot;next&quot;, 4, callback); },
-        function(callback) { verifyCursor(&quot;index.openKeyCursor('c')&quot;, &quot;next&quot;, 1, callback); },
-
-        function(callback) { verifyCount(&quot;store.count()&quot;, 5, callback); },
-        function(callback) { verifyCount(&quot;store.count(null)&quot;, 5, callback); },
-        function(callback) { verifyCount(&quot;store.count(IDBKeyRange.lowerBound(2))&quot;, 4, callback); },
-
-        function(callback) { verifyCount(&quot;index.count()&quot;, 5, callback); },
-        function(callback) { verifyCount(&quot;index.count(null)&quot;, 5, callback); },
-        function(callback) { verifyCount(&quot;index.count(IDBKeyRange.lowerBound('b'))&quot;, 4, callback); },
-
-        continueUndefined,
-
-    ];
-    function doNextTask() {
-        var task = tasks.shift();
-        if (task) {
-            task(doNextTask);
-        }
-    }
-    doNextTask();
-}
-
-function verifyCursor(expr, direction, expected, callback)
-{
-    preamble();
-    cursor = null;
-    continues = 0;
-    evalAndLog(&quot;request = &quot; + expr);
-    request.onerror = unexpectedErrorCallback;
-
-    request.onsuccess = function() {
-        if (request.result) {
-            if (!cursor) {
-                evalAndLog(&quot;cursor = request.result&quot;);
-                shouldBeEqualToString(&quot;cursor.direction&quot;, direction);
-            }
-            ++continues;
-            cursor.continue();
-        } else {
-            shouldBe(&quot;continues&quot;, JSON.stringify(expected));
-            callback();
-        }
-    };
-}
-
-function verifyCount(expr, expected, callback)
-{
-    preamble();
-    evalAndLog(&quot;request = &quot; + expr);
-    request.onerror = unexpectedErrorCallback;
-
-    request.onsuccess = function() {
-        shouldBe(&quot;request.result&quot;, JSON.stringify(expected));
-        callback();
-    };
-}
-
-function continueUndefined(callback)
-{
-    preamble();
-    first = true;
-    evalAndLog(&quot;request = store.openCursor()&quot;);
-    request.onerror = unexpectedErrorCallback;
-
-    request.onsuccess = function() {
-        if (first) {
-            first = false;
-            evalAndLog(&quot;cursor = request.result&quot;);
-            shouldBeNonNull(&quot;request.result&quot;);
-            shouldNotThrow(&quot;cursor.continue(undefined)&quot;);
-            callback();
-        }
-    };
-}
-
-&lt;/script&gt;
</del><ins>+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/optional-arguments.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbprefetchinvalidationhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/prefetch-invalidation.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/prefetch-invalidation.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/prefetch-invalidation.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,90 +1,9 @@
</span><del>-&lt;!DOCTYPE html&gt;
</del><ins>+&lt;html&gt;
+&lt;head&gt;
</ins><span class="cx"> &lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
</span><del>-&lt;script&gt;
-
-description(&quot;Ensure IndexedDB's write operations invalidate cursor prefetch caches&quot;);
-
-indexedDBTest(prepareDatabase, onOpenSuccess);
-function prepareDatabase(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
-}
-
-function onOpenSuccess(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-
-    var steps = [
-        deleteRange,
-        clearStore
-    ];
-
-    (function nextStep() {
-        var step = steps.shift();
-        if (step) {
-            doPrefetchInvalidationTest(step, nextStep);
-        } else {
-            finishJSTest();
-            return;
-        }
-    }());
-}
-
-function doPrefetchInvalidationTest(operation, callback)
-{
-    debug(&quot;&quot;);
-    debug(&quot;-------------------------------------------&quot;);
-    preamble();
-    evalAndLog(&quot;store = db.transaction('store', 'readwrite').objectStore('store')&quot;);
-    debug(&quot;Populate the store with 200 records.&quot;);
-    for (var i = 0; i &lt; 200; ++i)
-        store.put(i, i);
-    evalAndLog(&quot;cursorRequest = store.openCursor()&quot;);
-    continue100Times(operation, callback);
-}
-
-function continue100Times(operation, callback)
-{
-    preamble();
-    var count = 0;
-
-    cursorRequest.onsuccess = function() {
-        var cursor = cursorRequest.result;
-        ++count;
-        if (count &lt; 100) {
-            cursor.continue();
-            return;
-        }
-        shouldBeNonNull(&quot;cursorRequest.result&quot;);
-        doOperationAndContinue(operation, callback);
-    }
-}
-
-function doOperationAndContinue(operation, callback)
-{
-    preamble();
-    operation();
-    evalAndLog(&quot;cursor = cursorRequest.result&quot;);
-    evalAndLog(&quot;cursor.continue()&quot;)
-    cursorRequest.onsuccess = function onContinueSuccess() {
-        preamble();
-        shouldBeNull(&quot;cursorRequest.result&quot;);
-        callback();
-    };
-}
-
-function deleteRange()
-{
-    return evalAndLog(&quot;store.delete(IDBKeyRange.bound(-Infinity, +Infinity))&quot;);
-}
-
-function clearStore()
-{
-    return evalAndLog(&quot;store.clear()&quot;);
-}
-
-&lt;/script&gt;
</del><ins>+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/prefetch-invalidation.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbprefetchracehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/prefetch-race.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/prefetch-race.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/prefetch-race.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,55 +1,9 @@
</span><del>-&lt;!DOCTYPE html&gt;
</del><ins>+&lt;html&gt;
+&lt;head&gt;
</ins><span class="cx"> &lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
</span><del>-&lt;script&gt;
-
-description(&quot;Ensure IndexedDB's cursor prefetch cache requests are invalidated&quot;);
-
-indexedDBTest(prepareDatabase, onOpenSuccess);
-function prepareDatabase(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
-    debug(&quot;Populate with even records...&quot;);
-    for (var i = 0; i &lt; 10; i += 2)
-        store.put(i, i);
-}
-
-function onOpenSuccess(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-
-    evalAndLog(&quot;tx = db.transaction('store', 'readwrite')&quot;);
-    evalAndLog(&quot;store = tx.objectStore('store')&quot;);
-    evalAndLog(&quot;request = store.openCursor()&quot;);
-
-    kPrefetchThreshold = 3;
-
-    expected = [&quot;0&quot;, &quot;2&quot;, &quot;4&quot;, &quot;6&quot;, &quot;7&quot;, &quot;8&quot;, &quot;9&quot;];
-    continueCount = 0;
-    request.onsuccess = function cursorSuccess() {
-        preamble();
-        cursor = request.result;
-        if (!cursor)
-            return;
-        ++continueCount;
-
-        expect = expected.shift();
-        shouldBe(&quot;cursor.key&quot;, expect);
-        evalAndLog(&quot;cursor.continue()&quot;);
-
-        if (continueCount === kPrefetchThreshold) {
-            debug(&quot;\nThat should have triggered a prefetch, injecting odd records...&quot;);
-            for (var i = 1; i &lt; 10; i += 2)
-                store.put(i, i);
-        }
-    };
-
-    tx.oncomplete = function() {
-        shouldBe(&quot;continueCount&quot;, &quot;7&quot;);
-        finishJSTest();
-    };
-}
-&lt;/script&gt;
</del><ins>+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/prefetch-race.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbprimarykeyuniquetoobjectstorehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/primary-key-unique-to-objectstore.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/primary-key-unique-to-objectstore.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/primary-key-unique-to-objectstore.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,147 +1,10 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
</ins><span class="cx"> &lt;body&gt;
</span><span class="cx"> &lt;div id=&quot;logger&quot;&gt;&lt;/div&gt;
</span><del>-&lt;script&gt;
-if (testRunner) {
-    testRunner.dumpAsText();
-    testRunner.waitUntilDone();
-}
-
-function log(msg) {
-    document.getElementById(&quot;logger&quot;).innerHTML += msg + &quot;&lt;br&gt;&quot;;
-}
-
-var openRequest = indexedDB.open(&quot;pkutos&quot;, 1);
-
-openRequest.onupgradeneeded = function(e) {
-    var thisDB = e.target.result;
-
-    if(!thisDB.objectStoreNames.contains(&quot;people&quot;)) {
-        thisDB.createObjectStore(&quot;people&quot;, {keyPath:&quot;id&quot;});
-    }
-
-    if(!thisDB.objectStoreNames.contains(&quot;notes&quot;)) {
-        thisDB.createObjectStore(&quot;notes&quot;, {keyPath:&quot;uid&quot;});
-    }
-}
-
-openRequest.onsuccess = function(e) {
-    db = e.target.result;
-    addPerson();
-}    
-
-openRequest.onerror = function(e) {
-    log(&quot;openRequest error - &quot; + e);
-}
-
-var sharedID = 0;
-
-function addPerson() {
-    log(&quot;About to add person and note&quot;);
-
-    //Get a transaction
-    //default for OS list is all, default for type is read
-    var transaction = db.transaction([&quot;people&quot;], &quot;readwrite&quot;);
-
-    //Ask for the objectStore
-    var store = transaction.objectStore(&quot;people&quot;);
-
-    //Define a person
-    var person = {
-        name: &quot;Person&quot;,
-        id: sharedID
-    }
-
-    //Perform the add
-    var request = store.add(person);
-
-    request.onerror = function(e) {
-        log(&quot;Error adding person - &quot;, e);
-    }
-
-    request.onsuccess = function(e) {
-        log(&quot;Successfully added person&quot;);
-        setTimeout(&quot;addComplete();&quot;, 0);
-    }
-    
-    //Define a note
-    var note = {
-        note: &quot;Note&quot;,
-        uid: sharedID
-    }
-
-    var transaction2 = db.transaction([&quot;notes&quot;], &quot;readwrite&quot;);
-
-    //Ask for the objectStore
-    var store2 = transaction2.objectStore(&quot;notes&quot;);
-
-    //Perform the add
-    var request2 = store2.add(note);
-
-    request2.onerror = function(e) {
-        log(&quot;Error adding note - &quot;, e);
-    }
-
-    request2.onsuccess = function(e) {
-        log(&quot;Successfully added note&quot;);
-        setTimeout(&quot;addComplete();&quot;, 0);
-    }
-    
-}
-
-var completedAdds = 0;
-function addComplete()
-{
-    if (++completedAdds &lt; 2)
-        return;
-
-    //Get a transaction
-    var transaction = db.transaction([&quot;people&quot;], &quot;readwrite&quot;);
-
-    //Ask for the objectStore
-    var store = transaction.objectStore(&quot;people&quot;);
-
-    //Perform the add
-    var request = store.get(sharedID);
-
-    request.onerror = function(e) {
-        log(&quot;Error getting person - &quot;, e);
-    }
-
-    request.onsuccess = function(e) {
-        log(&quot;Successfully got person&quot;);
-        for (n in e.target.result) {
-            log(n);
-        }
-        getComplete();
-    }
-
-    var transaction2 = db.transaction([&quot;notes&quot;], &quot;readwrite&quot;);
-
-    //Ask for the objectStore
-    var store2 = transaction2.objectStore(&quot;notes&quot;);
-
-    //Perform the add
-    var request2 = store2.get(sharedID);
-
-    request2.onerror = function(e) {
-        log(&quot;Error getting note - &quot;, e);
-    }
-
-    request2.onsuccess = function(e) {
-        log(&quot;Successfully got note&quot;);
-        for (n in e.target.result) {
-            log(n);
-        }
-        getComplete();
-    }
-}
-
-var completedGets = 0;
-function getComplete()
-{
-    if (++completedGets == 2 &amp;&amp; testRunner)
-        testRunner.notifyDone();
-}
-&lt;/script&gt;
</del><ins>+&lt;script src=&quot;resources/primary-key-unique-to-objectstore.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/body&gt;
</span><del>-&lt;/html&gt;
</del><span class="cx">\ No newline at end of file
</span><ins>+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbrequestleakhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/request-leak.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/request-leak.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/request-leak.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,52 +1,9 @@
</span><del>-&lt;!DOCTYPE html&gt;
</del><ins>+&lt;html&gt;
+&lt;head&gt;
</ins><span class="cx"> &lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
</span><del>-&lt;script&gt;
-
-description(&quot;Verify that that requests weakly hold script value properties&quot;);
-
-if (window.internals) {
-    indexedDBTest(prepareDatabase, onOpen);
-} else {
-    testFailed('This test requires access to the Internals object');
-    finishJSTest();
-}
-
-function prepareDatabase(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
-    evalAndLog(&quot;store.put({value: 'value'}, 'key')&quot;);
-}
-
-function onOpen(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-    evalAndLog(&quot;tx = db.transaction('store')&quot;);
-    evalAndLog(&quot;store = tx.objectStore('store')&quot;);
-    evalAndLog(&quot;request = store.get('key')&quot;);
-    tx.oncomplete = function onTransactionComplete() {
-        preamble();
-        evalAndLog(&quot;db.close()&quot;);
-        shouldBeEqualToString(&quot;typeof request.result&quot;, &quot;object&quot;);
-
-        // Verify that the same object is returned on each access to request.result.
-        evalAndLog(&quot;request.result.x = 123&quot;);
-        shouldBe(&quot;request.result.x&quot;, &quot;123&quot;);
-
-        // Try and induce a leak by a reference cycle from DOM to V8 and back.
-        // If the v8 value of request.result (etc) is only held by the requests's
-        // V8 wrapper then there will be no leak.
-        evalAndLog(&quot;request.result.leak = request&quot;);
-        evalAndLog(&quot;observer = internals.observeGC(request)&quot;);
-        evalAndLog(&quot;request = null&quot;);
-        evalAndLog(&quot;gc()&quot;);
-        shouldBeTrue(&quot;observer.wasCollected&quot;);
-        finishJSTest();
-    };
-}
-
-
-&lt;/script&gt;
</del><ins>+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/request-leak.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbrequestresultcachehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/request-result-cache.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/request-result-cache.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/request-result-cache.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,37 +1,9 @@
</span><del>-&lt;!DOCTYPE html&gt;
</del><ins>+&lt;html&gt;
+&lt;head&gt;
</ins><span class="cx"> &lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
</span><del>-&lt;script&gt;
-
-description(&quot;Verify that a request's result is dirtied when a cursor is continued&quot;);
-
-indexedDBTest(prepareDatabase, onOpen);
-
-function prepareDatabase(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
-    store.put(&quot;value&quot;, &quot;key&quot;);
-}
-
-function onOpen(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-    evalAndLog(&quot;tx = db.transaction('store')&quot;);
-    evalAndLog(&quot;store = tx.objectStore('store')&quot;);
-
-    evalAndLog(&quot;cursorRequest = store.openCursor()&quot;);
-    cursorRequest.onsuccess = function cursorRequestSuccess(evt) {
-        preamble(evt);
-        if (!cursorRequest.result)
-            return;
-
-        evalAndLog(&quot;cursor = cursorRequest.result&quot;);
-        evalAndLog(&quot;cursor.continue()&quot;);
-        evalAndExpectException(&quot;cursorRequest.result&quot;, &quot;DOMException.INVALID_STATE_ERR&quot;, &quot;'InvalidStateError'&quot;);    };
-
-    tx.oncomplete = finishJSTest;
-}
-&lt;/script&gt;
</del><ins>+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/request-result-cache.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcescloneexceptionjsfromrev195298trunkLayoutTestsstorageindexeddbcloneexceptionhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/clone-exception.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/clone-exception.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/clone-exception.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/clone-exception.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;Ensure DataCloneError is consistently thrown by IndexedDB methods&quot;);
+
+var NON_CLONEABLE = self;
+var INVALID_KEY = {};
+
+setDBNameFromPath();
+doFirstOpen();
+
+function doFirstOpen()
+{
+    preamble();
+    request = evalAndLog(&quot;indexedDB.open(dbname + '1')&quot;);
+    request.onupgradeneeded = function onUpgradeNeeded(e) {
+        preamble();
+        db = e.target.result;
+        evalAndExpectException(&quot;db.createObjectStore('store').put(NON_CLONEABLE, 0);&quot;, &quot;25&quot;, &quot;'DataCloneError'&quot;);
+        doSecondOpen();
+    };
+}
+
+function doSecondOpen()
+{
+    preamble();
+    request = evalAndLog(&quot;indexedDB.open(dbname + '2')&quot;);
+    request.onupgradeneeded = function onUpgradeNeeded(e) {
+        preamble();
+        db = e.target.result;
+        evalAndExpectException(&quot;db.createObjectStore('store').put(NON_CLONEABLE, 0);&quot;, &quot;25&quot;, &quot;'DataCloneError'&quot;);
+        doThirdOpen();
+    };
+}
+
+function doThirdOpen()
+{
+    preamble();
+    request = evalAndLog(&quot;indexedDB.open(dbname + '3')&quot;);
+    request.onupgradeneeded = function onUpgradeNeeded(e) {
+        preamble();
+        db = e.target.result;
+        evalAndExpectException(&quot;db.createObjectStore('store').put(NON_CLONEABLE, INVALID_KEY);&quot;, &quot;25&quot;, &quot;'DataCloneError'&quot;);
+        finishJSTest();
+    };
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcesclosedcursorjsfromrev195298trunkLayoutTestsstorageindexeddbclosedcursorhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/closed-cursor.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/closed-cursor.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/closed-cursor.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/closed-cursor.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;Verify that that cursors accessed after being closed are well behaved&quot;);
+
+indexedDBTest(prepareDatabase, onOpen);
+function prepareDatabase(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
+    evalAndLog(&quot;store.put({value: 'value'}, ['key'])&quot;);
+}
+
+function onOpen(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+    evalAndLog(&quot;tx = db.transaction('store')&quot;);
+    evalAndLog(&quot;store = tx.objectStore('store')&quot;);
+    evalAndLog(&quot;cursorRequest = store.openCursor()&quot;);
+    cursorRequest.onsuccess = function openCursorSuccess(evt) {
+        preamble(evt);
+        evalAndLog(&quot;cursor = cursorRequest.result&quot;);
+        debug(&quot;Don't continue the cursor, so it retains its key/primaryKey/value&quot;);
+    };
+    tx.oncomplete = function transactionComplete(evt) {
+        preamble(evt);
+        shouldBeEqualToString(&quot;JSON.stringify(cursor.key)&quot;, '[&quot;key&quot;]');
+        shouldBeEqualToString(&quot;JSON.stringify(cursor.primaryKey)&quot;, '[&quot;key&quot;]');
+        shouldBeEqualToString(&quot;JSON.stringify(cursor.value)&quot;, '{&quot;value&quot;:&quot;value&quot;}');
+        finishJSTest();
+    };
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcesconnectionleakjsfromrev195298trunkLayoutTestsstorageindexeddbconnectionleakhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/connection-leak.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/connection-leak.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/connection-leak.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/connection-leak.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;Regression test to ensure that IndexedDB connections don't leak&quot;);
+
+setDBNameFromPath();
+doFirstOpen();
+
+function doFirstOpen()
+{
+    preamble();
+
+    evalAndLog(&quot;request = indexedDB.open(dbname, 1)&quot;);
+    evalAndLog(&quot;sawUpgradeNeeded1 = false&quot;);
+    request.onerror = unexpectedErrorCallback;
+    request.onblocked = unexpectedBlockedCallback;
+    request.onupgradeneeded = function onUpgradeNeeded1() {
+        preamble();
+        evalAndLog(&quot;sawUpgradeNeeded1 = true&quot;);
+    };
+    request.onsuccess = function onOpenSuccess1() {
+        preamble();
+        shouldBeTrue(&quot;sawUpgradeNeeded1&quot;);
+        evalAndLog(&quot;db = request.result&quot;);
+        evalAndLog(&quot;db.close()&quot;);
+
+        doSecondOpen();
+    };
+}
+
+function doSecondOpen()
+{
+    preamble();
+
+    evalAndLog(&quot;request = indexedDB.open(dbname, 1)&quot;);
+    request.onerror = unexpectedErrorCallback;
+    request.onblocked = unexpectedBlockedCallback;
+    request.onupgradeneeded = unexpectedUpgradeNeededCallback;
+    request.onsuccess = function onOpenSuccess2() {
+        preamble();
+        evalAndLog(&quot;db = request.result&quot;);
+
+        evalAndLog(&quot;db = null&quot;);
+        evalAndLog(&quot;request = null&quot;);
+
+        debug(&quot;Run GC outside of request's callback via setTimeout()&quot;);
+        setTimeout( function() {
+            evalAndLog(&quot;window.gc()&quot;);
+            doThirdOpen();
+        }, 0);
+    };
+}
+
+function doThirdOpen()
+{
+    preamble();
+
+    evalAndLog(&quot;request = indexedDB.open(dbname, 2)&quot;);
+    evalAndLog(&quot;sawUpgradeNeeded3 = false&quot;);
+    request.onerror = unexpectedErrorCallback;
+    request.onblocked = unexpectedBlockedCallback;
+    request.onupgradeneeded = function onUpgradeNeeded2() {
+        preamble();
+        evalAndLog(&quot;sawUpgradeNeeded3 = true&quot;);
+    };
+    request.onsuccess = function onOpenSuccess3() {
+        preamble();
+        shouldBeTrue(&quot;sawUpgradeNeeded3&quot;);
+        evalAndLog(&quot;db = request.result&quot;);
+        evalAndLog(&quot;db.close()&quot;);
+
+        finishJSTest();
+    };
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcescursorcastjsfromrev195298trunkLayoutTestsstorageindexeddbcursorcasthtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/cursor-cast.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/cursor-cast.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/cursor-cast.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/cursor-cast.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;Ensure cursor wrappers are created correctly.&quot;);
+
+indexedDBTest(prepareDatabase, verifyWrappers);
+function prepareDatabase(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
+    evalAndLog(&quot;store.put(0, 0)&quot;);
+}
+
+function verifyWrappers(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+    evalAndLog(&quot;tx = db.transaction('store', 'readwrite')&quot;);
+    evalAndLog(&quot;request = tx.objectStore('store').openCursor()&quot;);
+
+    request.onsuccess = function onOpenCursorSuccess(evt) {
+        preamble(evt);
+        evalAndLog(&quot;cursor = event.target.result&quot;);
+        evalAndLog(&quot;request = cursor.update(1)&quot;);
+
+        request.onsuccess = function onUpdateSuccess(evt) {
+            preamble(evt);
+            evalAndLog(&quot;cursor = null&quot;);
+            gc();
+            gc(); // FIXME: Shouldn't need to call twice. http://crbug.com/288072
+            setTimeout(checkCursorType, 0);
+        };
+    };
+}
+
+function checkCursorType() {
+    shouldBeEqualToString(&quot;request.source.toString()&quot;, &quot;[object IDBCursorWithValue]&quot;);
+    finishJSTest();
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcescursorleakjsfromrev195298trunkLayoutTestsstorageindexeddbcursorleakhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/cursor-leak.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/cursor-leak.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/cursor-leak.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/cursor-leak.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;Verify that that cursors weakly hold script value properties&quot;);
+
+if (window.internals) {
+    indexedDBTest(prepareDatabase, onOpen);
+} else {
+    testFailed('This test requires access to the Internals object');
+    finishJSTest();
+}
+
+function prepareDatabase(evt)
+{
+    db = event.target.result;
+    store = db.createObjectStore('store');
+    store.put({value: 'value'}, ['key']);
+}
+
+function onOpen(evt)
+{
+    // evalAndLog() is not used as that generates new DOM nodes.
+
+    db = evt.target.result;
+    tx = db.transaction('store');
+    store = tx.objectStore('store');
+    cursorRequest = store.openCursor();
+    cursorRequest.onsuccess = function() {
+        cursor = cursorRequest.result;
+    };
+    tx.oncomplete = function() {
+        db.close();
+
+        // Try and induce a leak by a reference cycle from DOM to V8 and back.
+        // If the v8 value of cursor.key (etc) is only held by the cursor's
+        // V8 wrapper then there will be no leak.
+        cursor.key.cursor = cursor;
+        cursor.primaryKey.cursor = cursor;
+        cursor.value.cursor = cursor;
+
+        cursorObserver = internals.observeGC(cursor);
+
+        cursorRequest = null;
+        cursor = null;
+
+        gc();
+
+        shouldBeTrue(&quot;cursorObserver.wasCollected&quot;);
+        finishJSTest();
+    };
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcescursoroverloadsjsfromrev195298trunkLayoutTestsstorageindexeddbcursoroverloadshtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/cursor-overloads.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/cursor-overloads.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/cursor-overloads.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/cursor-overloads.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;Validate the overloads of IDBObjectStore.openCursor(), IDBIndex.openCursor() and IDBIndex.openKeyCursor().&quot;);
+
+indexedDBTest(prepareDatabase, verifyOverloads);
+function prepareDatabase()
+{
+    db = event.target.result;
+    event.target.transaction.onabort = unexpectedAbortCallback;
+    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
+    evalAndLog(&quot;index = store.createIndex('index', 'value')&quot;);
+    evalAndLog(&quot;store.put({value: 0}, 0)&quot;);
+}
+
+function verifyOverloads()
+{
+    debug(&quot;&quot;);
+    debug(&quot;verifyOverloads():&quot;);
+    evalAndLog(&quot;trans = db.transaction('store')&quot;);
+    evalAndLog(&quot;store = trans.objectStore('store')&quot;);
+    evalAndLog(&quot;index = store.index('index')&quot;);
+
+    checkCursorDirection(&quot;store.openCursor()&quot;, &quot;next&quot;);
+    checkCursorDirection(&quot;store.openCursor(0)&quot;, &quot;next&quot;);
+    checkCursorDirection(&quot;store.openCursor(0, 'next')&quot;, &quot;next&quot;);
+    checkCursorDirection(&quot;store.openCursor(0, 'nextunique')&quot;, &quot;nextunique&quot;);
+    checkCursorDirection(&quot;store.openCursor(0, 'prev')&quot;, &quot;prev&quot;);
+    checkCursorDirection(&quot;store.openCursor(0, 'prevunique')&quot;, &quot;prevunique&quot;);
+
+    checkCursorDirection(&quot;store.openCursor(IDBKeyRange.only(0))&quot;, &quot;next&quot;);
+    checkCursorDirection(&quot;store.openCursor(IDBKeyRange.only(0), 'next')&quot;, &quot;next&quot;);
+    checkCursorDirection(&quot;store.openCursor(IDBKeyRange.only(0), 'nextunique')&quot;, &quot;nextunique&quot;);
+    checkCursorDirection(&quot;store.openCursor(IDBKeyRange.only(0), 'prev')&quot;, &quot;prev&quot;);
+    checkCursorDirection(&quot;store.openCursor(IDBKeyRange.only(0), 'prevunique')&quot;, &quot;prevunique&quot;);
+
+    checkCursorDirection(&quot;index.openCursor()&quot;, &quot;next&quot;);
+    checkCursorDirection(&quot;index.openCursor(0)&quot;, &quot;next&quot;);
+    checkCursorDirection(&quot;index.openCursor(0, 'next')&quot;, &quot;next&quot;);
+    checkCursorDirection(&quot;index.openCursor(0, 'nextunique')&quot;, &quot;nextunique&quot;);
+    checkCursorDirection(&quot;index.openCursor(0, 'prev')&quot;, &quot;prev&quot;);
+    checkCursorDirection(&quot;index.openCursor(0, 'prevunique')&quot;, &quot;prevunique&quot;);
+
+    checkCursorDirection(&quot;index.openCursor(IDBKeyRange.only(0))&quot;, &quot;next&quot;);
+    checkCursorDirection(&quot;index.openCursor(IDBKeyRange.only(0), 'next')&quot;, &quot;next&quot;);
+    checkCursorDirection(&quot;index.openCursor(IDBKeyRange.only(0), 'nextunique')&quot;, &quot;nextunique&quot;);
+    checkCursorDirection(&quot;index.openCursor(IDBKeyRange.only(0), 'prev')&quot;, &quot;prev&quot;);
+    checkCursorDirection(&quot;index.openCursor(IDBKeyRange.only(0), 'prevunique')&quot;, &quot;prevunique&quot;);
+
+    checkCursorDirection(&quot;index.openKeyCursor()&quot;, &quot;next&quot;);
+    checkCursorDirection(&quot;index.openKeyCursor(0)&quot;, &quot;next&quot;);
+    checkCursorDirection(&quot;index.openKeyCursor(0, 'next')&quot;, &quot;next&quot;);
+    checkCursorDirection(&quot;index.openKeyCursor(0, 'nextunique')&quot;, &quot;nextunique&quot;);
+    checkCursorDirection(&quot;index.openKeyCursor(0, 'prev')&quot;, &quot;prev&quot;);
+    checkCursorDirection(&quot;index.openKeyCursor(0, 'prevunique')&quot;, &quot;prevunique&quot;);
+
+    checkCursorDirection(&quot;index.openKeyCursor(IDBKeyRange.only(0))&quot;, &quot;next&quot;);
+    checkCursorDirection(&quot;index.openKeyCursor(IDBKeyRange.only(0), 'next')&quot;, &quot;next&quot;);
+    checkCursorDirection(&quot;index.openKeyCursor(IDBKeyRange.only(0), 'nextunique')&quot;, &quot;nextunique&quot;);
+    checkCursorDirection(&quot;index.openKeyCursor(IDBKeyRange.only(0), 'prev')&quot;, &quot;prev&quot;);
+    checkCursorDirection(&quot;index.openKeyCursor(IDBKeyRange.only(0), 'prevunique')&quot;, &quot;prevunique&quot;);
+
+    trans.oncomplete = finishJSTest;
+}
+
+function checkCursorDirection(statement, direction)
+{
+    request = eval(statement);
+    request.onerror = unexpectedErrorCallback;
+    request.onsuccess = function() {
+        debug(statement);
+        shouldBeNonNull(&quot;event.target.result&quot;)
+        shouldBeEqualToString(&quot;event.target.result.direction&quot;, direction);
+    };
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcescursorrequestcyclejsfromrev195298trunkLayoutTestsstorageindexeddbcursorrequestcyclehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/cursor-request-cycle.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/cursor-request-cycle.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/cursor-request-cycle.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/cursor-request-cycle.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,85 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;Verify that that cursors weakly hold request, and work if request is GC'd&quot;);
+
+indexedDBTest(prepareDatabase, onOpen);
+
+function prepareDatabase(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
+    store.put(&quot;value1&quot;, &quot;key1&quot;);
+    store.put(&quot;value2&quot;, &quot;key2&quot;);
+}
+
+function onOpen(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+    evalAndLog(&quot;tx = db.transaction('store')&quot;);
+    evalAndLog(&quot;store = tx.objectStore('store')&quot;);
+
+    evalAndLog(&quot;cursorRequest = store.openCursor()&quot;);
+    cursorRequest.onsuccess = function openCursorRequestSuccess(evt) {
+        preamble(evt);
+        debug(&quot;Result will be checked later, to ensure that lazy access is safe&quot;);
+    };
+
+    evalAndLog(&quot;otherRequest = store.get(0)&quot;);
+    otherRequest.onsuccess = function otherRequestSuccess(evt) {
+        preamble(evt);
+
+        debug(&quot;Verify that the request's result can be accessed lazily:&quot;);
+        evalAndLog(&quot;gc()&quot;);
+
+        evalAndLog(&quot;cursor = cursorRequest.result&quot;);
+        shouldBeNonNull(&quot;cursor&quot;);
+        shouldBeEqualToString(&quot;cursor.key&quot;, &quot;key1&quot;);
+        shouldBeEqualToString(&quot;cursor.value&quot;, &quot;value1&quot;);
+        evalAndLog(&quot;cursorRequest.extra = 123&quot;);
+        evalAndLog(&quot;cursor.extra = 456&quot;);
+
+        // Assign a new handler to inspect the request and cursor indirectly.
+        cursorRequest.onsuccess = function cursorContinueSuccess(evt) {
+            preamble(evt);
+            evalAndLog(&quot;cursor = event.target.result&quot;);
+            shouldBeNonNull(&quot;cursor&quot;);
+            shouldBeEqualToString(&quot;cursor.key&quot;, &quot;key2&quot;);
+            shouldBeEqualToString(&quot;cursor.value&quot;, &quot;value2&quot;);
+            shouldBe(&quot;event.target.extra&quot;, &quot;123&quot;);
+            shouldBe(&quot;cursor.extra&quot;, &quot;456&quot;);
+        };
+
+        debug(&quot;Ensure request is not released if cursor is still around.&quot;);
+        cursorRequestObservation = internals.observeGC(cursorRequest);
+        evalAndLog(&quot;cursorRequest = null&quot;);
+        evalAndLog(&quot;gc()&quot;);
+        shouldBeFalse(&quot;cursorRequestObservation.wasCollected&quot;);
+
+        evalAndLog(&quot;cursor.continue()&quot;);
+
+        cursorObservation = internals.observeGC(cursor);
+        evalAndLog(&quot;cursor = null&quot;);
+        evalAndLog(&quot;gc()&quot;);
+        shouldBeFalse(&quot;cursorObservation.wasCollected&quot;);
+
+        evalAndLog(&quot;finalRequest = store.get(0)&quot;);
+        finalRequest.onsuccess = function finalRequestSuccess(evt) {
+            preamble(evt);
+            shouldBeEqualToString(&quot;cursor.key&quot;, &quot;key2&quot;);
+            shouldBeEqualToString(&quot;cursor.value&quot;, &quot;value2&quot;);
+
+            cursorObservation = internals.observeGC(cursor);
+            evalAndLog(&quot;cursor = null&quot;);
+            evalAndLog(&quot;gc()&quot;);
+            shouldBeTrue(&quot;cursorRequestObservation.wasCollected&quot;);
+            shouldBeTrue(&quot;cursorObservation.wasCollected&quot;);
+        };
+    };
+
+    tx.oncomplete = finishJSTest;
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcesdeleteIndexbug110792jsfromrev195298trunkLayoutTestsstorageindexeddbdeleteIndexbug110792html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/deleteIndex-bug110792.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/deleteIndex-bug110792.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/deleteIndex-bug110792.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/deleteIndex-bug110792.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;Ensure IndexedDB's IDBObjectStore.deleteIndex() works if IDBIndex object has not been fetched - regression test for bug 110792.&quot;);
+
+indexedDBTest(onFirstUpgradeNeeded, closeAndReOpen, {version: 1});
+
+function onFirstUpgradeNeeded(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
+    evalAndLog(&quot;store.createIndex('index', 'keyPath')&quot;);
+}
+
+function closeAndReOpen()
+{
+    preamble();
+    evalAndLog(&quot;db.close()&quot;);
+    debug(&quot;&quot;);
+    request = evalAndLog(&quot;indexedDB.open(dbname, 2)&quot;);
+    request.onblocked = unexpectedBlockedCallback;
+    request.onerror = unexpectedErrorCallback;
+    request.onupgradeneeded = onSecondUpgradeNeeded;
+    request.onsuccess = finishJSTest;
+}
+
+function onSecondUpgradeNeeded(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+    evalAndLog(&quot;store = event.target.transaction.objectStore('store')&quot;);
+    // Do NOT add a call to store.index('index') here (e.g. to assert it exists)
+    // or the bug disappears.
+    evalAndLog(&quot;store.deleteIndex('index')&quot;);
+    evalAndExpectException(&quot;store.index('index')&quot;, &quot;DOMException.NOT_FOUND_ERR&quot;, &quot;'NotFoundError'&quot;);
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcesdeletedatabasetransactionjsfromrev195298trunkLayoutTestsstorageindexeddbdeletedatabasetransactionhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/deletedatabase-transaction.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/deletedatabase-transaction.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/deletedatabase-transaction.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/deletedatabase-transaction.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;Ensure deleteDatabase() can run concurrently with transactions in other databases&quot;);
+
+indexedDBTest(prepareDatabase, startTransaction);
+function prepareDatabase()
+{
+    db = event.target.result;
+    evalAndLog(&quot;db.createObjectStore('store')&quot;);
+}
+
+function startTransaction() {
+    debug(&quot;&quot;);
+    debug(&quot;Start a transaction against the first database:&quot;);
+    evalAndLog(&quot;trans = db.transaction('store', 'readonly')&quot;);
+    evalAndLog(&quot;trans.objectStore('store').get(0)&quot;);
+
+    debug(&quot;&quot;);
+    debug(&quot;Delete a different database:&quot;);
+    evalAndLog(&quot;dbname2 = dbname + '2'&quot;);
+    request = evalAndLog(&quot;indexedDB.deleteDatabase(dbname2)&quot;);
+    request.onblocked = unexpectedBlockedCallback;
+    request.onerror = unexpectedErrorCallback;
+    request.onsuccess = function() {
+        testPassed(&quot;success event was fired at delete request&quot;);
+    };
+
+    trans.oncomplete = finishJSTest;
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcesmetadataracejsfromrev195298trunkLayoutTestsstorageindexeddbmetadataracehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/metadata-race.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/metadata-race.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/metadata-race.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/metadata-race.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;Ensure IndexedDB transactions created before open onsuccess have correct metadata&quot;);
+
+indexedDBTest(prepareDatabase, onOpenSuccess);
+function prepareDatabase(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
+    evalAndLog(&quot;store.createIndex('index', 'keyPath')&quot;);
+    evalAndLog(&quot;transaction = event.target.transaction&quot;);
+    shouldNotThrow(&quot;index = transaction.objectStore('store').index('index')&quot;);
+    transaction.oncomplete = onTransactionComplete;
+}
+
+function onTransactionComplete(evt)
+{
+    preamble(evt);
+    debug(&quot;In multiprocess mode, 'complete' event may be dispatched before\n&quot; +
+          &quot;the 'success' arrives with updated metadata. Ensure the new metadata\n&quot; +
+          &quot;is still used for transactions.&quot;);
+    evalAndLog(&quot;store = db.transaction('store').objectStore('store')&quot;);
+    shouldNotThrow(&quot;index = store.index('index')&quot;);
+}
+
+function onOpenSuccess(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+    evalAndLog(&quot;store = db.transaction('store').objectStore('store')&quot;);
+    shouldNotThrow(&quot;index = store.index('index')&quot;);
+    finishJSTest();
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcesnoblobsjsfromrev195298trunkLayoutTestsstorageindexeddbnoblobshtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/noblobs.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/noblobs.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/noblobs.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/noblobs.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,78 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;Confirm Blob/File/FileList limitations of WebKit's IndexedDB implementation.&quot;);
+// FIXME: This verifies that blob-type data is rejected for now, rather than silently failing.
+// Tracked for the Chromium port as: http://crbug.com/108012
+
+fileInput = document.getElementById(&quot;fileInput&quot;);
+if (window.eventSender) {
+    var fileRect = fileInput.getClientRects()[0];
+    var targetX = fileRect.left + fileRect.width / 2;
+    var targetY = fileRect.top + fileRect.height / 2;
+    eventSender.beginDragWithFiles(['resources/test-data.html', 'resources/test-data.txt']);
+    eventSender.mouseMoveTo(targetX, targetY);
+    eventSender.mouseUp();
+}
+
+function prepareDatabase()
+{
+    db = event.target.result;
+    var trans = event.target.transaction;
+    evalAndLog(&quot;store = db.createObjectStore('storeName')&quot;);
+    evalAndLog(&quot;store.put('value', 'key')&quot;);
+    trans.onerror = unexpectedErrorCallback;
+    trans.onabort = unexpectedAbortCallback;
+}
+
+function testBlob()
+{
+    debug(&quot;&quot;);
+    debug(&quot;testBlob():&quot;);
+
+    shouldBeTrue(&quot;FileReader != null&quot;);
+    evalAndLog(&quot;test_content = 'This is a test. This is only a test.'&quot;);
+    evalAndLog(&quot;blob = new Blob([test_content])&quot;);
+    validateExceptions(&quot;blob&quot;, testFile);
+}
+
+function testFile()
+{
+    debug(&quot;&quot;);
+    debug(&quot;testFile():&quot;);
+    evalAndLog(&quot;file = fileInput.files[0]&quot;);
+    validateExceptions(&quot;file&quot;, testFileList);
+}
+
+function testFileList()
+{
+    debug(&quot;&quot;);
+    debug(&quot;testFileList():&quot;);
+    evalAndLog(&quot;filelist = fileInput.files&quot;);
+    validateExceptions(&quot;filelist&quot;, finishJSTest);
+}
+
+function validateExceptions(variable, onComplete)
+{
+    debug(&quot;&quot;);
+    debug(&quot;validateExceptions(&quot; + variable + &quot;):&quot;);
+    evalAndLog(&quot;transaction = db.transaction('storeName', 'readwrite')&quot;);
+    evalAndLog(&quot;store = transaction.objectStore('storeName')&quot;);
+    evalAndExpectException(&quot;store.put(&quot; + variable + &quot;, 'key')&quot;, &quot;DOMException.DATA_CLONE_ERR&quot;);
+    evalAndExpectException(&quot;store.add(&quot; + variable + &quot;, 'key')&quot;, &quot;DOMException.DATA_CLONE_ERR&quot;);
+    evalAndLog(&quot;request = store.openCursor()&quot;);
+    request.onsuccess = function () {
+        evalAndLog(&quot;cursor = request.result&quot;);
+        evalAndExpectException(&quot;cursor.update(&quot; + variable + &quot;)&quot;, &quot;DOMException.DATA_CLONE_ERR&quot;);
+    };
+    transaction.oncomplete = onComplete;
+}
+
+if (window.eventSender) {
+    indexedDBTest(prepareDatabase, testBlob);
+} else {
+    alert(&quot;Select file(s) using the input control above to initiate the test&quot;);
+    document.getElementById(&quot;fileInput&quot;).onchange = function() { indexedDBTest(prepareDatabase, testBlob); };
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcesobjectlookupsinversionchangejsfromrev195298trunkLayoutTestsstorageindexeddbobjectlookupsinversionchangehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/object-lookups-in-versionchange.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/object-lookups-in-versionchange.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/object-lookups-in-versionchange.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/object-lookups-in-versionchange.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;Regression test for http://webkit.org/b/102547&quot;);
+
+indexedDBTest(prepareDatabase, finishJSTest);
+
+function prepareDatabase() {
+    evalAndLog(&quot;db = event.target.result&quot;);
+    evalAndLog(&quot;transaction = event.target.transaction&quot;);
+    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
+    debug(&quot;&quot;);
+    evalAndExpectException(&quot;transaction.objectStore('no-such-store')&quot;, &quot;DOMException.NOT_FOUND_ERR&quot;, &quot;'NotFoundError'&quot;);
+    debug(&quot;&quot;);
+    evalAndExpectException(&quot;store.index('no-such-index')&quot;, &quot;DOMException.NOT_FOUND_ERR&quot;, &quot;'NotFoundError'&quot;);
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcesopenbadversionsjsfromrev195298trunkLayoutTestsstorageindexeddbopenbadversionshtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/open-bad-versions.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/open-bad-versions.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/open-bad-versions.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/open-bad-versions.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;No crashes when opening and reloading with bad version numbers&quot;);
+
+function test()
+{
+  removeVendorPrefixes();
+  evalAndLog(&quot;dbname = String(window.location)&quot;);
+
+  try { indexedDB.open(dbname, -1); } catch (e) { }
+  indexedDB.open(dbname, 2);
+  try { indexedDB.open(dbname, -1); } catch (e) { }
+
+  setTimeout(function() {
+    if (!window.location.search) {
+      window.location = window.location + &quot;?2&quot;;
+    } else {
+      finishJSTest();
+    }
+  }, 500);
+}
+
+test();
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcesoptionalargumentsjsfromrev195298trunkLayoutTestsstorageindexeddboptionalargumentshtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/optional-arguments.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/optional-arguments.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/optional-arguments.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/optional-arguments.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,129 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;Exercise optional arguments with missing vs. undefined in IndexedDB methods.&quot;);
+
+indexedDBTest(prepareDatabase, checkOptionalArguments);
+function prepareDatabase(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+    evalAndLog(&quot;store = db.createObjectStore('store', {keyPath: 'id'})&quot;);
+    evalAndLog(&quot;store.createIndex('by_name', 'name', {unique: true})&quot;);
+
+    evalAndLog(&quot;store.put({id: 1, name: 'a'})&quot;);
+}
+
+function checkOptionalArguments(event)
+{
+    evalAndLog(&quot;tx = db.transaction('store', 'readwrite')&quot;);
+    tx.oncomplete = finishJSTest;
+
+    evalAndLog(&quot;store = tx.objectStore('store')&quot;);
+    evalAndLog(&quot;index = store.index('by_name')&quot;);
+
+    shouldBe(&quot;IDBKeyRange.lowerBound(0).lowerOpen&quot;, &quot;false&quot;);
+    shouldBe(&quot;IDBKeyRange.upperBound(0).upperOpen&quot;, &quot;false&quot;);
+    shouldBe(&quot;IDBKeyRange.bound(0, 1).lowerOpen&quot;, &quot;false&quot;);
+    shouldBe(&quot;IDBKeyRange.bound(0, 1).upperOpen&quot;, &quot;false&quot;);
+
+    shouldBe(&quot;IDBKeyRange.lowerBound(0, undefined).lowerOpen&quot;, &quot;false&quot;);
+    shouldBe(&quot;IDBKeyRange.upperBound(0, undefined).upperOpen&quot;, &quot;false&quot;);
+    shouldBe(&quot;IDBKeyRange.bound(0, 1, undefined, undefined).lowerOpen&quot;, &quot;false&quot;);
+    shouldBe(&quot;IDBKeyRange.bound(0, 1, undefined, undefined).upperOpen&quot;, &quot;false&quot;);
+
+    shouldNotThrow(&quot;store.add({id: 2, name: 'b'})&quot;);
+    shouldNotThrow(&quot;store.put({id: 3, name: 'c'})&quot;);
+    shouldNotThrow(&quot;store.add({id: 4, name: 'd'}, undefined)&quot;);
+    shouldNotThrow(&quot;store.put({id: 5, name: 'e'}, undefined)&quot;);
+
+    tasks = [
+        function(callback) { verifyCursor(&quot;store.openCursor()&quot;, &quot;next&quot;, 5, callback); },
+        function(callback) { verifyCursor(&quot;store.openCursor(null)&quot;, &quot;next&quot;, 5, callback); },
+        function(callback) { verifyCursor(&quot;store.openCursor(IDBKeyRange.lowerBound(4))&quot;, &quot;next&quot;, 2, callback); },
+        function(callback) { verifyCursor(&quot;store.openCursor(3)&quot;, &quot;next&quot;, 1, callback); },
+
+        function(callback) { verifyCursor(&quot;index.openCursor()&quot;, &quot;next&quot;, 5, callback); },
+        function(callback) { verifyCursor(&quot;index.openCursor(null)&quot;, &quot;next&quot;, 5, callback); },
+        function(callback) { verifyCursor(&quot;index.openCursor(IDBKeyRange.lowerBound('b'))&quot;, &quot;next&quot;, 4, callback); },
+        function(callback) { verifyCursor(&quot;index.openCursor('c')&quot;, &quot;next&quot;, 1, callback); },
+
+        function(callback) { verifyCursor(&quot;index.openKeyCursor()&quot;, &quot;next&quot;, 5, callback); },
+        function(callback) { verifyCursor(&quot;index.openKeyCursor(null)&quot;, &quot;next&quot;, 5, callback); },
+        function(callback) { verifyCursor(&quot;index.openKeyCursor(IDBKeyRange.lowerBound('b'))&quot;, &quot;next&quot;, 4, callback); },
+        function(callback) { verifyCursor(&quot;index.openKeyCursor('c')&quot;, &quot;next&quot;, 1, callback); },
+
+        function(callback) { verifyCount(&quot;store.count()&quot;, 5, callback); },
+        function(callback) { verifyCount(&quot;store.count(null)&quot;, 5, callback); },
+        function(callback) { verifyCount(&quot;store.count(IDBKeyRange.lowerBound(2))&quot;, 4, callback); },
+
+        function(callback) { verifyCount(&quot;index.count()&quot;, 5, callback); },
+        function(callback) { verifyCount(&quot;index.count(null)&quot;, 5, callback); },
+        function(callback) { verifyCount(&quot;index.count(IDBKeyRange.lowerBound('b'))&quot;, 4, callback); },
+
+        continueUndefined,
+
+    ];
+    function doNextTask() {
+        var task = tasks.shift();
+        if (task) {
+            task(doNextTask);
+        }
+    }
+    doNextTask();
+}
+
+function verifyCursor(expr, direction, expected, callback)
+{
+    preamble();
+    cursor = null;
+    continues = 0;
+    evalAndLog(&quot;request = &quot; + expr);
+    request.onerror = unexpectedErrorCallback;
+
+    request.onsuccess = function() {
+        if (request.result) {
+            if (!cursor) {
+                evalAndLog(&quot;cursor = request.result&quot;);
+                shouldBeEqualToString(&quot;cursor.direction&quot;, direction);
+            }
+            ++continues;
+            cursor.continue();
+        } else {
+            shouldBe(&quot;continues&quot;, JSON.stringify(expected));
+            callback();
+        }
+    };
+}
+
+function verifyCount(expr, expected, callback)
+{
+    preamble();
+    evalAndLog(&quot;request = &quot; + expr);
+    request.onerror = unexpectedErrorCallback;
+
+    request.onsuccess = function() {
+        shouldBe(&quot;request.result&quot;, JSON.stringify(expected));
+        callback();
+    };
+}
+
+function continueUndefined(callback)
+{
+    preamble();
+    first = true;
+    evalAndLog(&quot;request = store.openCursor()&quot;);
+    request.onerror = unexpectedErrorCallback;
+
+    request.onsuccess = function() {
+        if (first) {
+            first = false;
+            evalAndLog(&quot;cursor = request.result&quot;);
+            shouldBeNonNull(&quot;request.result&quot;);
+            shouldNotThrow(&quot;cursor.continue(undefined)&quot;);
+            callback();
+        }
+    };
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcesprefetchinvalidationjsfromrev195298trunkLayoutTestsstorageindexeddbprefetchinvalidationhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/prefetch-invalidation.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/prefetch-invalidation.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/prefetch-invalidation.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/prefetch-invalidation.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,88 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;Ensure IndexedDB's write operations invalidate cursor prefetch caches&quot;);
+
+indexedDBTest(prepareDatabase, onOpenSuccess);
+function prepareDatabase(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
+}
+
+function onOpenSuccess(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+
+    var steps = [
+        deleteRange,
+        clearStore
+    ];
+
+    (function nextStep() {
+        var step = steps.shift();
+        if (step) {
+            doPrefetchInvalidationTest(step, nextStep);
+        } else {
+            finishJSTest();
+            return;
+        }
+    }());
+}
+
+function doPrefetchInvalidationTest(operation, callback)
+{
+    debug(&quot;&quot;);
+    debug(&quot;-------------------------------------------&quot;);
+    preamble();
+    evalAndLog(&quot;store = db.transaction('store', 'readwrite').objectStore('store')&quot;);
+    debug(&quot;Populate the store with 200 records.&quot;);
+    for (var i = 0; i &lt; 200; ++i)
+        store.put(i, i);
+    evalAndLog(&quot;cursorRequest = store.openCursor()&quot;);
+    continue100Times(operation, callback);
+}
+
+function continue100Times(operation, callback)
+{
+    preamble();
+    var count = 0;
+
+    cursorRequest.onsuccess = function() {
+        var cursor = cursorRequest.result;
+        ++count;
+        if (count &lt; 100) {
+            cursor.continue();
+            return;
+        }
+        shouldBeNonNull(&quot;cursorRequest.result&quot;);
+        doOperationAndContinue(operation, callback);
+    }
+}
+
+function doOperationAndContinue(operation, callback)
+{
+    preamble();
+    operation();
+    evalAndLog(&quot;cursor = cursorRequest.result&quot;);
+    evalAndLog(&quot;cursor.continue()&quot;)
+    cursorRequest.onsuccess = function onContinueSuccess() {
+        preamble();
+        shouldBeNull(&quot;cursorRequest.result&quot;);
+        callback();
+    };
+}
+
+function deleteRange()
+{
+    return evalAndLog(&quot;store.delete(IDBKeyRange.bound(-Infinity, +Infinity))&quot;);
+}
+
+function clearStore()
+{
+    return evalAndLog(&quot;store.clear()&quot;);
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcesprefetchracejsfromrev195298trunkLayoutTestsstorageindexeddbprefetchracehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/prefetch-race.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/prefetch-race.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/prefetch-race.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/prefetch-race.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;Ensure IndexedDB's cursor prefetch cache requests are invalidated&quot;);
+
+indexedDBTest(prepareDatabase, onOpenSuccess);
+function prepareDatabase(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
+    debug(&quot;Populate with even records...&quot;);
+    for (var i = 0; i &lt; 10; i += 2)
+        store.put(i, i);
+}
+
+function onOpenSuccess(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+
+    evalAndLog(&quot;tx = db.transaction('store', 'readwrite')&quot;);
+    evalAndLog(&quot;store = tx.objectStore('store')&quot;);
+    evalAndLog(&quot;request = store.openCursor()&quot;);
+
+    kPrefetchThreshold = 3;
+
+    expected = [&quot;0&quot;, &quot;2&quot;, &quot;4&quot;, &quot;6&quot;, &quot;7&quot;, &quot;8&quot;, &quot;9&quot;];
+    continueCount = 0;
+    request.onsuccess = function cursorSuccess() {
+        preamble();
+        cursor = request.result;
+        if (!cursor)
+            return;
+        ++continueCount;
+
+        expect = expected.shift();
+        shouldBe(&quot;cursor.key&quot;, expect);
+        evalAndLog(&quot;cursor.continue()&quot;);
+
+        if (continueCount === kPrefetchThreshold) {
+            debug(&quot;\nThat should have triggered a prefetch, injecting odd records...&quot;);
+            for (var i = 1; i &lt; 10; i += 2)
+                store.put(i, i);
+        }
+    };
+
+    tx.oncomplete = function() {
+        shouldBe(&quot;continueCount&quot;, &quot;7&quot;);
+        finishJSTest();
+    };
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcesprimarykeyuniquetoobjectstorejsfromrev195298trunkLayoutTestsstorageindexeddbprimarykeyuniquetoobjectstorehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/primary-key-unique-to-objectstore.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/primary-key-unique-to-objectstore.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/primary-key-unique-to-objectstore.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/primary-key-unique-to-objectstore.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,146 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+if (testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+
+function log(msg) {
+    document.getElementById(&quot;logger&quot;).innerHTML += msg + &quot;&lt;br&gt;&quot;;
+}
+
+var openRequest = indexedDB.open(&quot;pkutos&quot;, 1);
+
+openRequest.onupgradeneeded = function(e) {
+    var thisDB = e.target.result;
+
+    if(!thisDB.objectStoreNames.contains(&quot;people&quot;)) {
+        thisDB.createObjectStore(&quot;people&quot;, {keyPath:&quot;id&quot;});
+    }
+
+    if(!thisDB.objectStoreNames.contains(&quot;notes&quot;)) {
+        thisDB.createObjectStore(&quot;notes&quot;, {keyPath:&quot;uid&quot;});
+    }
+}
+
+openRequest.onsuccess = function(e) {
+    db = e.target.result;
+    addPerson();
+}    
+
+openRequest.onerror = function(e) {
+    log(&quot;openRequest error - &quot; + e);
+}
+
+var sharedID = 0;
+
+function addPerson() {
+    log(&quot;About to add person and note&quot;);
+
+    //Get a transaction
+    //default for OS list is all, default for type is read
+    var transaction = db.transaction([&quot;people&quot;], &quot;readwrite&quot;);
+
+    //Ask for the objectStore
+    var store = transaction.objectStore(&quot;people&quot;);
+
+    //Define a person
+    var person = {
+        name: &quot;Person&quot;,
+        id: sharedID
+    }
+
+    //Perform the add
+    var request = store.add(person);
+
+    request.onerror = function(e) {
+        log(&quot;Error adding person - &quot;, e);
+    }
+
+    request.onsuccess = function(e) {
+        log(&quot;Successfully added person&quot;);
+        setTimeout(&quot;addComplete();&quot;, 0);
+    }
+    
+    //Define a note
+    var note = {
+        note: &quot;Note&quot;,
+        uid: sharedID
+    }
+
+    var transaction2 = db.transaction([&quot;notes&quot;], &quot;readwrite&quot;);
+
+    //Ask for the objectStore
+    var store2 = transaction2.objectStore(&quot;notes&quot;);
+
+    //Perform the add
+    var request2 = store2.add(note);
+
+    request2.onerror = function(e) {
+        log(&quot;Error adding note - &quot;, e);
+    }
+
+    request2.onsuccess = function(e) {
+        log(&quot;Successfully added note&quot;);
+        setTimeout(&quot;addComplete();&quot;, 0);
+    }
+    
+}
+
+var completedAdds = 0;
+function addComplete()
+{
+    if (++completedAdds &lt; 2)
+        return;
+
+    //Get a transaction
+    var transaction = db.transaction([&quot;people&quot;], &quot;readwrite&quot;);
+
+    //Ask for the objectStore
+    var store = transaction.objectStore(&quot;people&quot;);
+
+    //Perform the add
+    var request = store.get(sharedID);
+
+    request.onerror = function(e) {
+        log(&quot;Error getting person - &quot;, e);
+    }
+
+    request.onsuccess = function(e) {
+        log(&quot;Successfully got person&quot;);
+        for (n in e.target.result) {
+            log(n);
+        }
+        getComplete();
+    }
+
+    var transaction2 = db.transaction([&quot;notes&quot;], &quot;readwrite&quot;);
+
+    //Ask for the objectStore
+    var store2 = transaction2.objectStore(&quot;notes&quot;);
+
+    //Perform the add
+    var request2 = store2.get(sharedID);
+
+    request2.onerror = function(e) {
+        log(&quot;Error getting note - &quot;, e);
+    }
+
+    request2.onsuccess = function(e) {
+        log(&quot;Successfully got note&quot;);
+        for (n in e.target.result) {
+            log(n);
+        }
+        getComplete();
+    }
+}
+
+var completedGets = 0;
+function getComplete()
+{
+    if (++completedGets == 2 &amp;&amp; testRunner)
+        testRunner.notifyDone();
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcesrequestleakjsfromrev195298trunkLayoutTestsstorageindexeddbrequestleakhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/request-leak.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/request-leak.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/request-leak.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/request-leak.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;Verify that that requests weakly hold script value properties&quot;);
+
+if (window.internals) {
+    indexedDBTest(prepareDatabase, onOpen);
+} else {
+    testFailed('This test requires access to the Internals object');
+    finishJSTest();
+}
+
+function prepareDatabase(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
+    evalAndLog(&quot;store.put({value: 'value'}, 'key')&quot;);
+}
+
+function onOpen(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+    evalAndLog(&quot;tx = db.transaction('store')&quot;);
+    evalAndLog(&quot;store = tx.objectStore('store')&quot;);
+    evalAndLog(&quot;request = store.get('key')&quot;);
+    tx.oncomplete = function onTransactionComplete() {
+        preamble();
+        evalAndLog(&quot;db.close()&quot;);
+        shouldBeEqualToString(&quot;typeof request.result&quot;, &quot;object&quot;);
+
+        // Verify that the same object is returned on each access to request.result.
+        evalAndLog(&quot;request.result.x = 123&quot;);
+        shouldBe(&quot;request.result.x&quot;, &quot;123&quot;);
+
+        // Try and induce a leak by a reference cycle from DOM to V8 and back.
+        // If the v8 value of request.result (etc) is only held by the requests's
+        // V8 wrapper then there will be no leak.
+        evalAndLog(&quot;request.result.leak = request&quot;);
+        evalAndLog(&quot;observer = internals.observeGC(request)&quot;);
+        evalAndLog(&quot;request = null&quot;);
+        evalAndLog(&quot;gc()&quot;);
+        shouldBeTrue(&quot;observer.wasCollected&quot;);
+        finishJSTest();
+    };
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcesrequestresultcachejsfromrev195298trunkLayoutTestsstorageindexeddbrequestresultcachehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/request-result-cache.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/request-result-cache.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/request-result-cache.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/request-result-cache.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;Verify that a request's result is dirtied when a cursor is continued&quot;);
+
+indexedDBTest(prepareDatabase, onOpen);
+
+function prepareDatabase(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
+    store.put(&quot;value&quot;, &quot;key&quot;);
+}
+
+function onOpen(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+    evalAndLog(&quot;tx = db.transaction('store')&quot;);
+    evalAndLog(&quot;store = tx.objectStore('store')&quot;);
+
+    evalAndLog(&quot;cursorRequest = store.openCursor()&quot;);
+    cursorRequest.onsuccess = function cursorRequestSuccess(evt) {
+        preamble(evt);
+        if (!cursorRequest.result)
+            return;
+
+        evalAndLog(&quot;cursor = cursorRequest.result&quot;);
+        evalAndLog(&quot;cursor.continue()&quot;);
+        evalAndExpectException(&quot;cursorRequest.result&quot;, &quot;DOMException.INVALID_STATE_ERR&quot;, &quot;'InvalidStateError'&quot;);    };
+
+    tx.oncomplete = finishJSTest;
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcesstructuredclonejsfromrev195298trunkLayoutTestsstorageindexeddbstructuredclonehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/structured-clone.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/structured-clone.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/structured-clone.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/structured-clone.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,546 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;Test structured clone permutations in IndexedDB. File/FileList tests require DumpRenderTree.&quot;);
+
+if (self.eventSender) {
+    var fileInput = document.getElementById(&quot;fileInput&quot;);
+    var fileRect = fileInput.getClientRects()[0];
+    var targetX = fileRect.left + fileRect.width / 2;
+    var targetY = fileRect.top + fileRect.height / 2;
+    eventSender.beginDragWithFiles(['resources/test-data.html', 'resources/test-data.txt']);
+    eventSender.mouseMoveTo(targetX, targetY);
+    eventSender.mouseUp();
+}
+
+indexedDBTest(prepareDatabase, startTests);
+function prepareDatabase()
+{
+    db = event.target.result;
+    evalAndLog(&quot;store = db.createObjectStore('storeName')&quot;);
+    debug(&quot;This index is not used, but evaluating key path on each put() call will exercise (de)serialization:&quot;);
+    evalAndLog(&quot;store.createIndex('indexName', 'dummyKeyPath')&quot;);
+}
+
+function startTests()
+{
+    debug(&quot;&quot;);
+    debug(&quot;Running tests...&quot;);
+    var tests_to_run = [
+        testUndefined,
+        testNull,
+        testBoolean,
+        testNumber,
+        testString,
+        testBooleanObject,
+        testNumberObject,
+        testStringObject,
+        testDateObject,
+        testRegExpObject,
+        testImageData,
+        testBlob,
+        testFile,
+        testFileList,
+        testArray,
+        testObject,
+        testTypedArray
+    ];
+
+    function nextTest() {
+        debug(&quot;&quot;);
+        if (tests_to_run.length) {
+            var test = tests_to_run.shift();
+            test(nextTest); // When done, call this again.
+        } else {
+            testBadTypes();
+        }
+    }
+    nextTest();
+}
+
+function forEachWithCallback(testFunction, values, callback)
+{
+    function nextValue() {
+        if (values.length) {
+            testFunction(values.shift(), nextValue);
+        } else {
+            callback();
+        }
+    }
+
+    nextValue();
+}
+
+function testValue(value, callback)
+{
+    // One transaction per test, since some tests require asynchronous
+    // operations to verify the result (e.g. via FileReader)
+    evalAndLog(&quot;transaction = db.transaction('storeName', 'readwrite')&quot;);
+    transaction.onerror = unexpectedErrorCallback;
+    transaction.onabort = unexpectedAbortCallback;
+    evalAndLog(&quot;store = transaction.objectStore('storeName')&quot;);
+
+    self.value = value;
+    request = evalAndLog(&quot;store.put(value, 'key')&quot;);
+    request.onerror = unexpectedErrorCallback;
+    request.onsuccess = function(e) {
+        request = evalAndLog(&quot;store.get('key')&quot;);
+        request.onerror = unexpectedErrorCallback;
+        request.onsuccess = function(e) {
+            callback(request.result);
+        };
+    };
+}
+
+// Identity testing, sensitive to NaN and -0
+function is(x, y) {
+    if (x === y) {
+        return x !== 0 || 1 / x === 1 / y;
+    }
+    return x !== x &amp;&amp; y !== y;
+}
+
+function arrayCompare(a, b) {
+    if (a.length !== b.length) {
+        return false;
+    }
+    for (var i = 0; i &lt; a.length; ++i) {
+        if (!is(a[i], b[i])) {
+            return false;
+        }
+    }
+    return true;
+}
+
+function testPrimitiveValue(string, callback)
+{
+    debug(&quot;Testing: &quot; + string);
+    var value = eval(&quot;value = (&quot; + string + &quot;)&quot;);
+    test_data = value;
+    testValue(test_data, function(result) {
+        self.result = result;
+        shouldBeTrue(&quot;is(test_data, result)&quot;);
+        debug(&quot;&quot;);
+        callback();
+    });
+}
+
+function testObjectWithValue(string, callback)
+{
+    debug(&quot;Testing: &quot; + string);
+    var value = eval(&quot;value = (&quot; + string + &quot;)&quot;);
+    test_data = value;
+    testValue(test_data, function(result) {
+        self.result = result;
+        shouldBeEqualToString(&quot;typeof result&quot;, &quot;object&quot;);
+        shouldBe(&quot;Object.prototype.toString.call(result)&quot;, &quot;Object.prototype.toString.call(test_data)&quot;);
+        shouldBeTrue(&quot;test_data !== result&quot;);
+        shouldBe(&quot;result.toString()&quot;, &quot;test_data.toString()&quot;);
+        shouldBeTrue(&quot;is(test_data.valueOf(), result.valueOf())&quot;);
+        debug(&quot;&quot;);
+        callback();
+    });
+}
+
+function testUndefined(callback)
+{
+    testPrimitiveValue(&quot;undefined&quot;, callback);
+}
+
+function testNull(callback)
+{
+    testPrimitiveValue(&quot;null&quot;, callback);
+}
+
+function testBoolean(callback)
+{
+    debug(&quot;Testing boolean primitives&quot;);
+    debug(&quot;&quot;);
+    forEachWithCallback(testPrimitiveValue, [&quot;true&quot;, &quot;false&quot;], callback);
+}
+
+function testBooleanObject(callback)
+{
+    debug(&quot;Testing Boolean objects&quot;);
+    debug(&quot;&quot;);
+    forEachWithCallback(testObjectWithValue, [
+        &quot;new Boolean(true)&quot;,
+        &quot;new Boolean(false)&quot;
+    ], callback);
+}
+
+function testString(callback)
+{
+    debug(&quot;Testing string primitives&quot;);
+    debug(&quot;&quot;);
+    forEachWithCallback(testPrimitiveValue, [
+        &quot;''&quot;,
+        &quot;'this is a sample string'&quot;,
+        &quot;'null(\\0)'&quot;
+    ], callback);
+}
+
+function testStringObject(callback)
+{
+    debug(&quot;Testing String objects&quot;);
+    debug(&quot;&quot;);
+    forEachWithCallback(testObjectWithValue, [
+        &quot;new String()&quot;,
+        &quot;new String('this is a sample string')&quot;,
+        &quot;new String('null(\\0)')&quot;
+    ], callback);
+}
+
+function testNumber(callback)
+{
+    debug(&quot;Testing number primitives&quot;);
+    debug(&quot;&quot;);
+    forEachWithCallback(testPrimitiveValue, [
+        &quot;NaN&quot;,
+        &quot;-Infinity&quot;,
+        &quot;-Number.MAX_VALUE&quot;,
+        &quot;-0xffffffff&quot;,
+        &quot;-0x80000000&quot;,
+        &quot;-0x7fffffff&quot;,
+        &quot;-1&quot;,
+        &quot;-Number.MIN_VALUE&quot;,
+        &quot;-0&quot;,
+        &quot;0&quot;,
+        &quot;1&quot;,
+        &quot;Number.MIN_VALUE&quot;,
+        &quot;0x7fffffff&quot;,
+        &quot;0x80000000&quot;,
+        &quot;0xffffffff&quot;,
+        &quot;Number.MAX_VALUE&quot;,
+        &quot;Infinity&quot;
+    ], callback);
+}
+
+function testNumberObject(callback)
+{
+    debug(&quot;Testing Number objects&quot;);
+    debug(&quot;&quot;);
+    forEachWithCallback(testObjectWithValue, [
+        &quot;new Number(NaN)&quot;,
+        &quot;new Number(-Infinity)&quot;,
+        &quot;new Number(-Number.MAX_VALUE)&quot;,
+        &quot;new Number(-Number.MIN_VALUE)&quot;,
+        &quot;new Number(-0)&quot;,
+        &quot;new Number(0)&quot;,
+        &quot;new Number(Number.MIN_VALUE)&quot;,
+        &quot;new Number(Number.MAX_VALUE)&quot;,
+        &quot;new Number(Infinity)&quot;
+    ], callback);
+}
+
+function testDateObject(callback)
+{
+    debug(&quot;Testing Date objects&quot;);
+    debug(&quot;&quot;);
+    forEachWithCallback(testObjectWithValue, [
+        &quot;new Date(-1e13)&quot;,
+        &quot;new Date(-1e12)&quot;,
+        &quot;new Date(-1e9)&quot;,
+        &quot;new Date(-1e6)&quot;,
+        &quot;new Date(-1e3)&quot;,
+        &quot;new Date(0)&quot;,
+        &quot;new Date(1e3)&quot;,
+        &quot;new Date(1e6)&quot;,
+        &quot;new Date(1e9)&quot;,
+        &quot;new Date(1e12)&quot;,
+        &quot;new Date(1e13)&quot;
+    ], callback);
+}
+
+function testRegExpObject(callback)
+{
+    debug(&quot;Testing RegExp objects&quot;);
+    debug(&quot;&quot;);
+    function testRegExp(string, callback) {
+        debug(&quot;Testing RegExp: &quot; + string);
+        var value = eval(&quot;value = (&quot; + string + &quot;)&quot;);
+        test_data = value;
+        testValue(test_data, function(result) {
+            self.result = result;
+            shouldBeTrue(&quot;test_data !== result&quot;);
+            shouldBeEqualToString(&quot;Object.prototype.toString.call(result)&quot;, &quot;[object RegExp]&quot;);
+            shouldBe(&quot;result.toString()&quot;, &quot;test_data.toString()&quot;);
+            debug(&quot;&quot;);
+            callback();
+        });
+    }
+
+    forEachWithCallback(testRegExp, [
+        &quot;new RegExp()&quot;,
+        &quot;/abc/&quot;,
+        &quot;/abc/g&quot;,
+        &quot;/abc/i&quot;,
+        &quot;/abc/gi&quot;,
+        &quot;/abc/m&quot;,
+        &quot;/abc/mg&quot;,
+        &quot;/abc/mi&quot;,
+        &quot;/abc/mgi&quot;
+    ], callback);
+}
+
+function testImageData(callback)
+{
+    debug(&quot;Testing ImageData&quot;);
+    evalAndLog(&quot;canvas = document.createElement('canvas')&quot;);
+    evalAndLog(&quot;canvas.width = 8&quot;);
+    evalAndLog(&quot;canvas.height = 8&quot;);
+    evalAndLog(&quot;test_data = canvas.getContext('2d').getImageData(0, 0, 8, 8)&quot;);
+
+    for (var i = 0; i &lt; 256; ++i) {
+        test_data.data[i] = i;
+    }
+
+    testValue(test_data, function(result) {
+        self.result = result;
+        shouldBeTrue(&quot;test_data !== result&quot;);
+        shouldBeEqualToString(&quot;Object.prototype.toString.call(result)&quot;, &quot;[object ImageData]&quot;);
+        shouldBe(&quot;result.width&quot;, &quot;test_data.width&quot;);
+        shouldBe(&quot;result.height&quot;, &quot;test_data.height&quot;);
+        shouldBe(&quot;result.data.length&quot;, &quot;test_data.data.length&quot;);
+        if (arrayCompare(test_data.data, result.data)) {
+            testPassed(&quot;result data matches&quot;);
+        } else {
+            testFailed(&quot;result data doesn't match&quot;);
+        }
+        callback();
+    });
+}
+
+function readBlobAsText(blob, callback)
+{
+    var reader = new FileReader();
+    reader.onload = function(e) {
+        if (e.target.readyState === FileReader.DONE) {
+            callback(e.target.result);
+        }
+    };
+    reader.onerror = function(e) {
+        testFailed(&quot;Error reading blob as text: &quot; + e);
+        finishJSTest();
+    };
+    reader.readAsText(blob);
+}
+
+function checkBlobContents(blob, expected, callback)
+{
+    readBlobAsText(blob, function(text) {
+        self.text = text;
+        shouldBeEqualToString(&quot;text&quot;, expected);
+        callback();
+    });
+}
+
+function compareBlobs(blob1, blob2, callback)
+{
+    readBlobAsText(blob1, function(text1) {
+        readBlobAsText(blob2, function(text2) {
+            self.text1 = text1;
+            self.text2 = text2;
+            shouldBeEqualToString(&quot;text2&quot;, text1);
+            callback();
+        });
+    });
+}
+
+function testBlob(callback)
+{
+    debug(&quot;Testing Blob&quot;);
+
+    // FIXME: Blob, File, and FileList support is incomplete.
+    // http://crbug.com/108012
+    debug(&quot;Skipping test&quot;);
+    callback();
+    return;
+
+    shouldBeTrue(&quot;FileReader != null&quot;);
+    evalAndLog(&quot;test_content = 'This is a test. This is only a test.'&quot;);
+    evalAndLog(&quot;test_data = new Blob([test_content])&quot;);
+    testValue(test_data, function(result) {
+        self.result = result;
+        shouldBeTrue(&quot;test_data !== result&quot;);
+        shouldBeEqualToString(&quot;Object.prototype.toString.call(result)&quot;, &quot;[object Blob]&quot;);
+        shouldBe(&quot;result.size&quot;, &quot;test_data.size&quot;);
+        shouldBe(&quot;result.type&quot;, &quot;test_data.type&quot;);
+        checkBlobContents(result, test_content, callback);
+    });
+}
+
+function compareFiles(file1, file2, callback)
+{
+    self.file1 = file1;
+    self.file2 = file2;
+    shouldBeTrue(&quot;file1 !== file2&quot;);
+    shouldBeEqualToString(&quot;Object.prototype.toString.call(file1)&quot;, &quot;[object File]&quot;);
+    shouldBeEqualToString(&quot;Object.prototype.toString.call(file2)&quot;, &quot;[object File]&quot;);
+    debug(&quot;file1.size: &quot; + file1.size);
+    shouldBe(&quot;file1.size&quot;, &quot;file2.size&quot;);
+    debug(&quot;file1.type: &quot; + file1.type);
+    shouldBe(&quot;file1.type&quot;, &quot;file2.type&quot;);
+    debug(&quot;file1.name: &quot; + file1.name);
+    shouldBe(&quot;file1.name&quot;, &quot;file2.name&quot;);
+    shouldBe(&quot;String(file1.lastModifiedDate)&quot;, &quot;String(file2.lastModifiedDate)&quot;);
+    if (callback) {
+        compareBlobs(file1, file2, callback);
+    }
+}
+
+function testFile(callback)
+{
+    debug(&quot;Testing File&quot;);
+
+    // FIXME: Blob, File, and FileList support is incomplete.
+    // http://crbug.com/108012
+    debug(&quot;Skipping test&quot;);
+    callback();
+    return;
+
+    evalAndLog(&quot;test_content = fileInput.files[0]&quot;);
+
+    self.test_data = test_content;
+    testValue(test_data, function(result) {
+        self.result = result;
+        compareFiles(result, test_data, callback);
+    });
+}
+
+
+function testFileList(callback)
+{
+    debug(&quot;Testing FileList&quot;);
+
+    // FIXME: Blob, File, and FileList support is incomplete.
+    // http://crbug.com/108012
+    debug(&quot;Skipping test&quot;);
+    callback();
+    return;
+
+    evalAndLog(&quot;test_content = fileInput.files&quot;);
+
+    self.test_data = test_content;
+    testValue(test_data, function(result) {
+        self.result = result;
+        shouldBeTrue(&quot;test_data !== result&quot;);
+        shouldBeEqualToString(&quot;Object.prototype.toString.call(result)&quot;, &quot;[object FileList]&quot;);
+        shouldBe(&quot;result.length&quot;, &quot;test_data.length&quot;);
+        i = 0;
+        function doNext() {
+            if (i &gt;= test_data.length) {
+                callback();
+            } else {
+                debug(&quot;comparing file[&quot; + i + &quot;]&quot;);
+                compareFiles(result[i], test_data[i++], doNext);
+            }
+        }
+        doNext();
+    });
+}
+
+function testArray(callback) {
+    debug(&quot;Testing Array&quot;);
+    evalAndLog(&quot;test_data = []&quot;);
+    evalAndLog(&quot;test_data[0] = 'foo'&quot;);
+    evalAndLog(&quot;test_data[1] = 'bar'&quot;);
+    evalAndLog(&quot;test_data[10] = true&quot;);
+    evalAndLog(&quot;test_data[11] = false&quot;);
+    evalAndLog(&quot;test_data[20] = 123&quot;);
+    evalAndLog(&quot;test_data[21] = 456&quot;);
+    evalAndLog(&quot;test_data[30] = null&quot;);
+
+    testValue(test_data, function(result) {
+        self.result = result;
+        shouldBeTrue(&quot;test_data !== result&quot;);
+        shouldBeTrue(&quot;test_data.length === result.length&quot;);
+        Object.keys(test_data).forEach(
+            function(key) {
+                shouldBe(&quot;test_data[&quot; + key + &quot;]&quot;, &quot;result[&quot; + key + &quot;]&quot;);
+            });
+        callback();
+    });
+}
+
+function testObject(callback) {
+    debug(&quot;Testing Object&quot;);
+    evalAndLog(&quot;test_data = []&quot;);
+    evalAndLog(&quot;test_data[0] = 'foo'&quot;);
+    evalAndLog(&quot;test_data[1] = 'bar'&quot;);
+    evalAndLog(&quot;test_data['a'] = true&quot;);
+    evalAndLog(&quot;test_data['b'] = false&quot;);
+    evalAndLog(&quot;test_data['foo'] = 123&quot;);
+    evalAndLog(&quot;test_data['bar'] = 456&quot;);
+    evalAndLog(&quot;test_data[''] = null&quot;);
+
+    testValue(test_data, function(result) {
+        self.result = result;
+        shouldBeTrue(&quot;test_data !== result&quot;);
+        shouldBeTrue(&quot;arrayCompare(Object.keys(result).sort(), Object.keys(test_data).sort())&quot;);
+        Object.keys(test_data).forEach(
+            function(key) {
+                shouldBe(&quot;test_data[&quot; + JSON.stringify(key) + &quot;]&quot;, &quot;result[&quot; + JSON.stringify(key) + &quot;]&quot;);
+            });
+        callback();
+    });
+}
+
+function testTypedArray(callback) {
+    debug(&quot;Testing TypedArray&quot;);
+
+    function testTypedArrayValue(string, callback) {
+        evalAndLog(&quot;value = &quot; + string);
+        test_data = value;
+        testValue(test_data, function(result) {
+            self.result = result;
+            shouldBeTrue(&quot;test_data !== result&quot;);
+            shouldBe(&quot;Object.prototype.toString.call(result)&quot;, &quot;Object.prototype.toString.call(test_data)&quot;);
+            shouldBeTrue(&quot;test_data.length === result.length&quot;);
+            for (i = 0; i &lt; test_data.length; ++i) {
+                shouldBeTrue(&quot;is(test_data[&quot; + i + &quot;], result[&quot; + i + &quot;])&quot;);
+            }
+            debug(&quot;&quot;);
+            callback();
+        });
+    }
+
+    forEachWithCallback(testTypedArrayValue, [
+        &quot;new Uint8Array([])&quot;,
+        &quot;new Uint8Array([0, 1, 254, 255])&quot;,
+        &quot;new Uint16Array([0x0000, 0x0001, 0xFFFE, 0xFFFF])&quot;,
+        &quot;new Uint32Array([0x00000000, 0x00000001, 0xFFFFFFFE, 0xFFFFFFFF])&quot;,
+        &quot;new Int8Array([0, 1, 254, 255])&quot;,
+        &quot;new Int16Array([0x0000, 0x0001, 0xFFFE, 0xFFFF])&quot;,
+        &quot;new Int32Array([0x00000000, 0x00000001, 0xFFFFFFFE, 0xFFFFFFFF])&quot;,
+        &quot;new Uint8ClampedArray([0, 1, 254, 255])&quot;,
+        &quot;new Float32Array([-Infinity, -1.5, -1, -0.5, 0, 0.5, 1, 1.5, Infinity, NaN])&quot;,
+        &quot;new Float64Array([-Infinity, -Number.MAX_VALUE, -Number.MIN_VALUE, 0, Number.MIN_VALUE, Number.MAX_VALUE, Infinity, NaN])&quot;
+    ], callback);
+}
+
+function testBadTypes()
+{
+    debug(&quot;&quot;);
+    debug(&quot;Test types that can't be cloned:&quot;);
+    debug(&quot;&quot;);
+
+    evalAndLog(&quot;transaction = db.transaction('storeName', 'readwrite')&quot;);
+    evalAndLog(&quot;store = transaction.objectStore('storeName')&quot;);
+    transaction.onerror = unexpectedErrorCallback;
+    transaction.onabort = unexpectedAbortCallback;
+    transaction.oncomplete = finishJSTest;
+
+    debug(&quot;&quot;);
+    debug(&quot;Other JavaScript object types:&quot;);
+    evalAndExpectException(&quot;store.put(new Error, 'key')&quot;, &quot;DOMException.DATA_CLONE_ERR&quot;);
+    evalAndExpectException(&quot;store.put(new Function, 'key')&quot;, &quot;DOMException.DATA_CLONE_ERR&quot;);
+
+    debug(&quot;&quot;);
+    debug(&quot;Other host object types:&quot;);
+    evalAndExpectException(&quot;store.put(self, 'key')&quot;, &quot;DOMException.DATA_CLONE_ERR&quot;);
+    evalAndExpectException(&quot;store.put(document, 'key')&quot;, &quot;DOMException.DATA_CLONE_ERR&quot;);
+    evalAndExpectException(&quot;store.put(document.body, 'key')&quot;, &quot;DOMException.DATA_CLONE_ERR&quot;);
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcestransactioncompletewithjsrecursioncrossframejsfromrev195298trunkLayoutTestsstorageindexeddbtransactioncompletewithjsrecursioncrossframehtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/transaction-complete-with-js-recursion-cross-frame.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/transaction-complete-with-js-recursion-cross-frame.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/transaction-complete-with-js-recursion-cross-frame.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/transaction-complete-with-js-recursion-cross-frame.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+var transaction;
+var store;
+var db;
+var body = document.getElementsByTagName(&quot;iframe&quot;)[0].contentDocument.body;
+
+description(&quot;Test that pending transactions are not completed during recursive JS calls until all JS (in all frames) is finished.&quot;);
+
+indexedDBTest(prepareDatabase, click);
+function prepareDatabase()
+{
+    db = event.target.result;
+    store = db.createObjectStore('objectStore', null);
+}
+
+function click() {
+    body.onclick = test;
+    var pendingTransaction = evalAndLog(&quot;pendingTransaction = db.transaction(['objectStore'], 'readwrite')&quot;);
+    pendingTransaction.onerror = unexpectedErrorCallback;
+    pendingTransaction.onabort = unexpectedAbortCallback;
+    pendingTransaction.oncomplete = completeCallback;
+    var event = document.createEvent(&quot;MouseEvent&quot;);
+    event.initMouseEvent(&quot;click&quot;, true, true, document.defaultView, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
+    body.dispatchEvent(event);
+    var store = evalAndLog(&quot;store = pendingTransaction.objectStore('objectStore')&quot;);
+    shouldBeTrue(&quot;store !== undefined&quot;);
+    body.onclick = undefined;
+}
+
+function test()
+{
+    debug(&quot;Start re-entrant JS&quot;);
+    transaction = evalAndLog(&quot;transaction = db.transaction(['objectStore'], 'readwrite')&quot;);
+    debug(&quot;End re-entrant JS&quot;);
+}
+
+
+function completeCallback()
+{
+    debug(&quot;Pending transaction completed&quot;);
+    finishJSTest();
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcestransactioncompletewithjsrecursionjsfromrev195298trunkLayoutTestsstorageindexeddbtransactioncompletewithjsrecursionhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/transaction-complete-with-js-recursion.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/transaction-complete-with-js-recursion.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/transaction-complete-with-js-recursion.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/transaction-complete-with-js-recursion.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+var transaction;
+var store;
+var db;
+var body = document.getElementsByTagName(&quot;body&quot;)[0];
+
+description(&quot;Test that pending transactions are not completed during recursive JS calls until all JS is finished.&quot;);
+
+indexedDBTest(prepareDatabase, click);
+function prepareDatabase()
+{
+    db = event.target.result;
+    store = db.createObjectStore('objectStore', null);
+}
+
+function click()
+{
+    body.onclick = test;
+    var pendingTransaction = evalAndLog(&quot;pendingTransaction = db.transaction(['objectStore'], 'readwrite')&quot;);
+    pendingTransaction.onsuccess = unexpectedErrorCallback;
+    pendingTransaction.onerror = unexpectedErrorCallback;
+    pendingTransaction.oncomplete = completeCallback;
+    var event = document.createEvent(&quot;MouseEvent&quot;);
+    event.initMouseEvent(&quot;click&quot;, true, true, document.defaultView, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
+    body.dispatchEvent(event);
+    var store = evalAndLog(&quot;store = pendingTransaction.objectStore('objectStore')&quot;);
+    shouldBeTrue(&quot;store !== undefined&quot;);
+    body.onclick = undefined;
+}
+
+function test()
+{
+    debug(&quot;Start re-entrant JS&quot;);
+    transaction = evalAndLog(&quot;transaction = db.transaction(['objectStore'], 'readwrite')&quot;);
+    debug(&quot;End re-entrant JS&quot;);
+}
+
+
+function completeCallback()
+{
+    testPassed(&quot;Pending transaction completed&quot;);
+    finishJSTest();
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcestransactioncrashintasksjsfromrev195298trunkLayoutTestsstorageindexeddbtransactioncrashintaskshtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/transaction-crash-in-tasks.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/transaction-crash-in-tasks.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/transaction-crash-in-tasks.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/transaction-crash-in-tasks.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;Regression test for http://webkit.org/b/102283&quot;);
+
+test();
+function test() {
+    removeVendorPrefixes();
+    setDBNameFromPath();
+
+    evalAndLog(&quot;indexedDB.open(dbname, 2)&quot;);
+    evalAndLog(&quot;indexedDB.open(dbname, 3)&quot;);
+
+    finishJSTest();
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcestransactionorderingjsfromrev195298trunkLayoutTestsstorageindexeddbtransactionorderinghtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/transaction-ordering.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/transaction-ordering.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/transaction-ordering.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/transaction-ordering.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;Verify Indexed DB transactions are ordered per spec&quot;);
+
+indexedDBTest(prepareDatabase, onOpen);
+
+function prepareDatabase(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
+}
+
+function onOpen(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+    debug(&quot;&quot;);
+    debug(&quot;Create in order tx1, tx2&quot;);
+    evalAndLog(&quot;tx1 = db.transaction('store', 'readwrite')&quot;);
+    evalAndLog(&quot;tx2 = db.transaction('store', 'readwrite')&quot;);
+    debug(&quot;&quot;);
+    debug(&quot;Use in order tx2, tx1&quot;);
+    evalAndLog(&quot;tx2.objectStore('store').get(0)&quot;);
+    evalAndLog(&quot;tx1.objectStore('store').get(0)&quot;);
+    debug(&quot;&quot;);
+    evalAndLog(&quot;order = []&quot;);
+
+    tx1.oncomplete = function(evt) {
+        debug(&quot;tx1 complete&quot;);
+        order.push(1);
+        if (order.length === 2) done();
+    };
+
+    tx2.oncomplete = function(evt) {
+        debug(&quot;tx1 complete&quot;);
+        order.push(2);
+        if (order.length === 2) done();
+    };
+
+    function done() {
+        preamble();
+        // IndexedDB Spec:
+        // https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#transaction-concept
+        //
+        // If multiple &quot;readwrite&quot; transactions are attempting to
+        // access the same object store (i.e. if they have overlapping
+        // scope), the transaction that was created first must be the
+        // transaction which gets access to the object store first.
+        //
+        shouldBeTrue(&quot;areArraysEqual(order, [ 1, 2 ])&quot;);
+        finishJSTest();
+    }
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcestransactionoverlappingjsfromrev195298trunkLayoutTestsstorageindexeddbtransactionoverlappinghtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/transaction-overlapping.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/transaction-overlapping.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/transaction-overlapping.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/transaction-overlapping.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,75 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;Check that transactions that may overlap complete properly.&quot;);
+
+indexedDBTest(prepareDatabase, runParallelTransactions);
+
+function prepareDatabase(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
+    evalAndLog(&quot;store.put('value', 'key')&quot;);
+}
+
+function runParallelTransactions(evt)
+{
+    preamble(evt);
+    evalAndLog(&quot;db = event.target.result&quot;);
+    debug(&quot;&quot;);
+    evalAndLog(&quot;transaction1 = db.transaction('store', 'readonly')&quot;);
+    transaction1.onabort = unexpectedAbortCallback;
+    transaction1.oncomplete = onTransactionComplete;
+    evalAndLog(&quot;transaction2 = db.transaction('store', 'readonly')&quot;);
+    transaction1.onabort = unexpectedAbortCallback;
+    transaction2.oncomplete = onTransactionComplete;
+
+    evalAndLog(&quot;transaction1GetSuccess = 0&quot;);
+    evalAndLog(&quot;transaction2GetSuccess = 0&quot;);
+
+    function doTransaction1Get() {
+        // NOTE: No logging since execution order is not deterministic.
+        request = transaction1.objectStore('store').get('key');
+        request.onerror = unexpectedErrorCallback;
+        request.onsuccess = function() {
+            ++transaction1GetSuccess;
+            if (!transaction2GetSuccess &amp;&amp; transaction1GetSuccess &lt; 10)
+                doTransaction1Get();
+        };
+    }
+
+    function doTransaction2Get() {
+        // NOTE: No logging since execution order is not deterministic.
+        request = transaction2.objectStore('store').get('key');
+        request.onerror = unexpectedErrorCallback;
+        request.onsuccess = function() {
+            ++transaction2GetSuccess;
+            if (!transaction1GetSuccess &amp;&amp; transaction2GetSuccess &lt; 10)
+                doTransaction2Get();
+        };
+    }
+
+    doTransaction1Get();
+    doTransaction2Get();
+}
+
+transactionCompletionCount = 0;
+function onTransactionComplete(evt)
+{
+    preamble(evt);
+
+    ++transactionCompletionCount;
+    if (transactionCompletionCount &lt; 2) {
+        debug(&quot;first transaction complete, still waiting...&quot;);
+        return;
+    }
+
+    shouldBeNonZero(&quot;transaction1GetSuccess&quot;);
+    shouldBeNonZero(&quot;transaction2GetSuccess&quot;);
+
+    evalAndLog(&quot;db.close()&quot;);
+    finishJSTest();
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcesversionchangeeventbasicjsfromrev195298trunkLayoutTestsstorageindexeddbversionchangeeventbasichtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/version-change-event-basic.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/version-change-event-basic.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/version-change-event-basic.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/version-change-event-basic.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+
+function log(msg) {
+    document.getElementById(&quot;logger&quot;).innerHTML += msg + &quot;&lt;br&gt;&quot;;
+}
+
+var request1 = indexedDB.open(&quot;vceb1&quot;);
+request1.onupgradeneeded = function(e) {
+    log(&quot;First request: &quot; + e.oldVersion + &quot; &quot; + e.newVersion);
+}
+
+var request2 = indexedDB.open(&quot;vceb2&quot;, 1);
+request2.onupgradeneeded = function(e) {
+    log(&quot;Second request: &quot; + e.oldVersion + &quot; &quot; + e.newVersion);
+}
+
+var request3 = indexedDB.open(&quot;vceb3&quot;, 2);
+request3.onupgradeneeded = function(e) {
+    log(&quot;Third request: &quot; + e.oldVersion + &quot; &quot; + e.newVersion);
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+try {
+    var request = indexedDB.open(&quot;vceb4&quot;, 0);
+} catch (e) {
+    log(&quot;0 version: &quot; + e);
+}
+
+try {
+    var request = indexedDB.open(&quot;vceb5&quot;, -1);
+} catch (e) {
+    log(&quot;Negative version: &quot; + e);
+}
+
+try {
+    var request = indexedDB.open(&quot;vceb6&quot;, &quot;string&quot;);
+} catch (e) {
+    log(&quot;String version: &quot; + e);
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbresourcesversionchangeeventjsfromrev195298trunkLayoutTestsstorageindexeddbversionchangeeventhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/storage/indexeddb/resources/version-change-event.js (from rev 195298, trunk/LayoutTests/storage/indexeddb/version-change-event.html) (0 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/resources/version-change-event.js                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/resources/version-change-event.js        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+if (this.importScripts) {
+    importScripts('../../../resources/js-test.js');
+    importScripts('shared.js');
+}
+
+description(&quot;Regression test for WK136583 - ensure the versionchange event has the proper name&quot;);
+
+indexedDBTest(prepareDatabase, upgradeDatabase);
+function prepareDatabase(evt)
+{
+    db = event.target.result;
+    evalAndLog(&quot;db.onversionchange = onVersionChange&quot;);
+    evalAndLog(&quot;store = db.createObjectStore('store1')&quot;);
+}
+
+function upgradeDatabase(evt)
+{
+    db = evt.target.result;
+    shouldBe(&quot;db.version&quot;, &quot;1&quot;);
+    evalAndLog(&quot;request = indexedDB.open(dbname, 2)&quot;);
+    evalAndLog(&quot;db.onversionchange = onVersionChange&quot;);
+    request.onerror = unexpectedErrorCallback;
+    request.onsuccess = finishTest;
+}
+
+function onVersionChange(evt)
+{
+    preamble(evt);
+    shouldBeEqualToString(&quot;event.type&quot;, &quot;versionchange&quot;);
+    db.close();
+}
+
+function finishTest(evt)
+{
+    finishJSTest();
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbstructuredclonehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/structured-clone.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/structured-clone.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/structured-clone.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -5,550 +5,6 @@
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><span class="cx"> &lt;input type=&quot;file&quot; id=&quot;fileInput&quot; multiple&gt;&lt;/input&gt;
</span><del>-&lt;script&gt;
-
-description(&quot;Test structured clone permutations in IndexedDB. File/FileList tests require DumpRenderTree.&quot;);
-
-if (self.eventSender) {
-    var fileInput = document.getElementById(&quot;fileInput&quot;);
-    var fileRect = fileInput.getClientRects()[0];
-    var targetX = fileRect.left + fileRect.width / 2;
-    var targetY = fileRect.top + fileRect.height / 2;
-    eventSender.beginDragWithFiles(['resources/test-data.html', 'resources/test-data.txt']);
-    eventSender.mouseMoveTo(targetX, targetY);
-    eventSender.mouseUp();
-}
-
-indexedDBTest(prepareDatabase, startTests);
-function prepareDatabase()
-{
-    db = event.target.result;
-    evalAndLog(&quot;store = db.createObjectStore('storeName')&quot;);
-    debug(&quot;This index is not used, but evaluating key path on each put() call will exercise (de)serialization:&quot;);
-    evalAndLog(&quot;store.createIndex('indexName', 'dummyKeyPath')&quot;);
-}
-
-function startTests()
-{
-    debug(&quot;&quot;);
-    debug(&quot;Running tests...&quot;);
-    var tests_to_run = [
-        testUndefined,
-        testNull,
-        testBoolean,
-        testNumber,
-        testString,
-        testBooleanObject,
-        testNumberObject,
-        testStringObject,
-        testDateObject,
-        testRegExpObject,
-        testImageData,
-        testBlob,
-        testFile,
-        testFileList,
-        testArray,
-        testObject,
-        testTypedArray
-    ];
-
-    function nextTest() {
-        debug(&quot;&quot;);
-        if (tests_to_run.length) {
-            var test = tests_to_run.shift();
-            test(nextTest); // When done, call this again.
-        } else {
-            testBadTypes();
-        }
-    }
-    nextTest();
-}
-
-function forEachWithCallback(testFunction, values, callback)
-{
-    function nextValue() {
-        if (values.length) {
-            testFunction(values.shift(), nextValue);
-        } else {
-            callback();
-        }
-    }
-
-    nextValue();
-}
-
-function testValue(value, callback)
-{
-    // One transaction per test, since some tests require asynchronous
-    // operations to verify the result (e.g. via FileReader)
-    evalAndLog(&quot;transaction = db.transaction('storeName', 'readwrite')&quot;);
-    transaction.onerror = unexpectedErrorCallback;
-    transaction.onabort = unexpectedAbortCallback;
-    evalAndLog(&quot;store = transaction.objectStore('storeName')&quot;);
-
-    self.value = value;
-    request = evalAndLog(&quot;store.put(value, 'key')&quot;);
-    request.onerror = unexpectedErrorCallback;
-    request.onsuccess = function(e) {
-        request = evalAndLog(&quot;store.get('key')&quot;);
-        request.onerror = unexpectedErrorCallback;
-        request.onsuccess = function(e) {
-            callback(request.result);
-        };
-    };
-}
-
-// Identity testing, sensitive to NaN and -0
-function is(x, y) {
-    if (x === y) {
-        return x !== 0 || 1 / x === 1 / y;
-    }
-    return x !== x &amp;&amp; y !== y;
-}
-
-function arrayCompare(a, b) {
-    if (a.length !== b.length) {
-        return false;
-    }
-    for (var i = 0; i &lt; a.length; ++i) {
-        if (!is(a[i], b[i])) {
-            return false;
-        }
-    }
-    return true;
-}
-
-function testPrimitiveValue(string, callback)
-{
-    debug(&quot;Testing: &quot; + string);
-    var value = eval(&quot;value = (&quot; + string + &quot;)&quot;);
-    test_data = value;
-    testValue(test_data, function(result) {
-        self.result = result;
-        shouldBeTrue(&quot;is(test_data, result)&quot;);
-        debug(&quot;&quot;);
-        callback();
-    });
-}
-
-function testObjectWithValue(string, callback)
-{
-    debug(&quot;Testing: &quot; + string);
-    var value = eval(&quot;value = (&quot; + string + &quot;)&quot;);
-    test_data = value;
-    testValue(test_data, function(result) {
-        self.result = result;
-        shouldBeEqualToString(&quot;typeof result&quot;, &quot;object&quot;);
-        shouldBe(&quot;Object.prototype.toString.call(result)&quot;, &quot;Object.prototype.toString.call(test_data)&quot;);
-        shouldBeTrue(&quot;test_data !== result&quot;);
-        shouldBe(&quot;result.toString()&quot;, &quot;test_data.toString()&quot;);
-        shouldBeTrue(&quot;is(test_data.valueOf(), result.valueOf())&quot;);
-        debug(&quot;&quot;);
-        callback();
-    });
-}
-
-function testUndefined(callback)
-{
-    testPrimitiveValue(&quot;undefined&quot;, callback);
-}
-
-function testNull(callback)
-{
-    testPrimitiveValue(&quot;null&quot;, callback);
-}
-
-function testBoolean(callback)
-{
-    debug(&quot;Testing boolean primitives&quot;);
-    debug(&quot;&quot;);
-    forEachWithCallback(testPrimitiveValue, [&quot;true&quot;, &quot;false&quot;], callback);
-}
-
-function testBooleanObject(callback)
-{
-    debug(&quot;Testing Boolean objects&quot;);
-    debug(&quot;&quot;);
-    forEachWithCallback(testObjectWithValue, [
-        &quot;new Boolean(true)&quot;,
-        &quot;new Boolean(false)&quot;
-    ], callback);
-}
-
-function testString(callback)
-{
-    debug(&quot;Testing string primitives&quot;);
-    debug(&quot;&quot;);
-    forEachWithCallback(testPrimitiveValue, [
-        &quot;''&quot;,
-        &quot;'this is a sample string'&quot;,
-        &quot;'null(\\0)'&quot;
-    ], callback);
-}
-
-function testStringObject(callback)
-{
-    debug(&quot;Testing String objects&quot;);
-    debug(&quot;&quot;);
-    forEachWithCallback(testObjectWithValue, [
-        &quot;new String()&quot;,
-        &quot;new String('this is a sample string')&quot;,
-        &quot;new String('null(\\0)')&quot;
-    ], callback);
-}
-
-function testNumber(callback)
-{
-    debug(&quot;Testing number primitives&quot;);
-    debug(&quot;&quot;);
-    forEachWithCallback(testPrimitiveValue, [
-        &quot;NaN&quot;,
-        &quot;-Infinity&quot;,
-        &quot;-Number.MAX_VALUE&quot;,
-        &quot;-0xffffffff&quot;,
-        &quot;-0x80000000&quot;,
-        &quot;-0x7fffffff&quot;,
-        &quot;-1&quot;,
-        &quot;-Number.MIN_VALUE&quot;,
-        &quot;-0&quot;,
-        &quot;0&quot;,
-        &quot;1&quot;,
-        &quot;Number.MIN_VALUE&quot;,
-        &quot;0x7fffffff&quot;,
-        &quot;0x80000000&quot;,
-        &quot;0xffffffff&quot;,
-        &quot;Number.MAX_VALUE&quot;,
-        &quot;Infinity&quot;
-    ], callback);
-}
-
-function testNumberObject(callback)
-{
-    debug(&quot;Testing Number objects&quot;);
-    debug(&quot;&quot;);
-    forEachWithCallback(testObjectWithValue, [
-        &quot;new Number(NaN)&quot;,
-        &quot;new Number(-Infinity)&quot;,
-        &quot;new Number(-Number.MAX_VALUE)&quot;,
-        &quot;new Number(-Number.MIN_VALUE)&quot;,
-        &quot;new Number(-0)&quot;,
-        &quot;new Number(0)&quot;,
-        &quot;new Number(Number.MIN_VALUE)&quot;,
-        &quot;new Number(Number.MAX_VALUE)&quot;,
-        &quot;new Number(Infinity)&quot;
-    ], callback);
-}
-
-function testDateObject(callback)
-{
-    debug(&quot;Testing Date objects&quot;);
-    debug(&quot;&quot;);
-    forEachWithCallback(testObjectWithValue, [
-        &quot;new Date(-1e13)&quot;,
-        &quot;new Date(-1e12)&quot;,
-        &quot;new Date(-1e9)&quot;,
-        &quot;new Date(-1e6)&quot;,
-        &quot;new Date(-1e3)&quot;,
-        &quot;new Date(0)&quot;,
-        &quot;new Date(1e3)&quot;,
-        &quot;new Date(1e6)&quot;,
-        &quot;new Date(1e9)&quot;,
-        &quot;new Date(1e12)&quot;,
-        &quot;new Date(1e13)&quot;
-    ], callback);
-}
-
-function testRegExpObject(callback)
-{
-    debug(&quot;Testing RegExp objects&quot;);
-    debug(&quot;&quot;);
-    function testRegExp(string, callback) {
-        debug(&quot;Testing RegExp: &quot; + string);
-        var value = eval(&quot;value = (&quot; + string + &quot;)&quot;);
-        test_data = value;
-        testValue(test_data, function(result) {
-            self.result = result;
-            shouldBeTrue(&quot;test_data !== result&quot;);
-            shouldBeEqualToString(&quot;Object.prototype.toString.call(result)&quot;, &quot;[object RegExp]&quot;);
-            shouldBe(&quot;result.toString()&quot;, &quot;test_data.toString()&quot;);
-            debug(&quot;&quot;);
-            callback();
-        });
-    }
-
-    forEachWithCallback(testRegExp, [
-        &quot;new RegExp()&quot;,
-        &quot;/abc/&quot;,
-        &quot;/abc/g&quot;,
-        &quot;/abc/i&quot;,
-        &quot;/abc/gi&quot;,
-        &quot;/abc/m&quot;,
-        &quot;/abc/mg&quot;,
-        &quot;/abc/mi&quot;,
-        &quot;/abc/mgi&quot;
-    ], callback);
-}
-
-function testImageData(callback)
-{
-    debug(&quot;Testing ImageData&quot;);
-    evalAndLog(&quot;canvas = document.createElement('canvas')&quot;);
-    evalAndLog(&quot;canvas.width = 8&quot;);
-    evalAndLog(&quot;canvas.height = 8&quot;);
-    evalAndLog(&quot;test_data = canvas.getContext('2d').getImageData(0, 0, 8, 8)&quot;);
-
-    for (var i = 0; i &lt; 256; ++i) {
-        test_data.data[i] = i;
-    }
-
-    testValue(test_data, function(result) {
-        self.result = result;
-        shouldBeTrue(&quot;test_data !== result&quot;);
-        shouldBeEqualToString(&quot;Object.prototype.toString.call(result)&quot;, &quot;[object ImageData]&quot;);
-        shouldBe(&quot;result.width&quot;, &quot;test_data.width&quot;);
-        shouldBe(&quot;result.height&quot;, &quot;test_data.height&quot;);
-        shouldBe(&quot;result.data.length&quot;, &quot;test_data.data.length&quot;);
-        if (arrayCompare(test_data.data, result.data)) {
-            testPassed(&quot;result data matches&quot;);
-        } else {
-            testFailed(&quot;result data doesn't match&quot;);
-        }
-        callback();
-    });
-}
-
-function readBlobAsText(blob, callback)
-{
-    var reader = new FileReader();
-    reader.onload = function(e) {
-        if (e.target.readyState === FileReader.DONE) {
-            callback(e.target.result);
-        }
-    };
-    reader.onerror = function(e) {
-        testFailed(&quot;Error reading blob as text: &quot; + e);
-        finishJSTest();
-    };
-    reader.readAsText(blob);
-}
-
-function checkBlobContents(blob, expected, callback)
-{
-    readBlobAsText(blob, function(text) {
-        self.text = text;
-        shouldBeEqualToString(&quot;text&quot;, expected);
-        callback();
-    });
-}
-
-function compareBlobs(blob1, blob2, callback)
-{
-    readBlobAsText(blob1, function(text1) {
-        readBlobAsText(blob2, function(text2) {
-            self.text1 = text1;
-            self.text2 = text2;
-            shouldBeEqualToString(&quot;text2&quot;, text1);
-            callback();
-        });
-    });
-}
-
-function testBlob(callback)
-{
-    debug(&quot;Testing Blob&quot;);
-
-    // FIXME: Blob, File, and FileList support is incomplete.
-    // http://crbug.com/108012
-    debug(&quot;Skipping test&quot;);
-    callback();
-    return;
-
-    shouldBeTrue(&quot;FileReader != null&quot;);
-    evalAndLog(&quot;test_content = 'This is a test. This is only a test.'&quot;);
-    evalAndLog(&quot;test_data = new Blob([test_content])&quot;);
-    testValue(test_data, function(result) {
-        self.result = result;
-        shouldBeTrue(&quot;test_data !== result&quot;);
-        shouldBeEqualToString(&quot;Object.prototype.toString.call(result)&quot;, &quot;[object Blob]&quot;);
-        shouldBe(&quot;result.size&quot;, &quot;test_data.size&quot;);
-        shouldBe(&quot;result.type&quot;, &quot;test_data.type&quot;);
-        checkBlobContents(result, test_content, callback);
-    });
-}
-
-function compareFiles(file1, file2, callback)
-{
-    self.file1 = file1;
-    self.file2 = file2;
-    shouldBeTrue(&quot;file1 !== file2&quot;);
-    shouldBeEqualToString(&quot;Object.prototype.toString.call(file1)&quot;, &quot;[object File]&quot;);
-    shouldBeEqualToString(&quot;Object.prototype.toString.call(file2)&quot;, &quot;[object File]&quot;);
-    debug(&quot;file1.size: &quot; + file1.size);
-    shouldBe(&quot;file1.size&quot;, &quot;file2.size&quot;);
-    debug(&quot;file1.type: &quot; + file1.type);
-    shouldBe(&quot;file1.type&quot;, &quot;file2.type&quot;);
-    debug(&quot;file1.name: &quot; + file1.name);
-    shouldBe(&quot;file1.name&quot;, &quot;file2.name&quot;);
-    shouldBe(&quot;String(file1.lastModifiedDate)&quot;, &quot;String(file2.lastModifiedDate)&quot;);
-    if (callback) {
-        compareBlobs(file1, file2, callback);
-    }
-}
-
-function testFile(callback)
-{
-    debug(&quot;Testing File&quot;);
-
-    // FIXME: Blob, File, and FileList support is incomplete.
-    // http://crbug.com/108012
-    debug(&quot;Skipping test&quot;);
-    callback();
-    return;
-
-    evalAndLog(&quot;test_content = fileInput.files[0]&quot;);
-
-    self.test_data = test_content;
-    testValue(test_data, function(result) {
-        self.result = result;
-        compareFiles(result, test_data, callback);
-    });
-}
-
-
-function testFileList(callback)
-{
-    debug(&quot;Testing FileList&quot;);
-
-    // FIXME: Blob, File, and FileList support is incomplete.
-    // http://crbug.com/108012
-    debug(&quot;Skipping test&quot;);
-    callback();
-    return;
-
-    evalAndLog(&quot;test_content = fileInput.files&quot;);
-
-    self.test_data = test_content;
-    testValue(test_data, function(result) {
-        self.result = result;
-        shouldBeTrue(&quot;test_data !== result&quot;);
-        shouldBeEqualToString(&quot;Object.prototype.toString.call(result)&quot;, &quot;[object FileList]&quot;);
-        shouldBe(&quot;result.length&quot;, &quot;test_data.length&quot;);
-        i = 0;
-        function doNext() {
-            if (i &gt;= test_data.length) {
-                callback();
-            } else {
-                debug(&quot;comparing file[&quot; + i + &quot;]&quot;);
-                compareFiles(result[i], test_data[i++], doNext);
-            }
-        }
-        doNext();
-    });
-}
-
-function testArray(callback) {
-    debug(&quot;Testing Array&quot;);
-    evalAndLog(&quot;test_data = []&quot;);
-    evalAndLog(&quot;test_data[0] = 'foo'&quot;);
-    evalAndLog(&quot;test_data[1] = 'bar'&quot;);
-    evalAndLog(&quot;test_data[10] = true&quot;);
-    evalAndLog(&quot;test_data[11] = false&quot;);
-    evalAndLog(&quot;test_data[20] = 123&quot;);
-    evalAndLog(&quot;test_data[21] = 456&quot;);
-    evalAndLog(&quot;test_data[30] = null&quot;);
-
-    testValue(test_data, function(result) {
-        self.result = result;
-        shouldBeTrue(&quot;test_data !== result&quot;);
-        shouldBeTrue(&quot;test_data.length === result.length&quot;);
-        Object.keys(test_data).forEach(
-            function(key) {
-                shouldBe(&quot;test_data[&quot; + key + &quot;]&quot;, &quot;result[&quot; + key + &quot;]&quot;);
-            });
-        callback();
-    });
-}
-
-function testObject(callback) {
-    debug(&quot;Testing Object&quot;);
-    evalAndLog(&quot;test_data = []&quot;);
-    evalAndLog(&quot;test_data[0] = 'foo'&quot;);
-    evalAndLog(&quot;test_data[1] = 'bar'&quot;);
-    evalAndLog(&quot;test_data['a'] = true&quot;);
-    evalAndLog(&quot;test_data['b'] = false&quot;);
-    evalAndLog(&quot;test_data['foo'] = 123&quot;);
-    evalAndLog(&quot;test_data['bar'] = 456&quot;);
-    evalAndLog(&quot;test_data[''] = null&quot;);
-
-    testValue(test_data, function(result) {
-        self.result = result;
-        shouldBeTrue(&quot;test_data !== result&quot;);
-        shouldBeTrue(&quot;arrayCompare(Object.keys(result).sort(), Object.keys(test_data).sort())&quot;);
-        Object.keys(test_data).forEach(
-            function(key) {
-                shouldBe(&quot;test_data[&quot; + JSON.stringify(key) + &quot;]&quot;, &quot;result[&quot; + JSON.stringify(key) + &quot;]&quot;);
-            });
-        callback();
-    });
-}
-
-function testTypedArray(callback) {
-    debug(&quot;Testing TypedArray&quot;);
-
-    function testTypedArrayValue(string, callback) {
-        evalAndLog(&quot;value = &quot; + string);
-        test_data = value;
-        testValue(test_data, function(result) {
-            self.result = result;
-            shouldBeTrue(&quot;test_data !== result&quot;);
-            shouldBe(&quot;Object.prototype.toString.call(result)&quot;, &quot;Object.prototype.toString.call(test_data)&quot;);
-            shouldBeTrue(&quot;test_data.length === result.length&quot;);
-            for (i = 0; i &lt; test_data.length; ++i) {
-                shouldBeTrue(&quot;is(test_data[&quot; + i + &quot;], result[&quot; + i + &quot;])&quot;);
-            }
-            debug(&quot;&quot;);
-            callback();
-        });
-    }
-
-    forEachWithCallback(testTypedArrayValue, [
-        &quot;new Uint8Array([])&quot;,
-        &quot;new Uint8Array([0, 1, 254, 255])&quot;,
-        &quot;new Uint16Array([0x0000, 0x0001, 0xFFFE, 0xFFFF])&quot;,
-        &quot;new Uint32Array([0x00000000, 0x00000001, 0xFFFFFFFE, 0xFFFFFFFF])&quot;,
-        &quot;new Int8Array([0, 1, 254, 255])&quot;,
-        &quot;new Int16Array([0x0000, 0x0001, 0xFFFE, 0xFFFF])&quot;,
-        &quot;new Int32Array([0x00000000, 0x00000001, 0xFFFFFFFE, 0xFFFFFFFF])&quot;,
-        &quot;new Uint8ClampedArray([0, 1, 254, 255])&quot;,
-        &quot;new Float32Array([-Infinity, -1.5, -1, -0.5, 0, 0.5, 1, 1.5, Infinity, NaN])&quot;,
-        &quot;new Float64Array([-Infinity, -Number.MAX_VALUE, -Number.MIN_VALUE, 0, Number.MIN_VALUE, Number.MAX_VALUE, Infinity, NaN])&quot;
-    ], callback);
-}
-
-function testBadTypes()
-{
-    debug(&quot;&quot;);
-    debug(&quot;Test types that can't be cloned:&quot;);
-    debug(&quot;&quot;);
-
-    evalAndLog(&quot;transaction = db.transaction('storeName', 'readwrite')&quot;);
-    evalAndLog(&quot;store = transaction.objectStore('storeName')&quot;);
-    transaction.onerror = unexpectedErrorCallback;
-    transaction.onabort = unexpectedAbortCallback;
-    transaction.oncomplete = finishJSTest;
-
-    debug(&quot;&quot;);
-    debug(&quot;Other JavaScript object types:&quot;);
-    evalAndExpectException(&quot;store.put(new Error, 'key')&quot;, &quot;DOMException.DATA_CLONE_ERR&quot;);
-    evalAndExpectException(&quot;store.put(new Function, 'key')&quot;, &quot;DOMException.DATA_CLONE_ERR&quot;);
-
-    debug(&quot;&quot;);
-    debug(&quot;Other host object types:&quot;);
-    evalAndExpectException(&quot;store.put(self, 'key')&quot;, &quot;DOMException.DATA_CLONE_ERR&quot;);
-    evalAndExpectException(&quot;store.put(document, 'key')&quot;, &quot;DOMException.DATA_CLONE_ERR&quot;);
-    evalAndExpectException(&quot;store.put(document.body, 'key')&quot;, &quot;DOMException.DATA_CLONE_ERR&quot;);
-}
-
-&lt;/script&gt;
</del><ins>+&lt;script src=&quot;resources/structured-clone.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbtransactioncompletewithjsrecursioncrossframehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/transaction-complete-with-js-recursion-cross-frame.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/transaction-complete-with-js-recursion-cross-frame.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/transaction-complete-with-js-recursion-cross-frame.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -8,50 +8,6 @@
</span><span class="cx">     &lt;body&gt;
</span><span class="cx">     &lt;/body&gt;
</span><span class="cx"> &lt;/iframe&gt;
</span><del>-&lt;script&gt;
-
-var transaction;
-var store;
-var db;
-var body = document.getElementsByTagName(&quot;iframe&quot;)[0].contentDocument.body;
-
-description(&quot;Test that pending transactions are not completed during recursive JS calls until all JS (in all frames) is finished.&quot;);
-
-indexedDBTest(prepareDatabase, click);
-function prepareDatabase()
-{
-    db = event.target.result;
-    store = db.createObjectStore('objectStore', null);
-}
-
-function click() {
-    body.onclick = test;
-    var pendingTransaction = evalAndLog(&quot;pendingTransaction = db.transaction(['objectStore'], 'readwrite')&quot;);
-    pendingTransaction.onerror = unexpectedErrorCallback;
-    pendingTransaction.onabort = unexpectedAbortCallback;
-    pendingTransaction.oncomplete = completeCallback;
-    var event = document.createEvent(&quot;MouseEvent&quot;);
-    event.initMouseEvent(&quot;click&quot;, true, true, document.defaultView, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
-    body.dispatchEvent(event);
-    var store = evalAndLog(&quot;store = pendingTransaction.objectStore('objectStore')&quot;);
-    shouldBeTrue(&quot;store !== undefined&quot;);
-    body.onclick = undefined;
-}
-
-function test()
-{
-    debug(&quot;Start re-entrant JS&quot;);
-    transaction = evalAndLog(&quot;transaction = db.transaction(['objectStore'], 'readwrite')&quot;);
-    debug(&quot;End re-entrant JS&quot;);
-}
-
-
-function completeCallback()
-{
-    debug(&quot;Pending transaction completed&quot;);
-    finishJSTest();
-}
-
-&lt;/script&gt;
</del><ins>+&lt;script src=&quot;resources/transaction-complete-with-js-recursion-cross-frame.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbtransactioncompletewithjsrecursionhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/transaction-complete-with-js-recursion.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/transaction-complete-with-js-recursion.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/transaction-complete-with-js-recursion.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -4,51 +4,6 @@
</span><span class="cx"> &lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><del>-&lt;script&gt;
-
-var transaction;
-var store;
-var db;
-var body = document.getElementsByTagName(&quot;body&quot;)[0];
-
-description(&quot;Test that pending transactions are not completed during recursive JS calls until all JS is finished.&quot;);
-
-indexedDBTest(prepareDatabase, click);
-function prepareDatabase()
-{
-    db = event.target.result;
-    store = db.createObjectStore('objectStore', null);
-}
-
-function click()
-{
-    body.onclick = test;
-    var pendingTransaction = evalAndLog(&quot;pendingTransaction = db.transaction(['objectStore'], 'readwrite')&quot;);
-    pendingTransaction.onsuccess = unexpectedErrorCallback;
-    pendingTransaction.onerror = unexpectedErrorCallback;
-    pendingTransaction.oncomplete = completeCallback;
-    var event = document.createEvent(&quot;MouseEvent&quot;);
-    event.initMouseEvent(&quot;click&quot;, true, true, document.defaultView, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
-    body.dispatchEvent(event);
-    var store = evalAndLog(&quot;store = pendingTransaction.objectStore('objectStore')&quot;);
-    shouldBeTrue(&quot;store !== undefined&quot;);
-    body.onclick = undefined;
-}
-
-function test()
-{
-    debug(&quot;Start re-entrant JS&quot;);
-    transaction = evalAndLog(&quot;transaction = db.transaction(['objectStore'], 'readwrite')&quot;);
-    debug(&quot;End re-entrant JS&quot;);
-}
-
-
-function completeCallback()
-{
-    testPassed(&quot;Pending transaction completed&quot;);
-    finishJSTest();
-}
-
-&lt;/script&gt;
</del><ins>+&lt;script src=&quot;resources/transaction-complete-with-js-recursion.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbtransactioncrashintaskshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/transaction-crash-in-tasks.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/transaction-crash-in-tasks.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/transaction-crash-in-tasks.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,18 +1,9 @@
</span><del>-&lt;!DOCTYPE html&gt;
</del><ins>+&lt;html&gt;
+&lt;head&gt;
</ins><span class="cx"> &lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
</span><del>-&lt;script&gt;
-
-description(&quot;Regression test for http://webkit.org/b/102283&quot;);
-
-test();
-function test() {
-    removeVendorPrefixes();
-    setDBNameFromPath();
-
-    evalAndLog(&quot;indexedDB.open(dbname, 2)&quot;);
-    evalAndLog(&quot;indexedDB.open(dbname, 3)&quot;);
-
-    finishJSTest();
-}
-&lt;/script&gt;
</del><ins>+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/transaction-crash-in-tasks.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbtransactionorderinghtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/transaction-ordering.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/transaction-ordering.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/transaction-ordering.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,60 +1,9 @@
</span><del>-&lt;!DOCTYPE html&gt;
</del><ins>+&lt;html&gt;
+&lt;head&gt;
</ins><span class="cx"> &lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
</span><del>-&lt;script&gt;
-
-description(&quot;Verify Indexed DB transactions are ordered per spec&quot;);
-
-indexedDBTest(prepareDatabase, onOpen);
-
-function prepareDatabase(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
-}
-
-function onOpen(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-    debug(&quot;&quot;);
-    debug(&quot;Create in order tx1, tx2&quot;);
-    evalAndLog(&quot;tx1 = db.transaction('store', 'readwrite')&quot;);
-    evalAndLog(&quot;tx2 = db.transaction('store', 'readwrite')&quot;);
-    debug(&quot;&quot;);
-    debug(&quot;Use in order tx2, tx1&quot;);
-    evalAndLog(&quot;tx2.objectStore('store').get(0)&quot;);
-    evalAndLog(&quot;tx1.objectStore('store').get(0)&quot;);
-    debug(&quot;&quot;);
-    evalAndLog(&quot;order = []&quot;);
-
-    tx1.oncomplete = function(evt) {
-        debug(&quot;tx1 complete&quot;);
-        order.push(1);
-        if (order.length === 2) done();
-    };
-
-    tx2.oncomplete = function(evt) {
-        debug(&quot;tx1 complete&quot;);
-        order.push(2);
-        if (order.length === 2) done();
-    };
-
-    function done() {
-        preamble();
-        // IndexedDB Spec:
-        // https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#transaction-concept
-        //
-        // If multiple &quot;readwrite&quot; transactions are attempting to
-        // access the same object store (i.e. if they have overlapping
-        // scope), the transaction that was created first must be the
-        // transaction which gets access to the object store first.
-        //
-        shouldBeTrue(&quot;areArraysEqual(order, [ 1, 2 ])&quot;);
-        finishJSTest();
-    }
-}
-
-
-&lt;/script&gt;
</del><ins>+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;resources/transaction-ordering.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbtransactionoverlappinghtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/transaction-overlapping.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/transaction-overlapping.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/transaction-overlapping.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,81 +1,9 @@
</span><del>-&lt;!DOCTYPE html&gt;
</del><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><span class="cx"> &lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><del>-&lt;script&gt;
-description(&quot;Check that transactions that may overlap complete properly.&quot;);
-
-indexedDBTest(prepareDatabase, runParallelTransactions);
-
-function prepareDatabase(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-    evalAndLog(&quot;store = db.createObjectStore('store')&quot;);
-    evalAndLog(&quot;store.put('value', 'key')&quot;);
-}
-
-function runParallelTransactions(evt)
-{
-    preamble(evt);
-    evalAndLog(&quot;db = event.target.result&quot;);
-    debug(&quot;&quot;);
-    evalAndLog(&quot;transaction1 = db.transaction('store', 'readonly')&quot;);
-    transaction1.onabort = unexpectedAbortCallback;
-    transaction1.oncomplete = onTransactionComplete;
-    evalAndLog(&quot;transaction2 = db.transaction('store', 'readonly')&quot;);
-    transaction1.onabort = unexpectedAbortCallback;
-    transaction2.oncomplete = onTransactionComplete;
-
-    evalAndLog(&quot;transaction1GetSuccess = 0&quot;);
-    evalAndLog(&quot;transaction2GetSuccess = 0&quot;);
-
-    function doTransaction1Get() {
-        // NOTE: No logging since execution order is not deterministic.
-        request = transaction1.objectStore('store').get('key');
-        request.onerror = unexpectedErrorCallback;
-        request.onsuccess = function() {
-            ++transaction1GetSuccess;
-            if (!transaction2GetSuccess &amp;&amp; transaction1GetSuccess &lt; 10)
-                doTransaction1Get();
-        };
-    }
-
-    function doTransaction2Get() {
-        // NOTE: No logging since execution order is not deterministic.
-        request = transaction2.objectStore('store').get('key');
-        request.onerror = unexpectedErrorCallback;
-        request.onsuccess = function() {
-            ++transaction2GetSuccess;
-            if (!transaction1GetSuccess &amp;&amp; transaction2GetSuccess &lt; 10)
-                doTransaction2Get();
-        };
-    }
-
-    doTransaction1Get();
-    doTransaction2Get();
-}
-
-transactionCompletionCount = 0;
-function onTransactionComplete(evt)
-{
-    preamble(evt);
-
-    ++transactionCompletionCount;
-    if (transactionCompletionCount &lt; 2) {
-        debug(&quot;first transaction complete, still waiting...&quot;);
-        return;
-    }
-
-    shouldBeNonZero(&quot;transaction1GetSuccess&quot;);
-    shouldBeNonZero(&quot;transaction2GetSuccess&quot;);
-
-    evalAndLog(&quot;db.close()&quot;);
-    finishJSTest();
-}
-&lt;/script&gt;
</del><ins>+&lt;script src=&quot;resources/transaction-overlapping.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbtransactionstarvationhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/transaction-starvation.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/transaction-starvation.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/transaction-starvation.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,4 +1,3 @@
</span><del>-&lt;!DOCTYPE html&gt;
</del><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><span class="cx"> &lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbversionchangeeventbasichtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/version-change-event-basic.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/version-change-event-basic.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/version-change-event-basic.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -1,51 +1,10 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
</ins><span class="cx"> &lt;body&gt;
</span><span class="cx"> &lt;div id=&quot;logger&quot;&gt;&lt;/div&gt;
</span><del>-&lt;script&gt;
-
-if (window.testRunner) {
-    testRunner.dumpAsText();
-    testRunner.waitUntilDone();
-}
-
-function log(msg) {
-    document.getElementById(&quot;logger&quot;).innerHTML += msg + &quot;&lt;br&gt;&quot;;
-}
-
-var request1 = indexedDB.open(&quot;vceb1&quot;);
-request1.onupgradeneeded = function(e) {
-    log(&quot;First request: &quot; + e.oldVersion + &quot; &quot; + e.newVersion);
-}
-
-var request2 = indexedDB.open(&quot;vceb2&quot;, 1);
-request2.onupgradeneeded = function(e) {
-    log(&quot;Second request: &quot; + e.oldVersion + &quot; &quot; + e.newVersion);
-}
-
-var request3 = indexedDB.open(&quot;vceb3&quot;, 2);
-request3.onupgradeneeded = function(e) {
-    log(&quot;Third request: &quot; + e.oldVersion + &quot; &quot; + e.newVersion);
-    if (window.testRunner)
-        testRunner.notifyDone();
-}
-
-try {
-    var request = indexedDB.open(&quot;vceb4&quot;, 0);
-} catch (e) {
-    log(&quot;0 version: &quot; + e);
-}
-
-try {
-    var request = indexedDB.open(&quot;vceb5&quot;, -1);
-} catch (e) {
-    log(&quot;Negative version: &quot; + e);
-}
-
-try {
-    var request = indexedDB.open(&quot;vceb6&quot;, &quot;string&quot;);
-} catch (e) {
-    log(&quot;String version: &quot; + e);
-}
-
-&lt;/script&gt;
</del><ins>+&lt;script src=&quot;resources/version-change-event-basic.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbversionchangeeventhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/version-change-event.html (195298 => 195299)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/version-change-event.html        2016-01-19 19:20:35 UTC (rev 195298)
+++ trunk/LayoutTests/storage/indexeddb/version-change-event.html        2016-01-19 19:32:06 UTC (rev 195299)
</span><span class="lines">@@ -4,40 +4,6 @@
</span><span class="cx"> &lt;script src=&quot;resources/shared.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><del>-&lt;script&gt;
-
-description(&quot;Regression test for WK136583 - ensure the versionchange event has the proper name&quot;);
-
-indexedDBTest(prepareDatabase, upgradeDatabase);
-function prepareDatabase(evt)
-{
-    db = event.target.result;
-    evalAndLog(&quot;db.onversionchange = onVersionChange&quot;);
-    evalAndLog(&quot;store = db.createObjectStore('store1')&quot;);
-}
-
-function upgradeDatabase(evt)
-{
-    db = evt.target.result;
-    shouldBe(&quot;db.version&quot;, &quot;1&quot;);
-    evalAndLog(&quot;request = indexedDB.open(dbname, 2)&quot;);
-    evalAndLog(&quot;db.onversionchange = onVersionChange&quot;);
-    request.onerror = unexpectedErrorCallback;
-    request.onsuccess = finishTest;
-}
-
-function onVersionChange(evt)
-{
-    preamble(evt);
-    shouldBeEqualToString(&quot;event.type&quot;, &quot;versionchange&quot;);
-    db.close();
-}
-
-function finishTest(evt)
-{
-    finishJSTest();
-}
-
-&lt;/script&gt;
</del><ins>+&lt;script src=&quot;resources/version-change-event.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre>
</div>
</div>

</body>
</html>