mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 880741 add indexeddb to frameworker, r=gavin
This commit is contained in:
parent
73e8300de5
commit
aaa8b1fc12
@ -136,7 +136,7 @@ FrameWorker.prototype = {
|
|||||||
let workerAPI = ['WebSocket', 'localStorage', 'atob', 'btoa',
|
let workerAPI = ['WebSocket', 'localStorage', 'atob', 'btoa',
|
||||||
'clearInterval', 'clearTimeout', 'dump',
|
'clearInterval', 'clearTimeout', 'dump',
|
||||||
'setInterval', 'setTimeout', 'XMLHttpRequest',
|
'setInterval', 'setTimeout', 'XMLHttpRequest',
|
||||||
'FileReader', 'Blob', 'EventSource',
|
'FileReader', 'Blob', 'EventSource', 'indexedDB',
|
||||||
'location'];
|
'location'];
|
||||||
// Bug 798660 - XHR and WebSocket have issues in a sandbox and need
|
// Bug 798660 - XHR and WebSocket have issues in a sandbox and need
|
||||||
// to be unwrapped to work
|
// to be unwrapped to work
|
||||||
|
@ -652,4 +652,17 @@ let tests = {
|
|||||||
worker.port.postMessage({topic: "ping"})
|
worker.port.postMessage({topic: "ping"})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
testIndexedDB: function(cbnext) {
|
||||||
|
let worker = getFrameWorkerHandle("https://example.com/browser/toolkit/components/social/test/browser/worker_social.js", undefined, "testIndexedDB");
|
||||||
|
worker.port.onmessage = function(e) {
|
||||||
|
let m = e.data;
|
||||||
|
if (m.topic == "social.indexeddb-result") {
|
||||||
|
is(m.data.result, "ok", "created indexeddb");
|
||||||
|
worker.terminate();
|
||||||
|
cbnext();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
worker.port.postMessage({topic: "test-indexeddb-create"})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,18 @@ onconnect = function(e) {
|
|||||||
data: data});
|
data: data});
|
||||||
testerPort.postMessage({topic: 'did-notification-create'});
|
testerPort.postMessage({topic: 'did-notification-create'});
|
||||||
break;
|
break;
|
||||||
|
case "test-indexeddb-create":
|
||||||
|
var request = indexedDB.open("workerdb", 1);
|
||||||
|
request.onerror = function(event) {
|
||||||
|
port.postMessage({topic: 'social.indexeddb-result', data: { result: "error" }});
|
||||||
|
};
|
||||||
|
request.onsuccess = function(event) {
|
||||||
|
// Do something with request.result!
|
||||||
|
var db = request.result;
|
||||||
|
db.close();
|
||||||
|
port.postMessage({topic: 'social.indexeddb-result', data: { result: "ok" }});
|
||||||
|
};
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// used for "test-reload-worker"
|
// used for "test-reload-worker"
|
||||||
|
Loading…
Reference in New Issue
Block a user