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

Unified Diff: LayoutTests/storage/resources/database-worker.js

Issue 598034: Refactor a database test such that its code can be shared between the documen... (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/
Patch Set: '' Created 10 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/storage/resources/database-worker.js
===================================================================
--- LayoutTests/storage/resources/database-worker.js (revision 0)
+++ LayoutTests/storage/resources/database-worker.js (revision 0)
@@ -0,0 +1,29 @@
+var window = {
+ layoutTestController: {
+ notifyDone: function() { postMessage("notifyDone"); }
+ }
+};
+var layoutTestController = window.layoutTestController;
+
+function log(s) {
+ postMessage("log:" + s);
+}
+
+onmessage = function(event) {
+ try {
+ if (event.data.indexOf("importScripts:") == 0) {
+ var scripts = event.data.substring("importScripts:".length).split(",");
+ for (var i in scripts) {
+ scripts[i] = "../" + scripts[i];
+ }
+ importScripts(scripts);
+ } else if (event.data == "runTest") {
+ runTest(); // Must be defined by some imported script.
+ } else {
+ log("Received unexpected message: " + event.data);
+ }
+ } catch (ex) {
+ log("Worker caught exception: " + ex);
+ window.layoutTestController.notifyDone();
+ }
+}
« no previous file with comments | « LayoutTests/storage/execute-sql-args-worker-expected.txt ('k') | LayoutTests/storage/resources/database-worker-controller.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698