Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Unified Diff: third_party/WebKit/LayoutTests/storage/indexeddb/empty-crash.html

Issue 1780593002: V8 Bindings: Don't attempt to set an empty V8HiddenValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/V8HiddenValue.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/V8HiddenValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698