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

Unified Diff: LayoutTests/http/tests/serviceworker/indexeddb-worker.js

Issue 231513003: Convert Service Worker layout tests to W3C testharness-style tests (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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
Index: LayoutTests/http/tests/serviceworker/indexeddb-worker.js
diff --git a/LayoutTests/http/tests/serviceworker/indexeddb-worker.js b/LayoutTests/http/tests/serviceworker/indexeddb-worker.js
deleted file mode 100644
index 5b258be905569c4285980f6028456054a735b9be..0000000000000000000000000000000000000000
--- a/LayoutTests/http/tests/serviceworker/indexeddb-worker.js
+++ /dev/null
@@ -1,46 +0,0 @@
-var port;
-self.addEventListener('message', function(e) {
- var message = e.data;
- if ('port' in message) {
- port = message.port;
- doIndexedDBTest();
- }
-});
-function send(action, text) {
- if (port) port.postMessage({action: action, text: text});
-}
-
-function evalAndLog(s) {
- send('log', s);
- try {
- return eval(s);
- } catch (ex) {
- send('fail', 'EXCEPTION: ' + ex);
- throw ex;
- }
-}
-
-function debug(s) {
- send('log', s);
-}
-
-function doIndexedDBTest() {
- debug('Preparing the database in the service worker');
- var request = evalAndLog("indexedDB.deleteDatabase('db')");
- request.onsuccess = function() {
- request = evalAndLog("indexedDB.open('db')");
- request.onupgradeneeded = function() {
- db = request.result;
- evalAndLog("db.createObjectStore('store')");
- };
- request.onsuccess = function() {
- db = request.result;
- evalAndLog("tx = db.transaction('store', 'readwrite')");
- evalAndLog("store = tx.objectStore('store')");
- evalAndLog("store.put('value', 'key')");
- tx.oncomplete = function() {
- send('quit');
- };
- };
- };
-}

Powered by Google App Engine
This is Rietveld 408576698