зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1273795 - browser_net_service-worker-status.js: use ContentTask instead of CPOW r=ochameau
MozReview-Commit-ID: BczmQjhjuw9 --HG-- extra : rebase_source : 479bbffc70880aec81b555dfbf4875227a335239
This commit is contained in:
Родитель
84f52725fd
Коммит
18f6c7c94f
|
@ -12,8 +12,8 @@ const URL = EXAMPLE_URL.replace("http:", "https:");
|
|||
|
||||
const TEST_URL = URL + "service-workers/status-codes.html";
|
||||
|
||||
var test = Task.async(function* () {
|
||||
let [, debuggee, monitor] = yield initNetMonitor(TEST_URL, null, true);
|
||||
add_task(function* () {
|
||||
let [tab, , monitor] = yield initNetMonitor(TEST_URL, null, true);
|
||||
info("Starting test... ");
|
||||
|
||||
let { NetMonitorView } = monitor.panelWin;
|
||||
|
@ -35,11 +35,16 @@ var test = Task.async(function* () {
|
|||
];
|
||||
|
||||
info("Registering the service worker...");
|
||||
yield debuggee.registerServiceWorker();
|
||||
yield ContentTask.spawn(tab.linkedBrowser, {}, function* () {
|
||||
yield content.wrappedJSObject.registerServiceWorker();
|
||||
});
|
||||
|
||||
info("Performing requests...");
|
||||
debuggee.performRequests();
|
||||
yield waitForNetworkEvents(monitor, REQUEST_DATA.length);
|
||||
let wait = waitForNetworkEvents(monitor, REQUEST_DATA.length);
|
||||
yield ContentTask.spawn(tab.linkedBrowser, {}, function* () {
|
||||
content.wrappedJSObject.performRequests();
|
||||
});
|
||||
yield wait;
|
||||
|
||||
let index = 0;
|
||||
for (let request of REQUEST_DATA) {
|
||||
|
@ -64,8 +69,9 @@ var test = Task.async(function* () {
|
|||
}
|
||||
|
||||
info("Unregistering the service worker...");
|
||||
yield debuggee.unregisterServiceWorker();
|
||||
yield ContentTask.spawn(tab.linkedBrowser, {}, function* () {
|
||||
yield content.wrappedJSObject.unregisterServiceWorker();
|
||||
});
|
||||
|
||||
yield teardown(monitor);
|
||||
finish();
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче