OLD | NEW |
1 var jsTestIsAsync = true; | 1 var jsTestIsAsync = true; |
2 if (self.importScripts && !self.postMessage) { | 2 if (self.importScripts && !self.postMessage) { |
3 // Shared worker. Make postMessage send to the newest client, which in | 3 // Shared worker. Make postMessage send to the newest client, which in |
4 // our tests is the only client. | 4 // our tests is the only client. |
5 | 5 |
6 // Store messages for sending until we have somewhere to send them. | 6 // Store messages for sending until we have somewhere to send them. |
7 self.postMessage = function(message) | 7 self.postMessage = function(message) |
8 { | 8 { |
9 if (typeof self.pendingMessages === "undefined") | 9 if (typeof self.pendingMessages === "undefined") |
10 self.pendingMessages = []; | 10 self.pendingMessages = []; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 evalAndLog(cmd); | 107 evalAndLog(cmd); |
108 } | 108 } |
109 return callback; | 109 return callback; |
110 } | 110 } |
111 | 111 |
112 // If this function is deleted, a standalone layout test exercising its | 112 // If this function is deleted, a standalone layout test exercising its |
113 // functionality should be added. | 113 // functionality should be added. |
114 function deleteAllObjectStores(db) | 114 function deleteAllObjectStores(db) |
115 { | 115 { |
116 while (db.objectStoreNames.length) | 116 while (db.objectStoreNames.length) |
117 db.deleteObjectStore(db.objectStoreNames.item(0)); | 117 db.deleteObjectStore(db.objectStoreNames[0]); |
118 debug("Deleted all object stores."); | 118 debug("Deleted all object stores."); |
119 } | 119 } |
120 | 120 |
121 function setDBNameFromPath(suffix) { | 121 function setDBNameFromPath(suffix) { |
122 var name = self.location.pathname.substring(1 + self.location.pathname.lastI
ndexOf("/")); | 122 var name = self.location.pathname.substring(1 + self.location.pathname.lastI
ndexOf("/")); |
123 if (suffix) | 123 if (suffix) |
124 name += suffix; | 124 name += suffix; |
125 evalAndLog('dbname = "' + name + '"'); | 125 evalAndLog('dbname = "' + name + '"'); |
126 } | 126 } |
127 | 127 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 requests.forEach(function(req) { | 202 requests.forEach(function(req) { |
203 req.onsuccess = function() { | 203 req.onsuccess = function() { |
204 --count; | 204 --count; |
205 if (!count) | 205 if (!count) |
206 callback(requests); | 206 callback(requests); |
207 }; | 207 }; |
208 req.onerror = unexpectedErrorCallback; | 208 req.onerror = unexpectedErrorCallback; |
209 }); | 209 }); |
210 } | 210 } |
OLD | NEW |