Bug 1137694 - Avoid calling content methods directly in browser_net_sort-03.js; r=past

--HG--
extra : rebase_source : 032a534ec480cdc0650f785ed9eb6ccd84b2d12c
This commit is contained in:
Patrick Brosset 2015-03-02 12:06:41 +01:00
parent 6c506d5a30
commit fd8a84a882
4 changed files with 51 additions and 35 deletions

View File

@ -100,7 +100,6 @@ skip-if = e10s # Bug 1091612
[browser_net_sort-01.js]
[browser_net_sort-02.js]
[browser_net_sort-03.js]
skip-if = (os == 'linux' && e10s && !debug) # bug 1137694
[browser_net_statistics-01.js]
[browser_net_statistics-02.js]
[browser_net_statistics-03.js]

View File

@ -16,6 +16,26 @@ function test() {
let { $, $all, L10N, NetMonitorView } = aMonitor.panelWin;
let { RequestsMenu } = NetMonitorView;
// Loading the frame script and preparing the xhr request URLs so we can
// generate some requests later.
loadCommonFrameScript();
let requests = [{
url: "sjs_sorting-test-server.sjs?index=1&" + Math.random(),
method: "GET1"
}, {
url: "sjs_sorting-test-server.sjs?index=5&" + Math.random(),
method: "GET5"
}, {
url: "sjs_sorting-test-server.sjs?index=2&" + Math.random(),
method: "GET2"
}, {
url: "sjs_sorting-test-server.sjs?index=4&" + Math.random(),
method: "GET4"
}, {
url: "sjs_sorting-test-server.sjs?index=3&" + Math.random(),
method: "GET3"
}];
RequestsMenu.lazyUpdate = false;
waitForNetworkEvents(aMonitor, 5).then(() => {
@ -269,6 +289,8 @@ function test() {
return promise.resolve(null);
}
aDebuggee.performRequests();
performRequestsInContent(requests).then(null, e => {
ok(false, e);
});
});
}

View File

@ -16,6 +16,26 @@ function test() {
let { $, $all, L10N, NetMonitorView } = aMonitor.panelWin;
let { RequestsMenu } = NetMonitorView;
// Loading the frame script and preparing the xhr request URLs so we can
// generate some requests later.
loadCommonFrameScript();
let requests = [{
url: "sjs_sorting-test-server.sjs?index=1&" + Math.random(),
method: "GET1"
}, {
url: "sjs_sorting-test-server.sjs?index=5&" + Math.random(),
method: "GET5"
}, {
url: "sjs_sorting-test-server.sjs?index=2&" + Math.random(),
method: "GET2"
}, {
url: "sjs_sorting-test-server.sjs?index=4&" + Math.random(),
method: "GET4"
}, {
url: "sjs_sorting-test-server.sjs?index=3&" + Math.random(),
method: "GET3"
}];
RequestsMenu.lazyUpdate = false;
waitForNetworkEvents(aMonitor, 5).then(() => {
@ -38,7 +58,7 @@ function test() {
})
.then(() => {
info("Performing more requests.");
aDebuggee.performRequests();
performRequestsInContent(requests);
return waitForNetworkEvents(aMonitor, 5);
})
.then(() => {
@ -54,7 +74,7 @@ function test() {
})
.then(() => {
info("Performing more requests.");
aDebuggee.performRequests();
performRequestsInContent(requests);
return waitForNetworkEvents(aMonitor, 5);
})
.then(() => {
@ -77,7 +97,11 @@ function test() {
.then(() => {
return teardown(aMonitor);
})
.then(finish);
.then(finish, e => {
ok(false, e);
});
}, e => {
ok(false, e);
});
function testHeaders(aSortType, aDirection) {
@ -191,6 +215,6 @@ function test() {
return promise.resolve(null);
}
aDebuggee.performRequests();
performRequestsInContent(requests).then(null, Cu.reportError);
});
}

View File

@ -13,35 +13,6 @@
<body>
<p>Sorting test</p>
<script type="text/javascript">
function get(aAddress, aIndex, aCallback) {
var xhr = new XMLHttpRequest();
// Use a random parameter to defeat caching.
xhr.open("GET" + aIndex, aAddress + "?index=" + aIndex + "&" + Math.random(), true);
xhr.onreadystatechange = function() {
if (this.readyState == this.DONE) {
aCallback();
}
};
xhr.send(null);
}
function performRequests() {
get("sjs_sorting-test-server.sjs", 1, function() {
get("sjs_sorting-test-server.sjs", 5, function() {
get("sjs_sorting-test-server.sjs", 2, function() {
get("sjs_sorting-test-server.sjs", 4, function() {
get("sjs_sorting-test-server.sjs", 3, function() {
// Done.
});
});
});
});
});
}
</script>
</body>
</html>