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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 evalAndLog(cmd); | 113 evalAndLog(cmd); |
114 } | 114 } |
115 return callback; | 115 return callback; |
116 } | 116 } |
117 | 117 |
118 // If this function is deleted, a standalone layout test exercising its | 118 // If this function is deleted, a standalone layout test exercising its |
119 // functionality should be added. | 119 // functionality should be added. |
120 function deleteAllObjectStores(db) | 120 function deleteAllObjectStores(db) |
121 { | 121 { |
122 while (db.objectStoreNames.length) | 122 while (db.objectStoreNames.length) |
123 db.deleteObjectStore(db.objectStoreNames.item(0)); | 123 db.deleteObjectStore(db.objectStoreNames[0]); |
124 debug("Deleted all object stores."); | 124 debug("Deleted all object stores."); |
125 } | 125 } |
126 | 126 |
127 function setDBNameFromPath(suffix) { | 127 function setDBNameFromPath(suffix) { |
128 var name = self.location.pathname.substring(1 + self.location.pathname.lastI
ndexOf("/")); | 128 var name = self.location.pathname.substring(1 + self.location.pathname.lastI
ndexOf("/")); |
129 if (suffix) | 129 if (suffix) |
130 name += suffix; | 130 name += suffix; |
131 evalAndLog('dbname = "' + name + '"'); | 131 evalAndLog('dbname = "' + name + '"'); |
132 } | 132 } |
133 | 133 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 208 |
209 requests.forEach(function(req) { | 209 requests.forEach(function(req) { |
210 req.onsuccess = function() { | 210 req.onsuccess = function() { |
211 --count; | 211 --count; |
212 if (!count) | 212 if (!count) |
213 callback(requests); | 213 callback(requests); |
214 }; | 214 }; |
215 req.onerror = unexpectedErrorCallback; | 215 req.onerror = unexpectedErrorCallback; |
216 }); | 216 }); |
217 } | 217 } |
OLD | NEW |