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

Side by Side Diff: content/test/data/indexeddb/blob_did_ack.html

Issue 917353002: IndexedDB: Test that Blink ack's blobs upon receipt. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed get on success event handler - unnecessary Created 5 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <!--
4 Copyright 2015 The Chromium Authors. All rights reserved.
5 Use of this source code is governed by a BSD-style license that can be
6 found in the LICENSE file.
7 -->
8 <head>
9 <title>IDB Test that reading a blob from the database does send an ack back to b rowser process</title>
10 <script src="common.js"></script>
11 <script>
12
13 // Constants.
14 var store_name = 'blobs_ack';
15 var blob_key = 'blob_key';
16 var blob_size = 200;
17
18 // Shared variables.
19 var db;
20 var put_blob;
21
22 function test() {
23 indexedDBTest(prepareDatabase, putBlob);
24 }
25
26 function prepareDatabase() {
27 db = event.target.result;
28 db.createObjectStore(store_name);
29 }
30
31 function putBlob() {
32 debug("Writing blob.");
33
34 var trans = db.transaction(store_name, 'readwrite');
35 trans.onabort = unexpectedAbortCallback;
36 trans.oncomplete = getBlob;
37
38 var data = new Array(1 + blob_size).join("X");
39 put_blob = new Blob([data]);
40 var request = trans.objectStore(store_name).put(put_blob, blob_key);
41 request.onerror = unexpectedErrorCallback;
42 }
43
44 function getBlob() {
45 debug("Deleting blob.");
46 put_blob = undefined; // So that the blob can be GC'd
47 var trans = db.transaction(store_name, 'readonly');
48 trans.onabort = unexpectedAbortCallback;
49 trans.oncomplete = onGetComplete;
50
51 var request = trans.objectStore(store_name).get(blob_key);
52 request.onerror = unexpectedErrorCallback;
53 }
54
55 function onGetComplete() {
56 gc();
57 done();
58 }
59
60 </script>
61 </head>
62 <body onLoad="test()">
63 <div id="status">Starting...<br>
64 <p>Run this test with --js-flags=--expose-gc when run from Chrome.</p>
65 </div>
66 </body>
67 </html>
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_browsertest.cc ('k') | storage/browser/blob/blob_storage_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698