| Index: third_party/WebKit/LayoutTests/storage/indexeddb/empty-crash.html
|
| diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/empty-crash.html b/third_party/WebKit/LayoutTests/storage/indexeddb/empty-crash.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..81a94dc7297083ac2018f4e89fb2ec86526acd15
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/storage/indexeddb/empty-crash.html
|
| @@ -0,0 +1,45 @@
|
| +<!DOCTYPE html>
|
| +<title>IndexedDB: Don't crash accessing cached properties in disconnected frame</title>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<script id="scriptid" type="javascript/frame-script">
|
| +// This script is run in an IFRAME.
|
| +
|
| +var dbname = 'db-' + String(document.location);
|
| +indexedDB.deleteDatabase(dbname);
|
| +var open = indexedDB.open(dbname);
|
| +open.onupgradeneeded = function() {
|
| + var db = open.result;
|
| + var store = db.createObjectStore('store');
|
| +};
|
| +
|
| +open.onsuccess = function() {
|
| + db = open.result;
|
| + var tx = db.transaction('store');
|
| + var req = tx.objectStore('store').get(0);
|
| + req.onsuccess = function() {
|
| + frameElement.parentNode.removeChild(frameElement);
|
| + var result = req.result;
|
| + };
|
| +};
|
| +</script>
|
| +
|
| +<script>
|
| +async_test(function(t) {
|
| + var script = document.querySelector('#scriptid').textContent;
|
| + var blob = new Blob(['<script>', script, '<\/script>'], {'type': 'text/html'});
|
| + var iframe = document.createElement('iframe');
|
| + document.documentElement.appendChild(iframe);
|
| + iframe.src = URL.createObjectURL(blob);
|
| +
|
| + // Wait for IFRAME to remove itself; the test passes as long as it
|
| + // does not crash.
|
| + var id = setInterval(t.step_func(function() {
|
| + if (!document.querySelector('iframe')) {
|
| + clearInterval(id);
|
| + t.done();
|
| + }
|
| + }), 10);
|
| +
|
| +}, 'Accessing cached attributes after frame disconnect should not crash.');
|
| +</script>
|
|
|