mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:30:27 +00:00
45b8007f3d
- Bug 1150717 - Test request with no params in the Network Monitor. r=brings (a60e9e8d9) - Bug 1168077 - Remove remaining spidermonkey js specific syntax from browser/devtools; r=miker (c98f20c30) - Bug 1168125 - Fix existing tests, r=jsantell (b1dfa101e) - Bug 1169439 - Pull out marker definitions into its own file, and move formatter and collapse functions into marker-utils. r=vp (17eb24ab3) - Bug 1173654 - Part 1: Add logging methods for SurfaceType and ImageFormat. r=Bas (22f2fa019) - Bug 1169125 - Part 1: Allow sending any DataSourceSurface-backed image over WebRTC and fix failure cases. r=bwc (1fb0def92) - Bug 1169125 - Part 2: Use UniquePtr for scoped delete of yuv data in MediaPipeline. r=bwc (cdb79e201) - Bug 1173654 - Part 2: Use namespaces in MediaPipeline.cpp. r=bwc (311696260) - Bug 1173654 - Part 3: Attempt to GetDataSurface() and convert if sending pure I420 fails. r=bwc, r=jesup (58520b820) - Bug 1173654 - Part 4: Add detailed logging and asserts to MediaPipeline::ProcessVideoChunk. r=bwc (ba08ae5bc) - Bug 1155089 - Part 1: Reset |TrackID| for MediaPipelineTransmit::PipelineListener on replaceTrack(). r=bwc (304fb8703) - adapted Bug 1142688 - Wait for actual audio data on remote side before checking audio sanity. r=jesup,padenot (479f6356c) - Bug 858927 - Move the mozilla::TimeStamp into mozglue. r=glandium (751938e09) - Bug 1166559 - Add documentation for ProfileTimelineMarkers from a dev tools perspective. r=fitzgen (ed1563dfb) - Bug 1141614 - Part 4: Expose cycle collection markers in the devtools frontend; r=jsantell (2eb830de7)
170 lines
7.6 KiB
JavaScript
170 lines
7.6 KiB
JavaScript
/* Any copyright is dedicated to the Public Domain.
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
/**
|
|
* Tests whether complex request params and payload sent via POST are
|
|
* displayed correctly.
|
|
*/
|
|
|
|
function test() {
|
|
initNetMonitor(PARAMS_URL).then(([aTab, aDebuggee, aMonitor]) => {
|
|
info("Starting test... ");
|
|
|
|
let { document, L10N, EVENTS, Editor, NetMonitorView } = aMonitor.panelWin;
|
|
let { RequestsMenu, NetworkDetails } = NetMonitorView;
|
|
|
|
RequestsMenu.lazyUpdate = false;
|
|
NetworkDetails._params.lazyEmpty = false;
|
|
|
|
Task.spawn(function*() {
|
|
yield waitForNetworkEvents(aMonitor, 1, 6);
|
|
|
|
EventUtils.sendMouseEvent({ type: "mousedown" },
|
|
document.getElementById("details-pane-toggle"));
|
|
EventUtils.sendMouseEvent({ type: "mousedown" },
|
|
document.querySelectorAll("#details-pane tab")[2]);
|
|
|
|
yield waitFor(aMonitor.panelWin, EVENTS.REQUEST_POST_PARAMS_DISPLAYED);
|
|
yield testParamsTab1('a', '""', '{ "foo": "bar" }', '""');
|
|
|
|
RequestsMenu.selectedIndex = 1;
|
|
yield waitFor(aMonitor.panelWin, EVENTS.REQUEST_POST_PARAMS_DISPLAYED);
|
|
yield testParamsTab1('a', '"b"', '{ "foo": "bar" }', '""');
|
|
|
|
RequestsMenu.selectedIndex = 2;
|
|
yield waitFor(aMonitor.panelWin, EVENTS.REQUEST_POST_PARAMS_DISPLAYED);
|
|
yield testParamsTab1('a', '"b"', 'foo', '"bar"');
|
|
|
|
RequestsMenu.selectedIndex = 3;
|
|
yield waitFor(aMonitor.panelWin, EVENTS.REQUEST_POST_PARAMS_DISPLAYED);
|
|
yield testParamsTab2('a', '""', '{ "foo": "bar" }', "js");
|
|
|
|
RequestsMenu.selectedIndex = 4;
|
|
yield waitFor(aMonitor.panelWin, EVENTS.REQUEST_POST_PARAMS_DISPLAYED);
|
|
yield testParamsTab2('a', '"b"', '{ "foo": "bar" }', "js");
|
|
|
|
RequestsMenu.selectedIndex = 5;
|
|
yield waitFor(aMonitor.panelWin, EVENTS.REQUEST_POST_PARAMS_DISPLAYED);
|
|
yield testParamsTab2('a', '"b"', '?foo=bar', "text");
|
|
|
|
RequestsMenu.selectedIndex = 6;
|
|
yield waitFor(aMonitor.panelWin, EVENTS.SIDEBAR_POPULATED);
|
|
yield testParamsTab3('a', '"b"');
|
|
|
|
yield teardown(aMonitor);
|
|
finish();
|
|
});
|
|
|
|
function testParamsTab1(
|
|
aQueryStringParamName, aQueryStringParamValue, aFormDataParamName, aFormDataParamValue)
|
|
{
|
|
let tab = document.querySelectorAll("#details-pane tab")[2];
|
|
let tabpanel = document.querySelectorAll("#details-pane tabpanel")[2];
|
|
|
|
is(tabpanel.querySelectorAll(".variables-view-scope").length, 2,
|
|
"The number of param scopes displayed in this tabpanel is incorrect.");
|
|
is(tabpanel.querySelectorAll(".variable-or-property").length, 2,
|
|
"The number of param values displayed in this tabpanel is incorrect.");
|
|
is(tabpanel.querySelectorAll(".variables-view-empty-notice").length, 0,
|
|
"The empty notice should not be displayed in this tabpanel.");
|
|
|
|
is(tabpanel.querySelector("#request-params-box")
|
|
.hasAttribute("hidden"), false,
|
|
"The request params box should not be hidden.");
|
|
is(tabpanel.querySelector("#request-post-data-textarea-box")
|
|
.hasAttribute("hidden"), true,
|
|
"The request post data textarea box should be hidden.");
|
|
|
|
let paramsScope = tabpanel.querySelectorAll(".variables-view-scope")[0];
|
|
let formDataScope = tabpanel.querySelectorAll(".variables-view-scope")[1];
|
|
|
|
is(paramsScope.querySelector(".name").getAttribute("value"),
|
|
L10N.getStr("paramsQueryString"),
|
|
"The params scope doesn't have the correct title.");
|
|
is(formDataScope.querySelector(".name").getAttribute("value"),
|
|
L10N.getStr("paramsFormData"),
|
|
"The form data scope doesn't have the correct title.");
|
|
|
|
is(paramsScope.querySelectorAll(".variables-view-variable .name")[0].getAttribute("value"),
|
|
aQueryStringParamName,
|
|
"The first query string param name was incorrect.");
|
|
is(paramsScope.querySelectorAll(".variables-view-variable .value")[0].getAttribute("value"),
|
|
aQueryStringParamValue,
|
|
"The first query string param value was incorrect.");
|
|
|
|
is(formDataScope.querySelectorAll(".variables-view-variable .name")[0].getAttribute("value"),
|
|
aFormDataParamName,
|
|
"The first form data param name was incorrect.");
|
|
is(formDataScope.querySelectorAll(".variables-view-variable .value")[0].getAttribute("value"),
|
|
aFormDataParamValue,
|
|
"The first form data param value was incorrect.");
|
|
}
|
|
|
|
function testParamsTab2(
|
|
aQueryStringParamName, aQueryStringParamValue, aRequestPayload, aEditorMode)
|
|
{
|
|
let tab = document.querySelectorAll("#details-pane tab")[2];
|
|
let tabpanel = document.querySelectorAll("#details-pane tabpanel")[2];
|
|
|
|
is(tabpanel.querySelectorAll(".variables-view-scope").length, 2,
|
|
"The number of param scopes displayed in this tabpanel is incorrect.");
|
|
is(tabpanel.querySelectorAll(".variable-or-property").length, 1,
|
|
"The number of param values displayed in this tabpanel is incorrect.");
|
|
is(tabpanel.querySelectorAll(".variables-view-empty-notice").length, 0,
|
|
"The empty notice should not be displayed in this tabpanel.");
|
|
|
|
is(tabpanel.querySelector("#request-params-box")
|
|
.hasAttribute("hidden"), false,
|
|
"The request params box should not be hidden.");
|
|
is(tabpanel.querySelector("#request-post-data-textarea-box")
|
|
.hasAttribute("hidden"), false,
|
|
"The request post data textarea box should not be hidden.");
|
|
|
|
let paramsScope = tabpanel.querySelectorAll(".variables-view-scope")[0];
|
|
let payloadScope = tabpanel.querySelectorAll(".variables-view-scope")[1];
|
|
|
|
is(paramsScope.querySelector(".name").getAttribute("value"),
|
|
L10N.getStr("paramsQueryString"),
|
|
"The params scope doesn't have the correct title.");
|
|
is(payloadScope.querySelector(".name").getAttribute("value"),
|
|
L10N.getStr("paramsPostPayload"),
|
|
"The request payload scope doesn't have the correct title.");
|
|
|
|
is(paramsScope.querySelectorAll(".variables-view-variable .name")[0].getAttribute("value"),
|
|
aQueryStringParamName,
|
|
"The first query string param name was incorrect.");
|
|
is(paramsScope.querySelectorAll(".variables-view-variable .value")[0].getAttribute("value"),
|
|
aQueryStringParamValue,
|
|
"The first query string param value was incorrect.");
|
|
|
|
return NetMonitorView.editor("#request-post-data-textarea").then((aEditor) => {
|
|
is(aEditor.getText(), aRequestPayload,
|
|
"The text shown in the source editor is incorrect.");
|
|
is(aEditor.getMode(), Editor.modes[aEditorMode],
|
|
"The mode active in the source editor is incorrect.");
|
|
});
|
|
}
|
|
|
|
function testParamsTab3(aQueryStringParamName, aQueryStringParamValue) {
|
|
let tab = document.querySelectorAll("#details-pane tab")[2];
|
|
let tabpanel = document.querySelectorAll("#details-pane tabpanel")[2];
|
|
|
|
is(tabpanel.querySelectorAll(".variables-view-scope").length, 0,
|
|
"The number of param scopes displayed in this tabpanel is incorrect.");
|
|
is(tabpanel.querySelectorAll(".variable-or-property").length, 0,
|
|
"The number of param values displayed in this tabpanel is incorrect.");
|
|
is(tabpanel.querySelectorAll(".variables-view-empty-notice").length, 1,
|
|
"The empty notice should be displayed in this tabpanel.");
|
|
|
|
is(tabpanel.querySelector("#request-params-box")
|
|
.hasAttribute("hidden"), false,
|
|
"The request params box should not be hidden.");
|
|
is(tabpanel.querySelector("#request-post-data-textarea-box")
|
|
.hasAttribute("hidden"), true,
|
|
"The request post data textarea box should be hidden.");
|
|
}
|
|
|
|
aDebuggee.performRequests();
|
|
});
|
|
}
|