summaryrefslogtreecommitdiffstats
path: root/devtools/client/netmonitor/test/browser_net_curl-utils.js
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-03-02 10:32:45 +0100
committerGitHub <noreply@github.com>2018-03-02 10:32:45 +0100
commite272829137195b46612b7664c9416364089f7baa (patch)
tree20b543048260952a2c4ac8bb4cb22aaaa684bd84 /devtools/client/netmonitor/test/browser_net_curl-utils.js
parentba2c2e5301bb2d993984c62cdf2fd07b361e6bca (diff)
parentc8355b22c047c9737e32f096b816edbb8b0fa181 (diff)
downloadUXP-e272829137195b46612b7664c9416364089f7baa.tar
UXP-e272829137195b46612b7664c9416364089f7baa.tar.gz
UXP-e272829137195b46612b7664c9416364089f7baa.tar.lz
UXP-e272829137195b46612b7664c9416364089f7baa.tar.xz
UXP-e272829137195b46612b7664c9416364089f7baa.zip
Merge pull request #34 from janekptacijarabaci/devtools_import-from-moebius_1
Port across devtools enhancements
Diffstat (limited to 'devtools/client/netmonitor/test/browser_net_curl-utils.js')
-rw-r--r--devtools/client/netmonitor/test/browser_net_curl-utils.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/devtools/client/netmonitor/test/browser_net_curl-utils.js b/devtools/client/netmonitor/test/browser_net_curl-utils.js
index 7a5fc7926..0d35c6141 100644
--- a/devtools/client/netmonitor/test/browser_net_curl-utils.js
+++ b/devtools/client/netmonitor/test/browser_net_curl-utils.js
@@ -7,7 +7,7 @@
* Tests Curl Utils functionality.
*/
-const { CurlUtils } = require("devtools/client/shared/curl");
+const { Curl, CurlUtils } = require("devtools/client/shared/curl");
add_task(function* () {
let { tab, monitor } = yield initNetMonitor(CURL_UTILS_URL);
@@ -37,6 +37,8 @@ add_task(function* () {
data = yield createCurlData(requests.post.attachment, gNetwork);
testIsUrlEncodedRequest(data);
testWritePostDataTextParams(data);
+ testWriteEmptyPostDataTextParams(data);
+ testDataArgumentOnGeneratedCommand(data);
data = yield createCurlData(requests.multipart.attachment, gNetwork);
testIsMultipartRequest(data);
@@ -85,6 +87,18 @@ function testWritePostDataTextParams(data) {
"Should return a serialized representation of the request parameters");
}
+function testWriteEmptyPostDataTextParams(data) {
+ let params = CurlUtils.writePostDataTextParams(null);
+ is(params, "",
+ "Should return a empty string when no parameters provided");
+}
+
+function testDataArgumentOnGeneratedCommand(data) {
+ let curlCommand = Curl.generateCommand(data);
+ ok(curlCommand.includes("--data"),
+ "Should return a curl command with --data");
+}
+
function testGetMultipartBoundary(data) {
let boundary = CurlUtils.getMultipartBoundary(data);
ok(/-{3,}\w+/.test(boundary),