Bug 1332949 - test case for copy binary data. r?honza
MozReview-Commit-ID: DSDSkdjjwHC
--- a/devtools/client/framework/test/shared-head.js
+++ b/devtools/client/framework/test/shared-head.js
@@ -513,17 +513,17 @@ function synthesizeContextMenuEvent(el)
EventUtils.synthesizeMouse(el, 5, 2, eventDetails, el.ownerDocument.defaultView);
}
/**
* Promise wrapper around SimpleTest.waitForClipboard
*/
function waitForClipboardPromise(setup, expected) {
return new Promise((resolve, reject) => {
- SimpleTest.waitForClipboard(expected, setup, resolve, reject);
+ SimpleTest.waitForClipboard(expected, setup, resolve, reject,null,3000);
});
}
/**
* Simple helper to push a temporary preference. Wrapper on SpecialPowers
* pushPrefEnv that returns a promise resolving when the preferences have been
* updated.
*
--- a/devtools/client/netmonitor/test/browser_net_copy_params.js
+++ b/devtools/client/netmonitor/test/browser_net_copy_params.js
@@ -11,17 +11,17 @@ add_task(function* () {
let { tab, monitor } = yield initNetMonitor(PARAMS_URL);
info("Starting test... ");
let { document, store, windowRequire } = monitor.panelWin;
let Actions = windowRequire("devtools/client/netmonitor/src/actions/index");
store.dispatch(Actions.batchEnable(false));
- let wait = waitForNetworkEvents(monitor, 1, 6);
+ let wait = waitForNetworkEvents(monitor, 1, 7);
yield ContentTask.spawn(tab.linkedBrowser, {}, function* () {
content.wrappedJSObject.performRequests();
});
yield wait;
yield testCopyUrlParamsHidden(0, false);
yield testCopyUrlParams(0, "a");
yield testCopyPostDataHidden(0, false);
@@ -47,18 +47,24 @@ add_task(function* () {
yield testCopyPostDataHidden(4, false);
yield testCopyPostData(4, "{ \"foo\": \"bar\" }");
yield testCopyUrlParamsHidden(5, false);
yield testCopyUrlParams(5, "a=b");
yield testCopyPostDataHidden(5, false);
yield testCopyPostData(5, "?foo=bar");
- yield testCopyUrlParamsHidden(6, true);
- yield testCopyPostDataHidden(6, true);
+ yield testCopyUrlParamsHidden(6, false);
+ yield testCopyUrlParams(6, "a=b");
+ yield testCopyPostDataHidden(6, false);
+ yield testCopyPostData(6,
+ "Ãi\u0012®4Ýð?ð\u0007ó ^|áoè¯MIB\u0002tö\u001b¹ÿ\u000e*õ\u0001");
+
+ yield testCopyUrlParamsHidden(7, true);
+ yield testCopyPostDataHidden(7, true);
return teardown(monitor);
function testCopyUrlParamsHidden(index, hidden) {
EventUtils.sendMouseEvent({ type: "mousedown" },
document.querySelectorAll(".request-list-item")[index]);
EventUtils.sendMouseEvent({ type: "contextmenu" },
document.querySelectorAll(".request-list-item")[index]);
--- a/devtools/client/netmonitor/test/html_params-test-page.html
+++ b/devtools/client/netmonitor/test/html_params-test-page.html
@@ -49,19 +49,22 @@
setTimeout(function () {
post("baz", "?a=b", undefined, '{ "foo": "bar" }');
setTimeout(function () {
post("baz", "?a=b", undefined, "?foo=bar");
setTimeout(function () {
- get("baz", "");
+ post("baz", "?a=b", undefined, "Ãi®4Ýð?ðó ^|áoè¯MIBtö¹ÿ*õ");
+ setTimeout(function () {
+ get("baz", "");
- // Done.
+ // Done.
+ }, 10);
}, 10);
}, 10);
}, 10);
}, 10);
}, 10);
}, 10);
}, 10);
/* eslint-enable max-nested-callbacks */