зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1297082 - Part 1: Convert Curl.jsm to a CommonJS module r=Honza
MozReview-Commit-ID: LI7Ra1w3RBj --HG-- extra : rebase_source : 28ea664d54b860e09ec3aff049a79d5948d95770
This commit is contained in:
Родитель
95dd013945
Коммит
d436f89be9
|
@ -124,12 +124,6 @@ XPCOMUtils.defineConstant(this, "Editor", Editor);
|
|||
XPCOMUtils.defineLazyModuleGetter(this, "Chart",
|
||||
"resource://devtools/client/shared/widgets/Chart.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Curl",
|
||||
"resource://devtools/client/shared/Curl.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "CurlUtils",
|
||||
"resource://devtools/client/shared/Curl.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
|
||||
"resource://gre/modules/PluralForm.jsm");
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ const {PrefsHelper} = require("devtools/client/shared/prefs");
|
|||
const {ViewHelpers, Heritage, WidgetMethods, setNamedTimeout} =
|
||||
require("devtools/client/shared/widgets/view-helpers");
|
||||
const {gDevTools} = require("devtools/client/framework/devtools");
|
||||
const {Curl, CurlUtils} = require("devtools/client/shared/curl");
|
||||
|
||||
/**
|
||||
* Localization convenience methods.
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Tests Curl Utils functionality.
|
||||
*/
|
||||
|
||||
const { CurlUtils } = require("devtools/client/shared/curl");
|
||||
|
||||
function test() {
|
||||
initNetMonitor(CURL_UTILS_URL).then(([aTab, aDebuggee, aMonitor]) => {
|
||||
info("Starting test... ");
|
||||
|
|
|
@ -9,7 +9,6 @@ Services.scriptloader.loadSubScript(
|
|||
"chrome://mochitests/content/browser/devtools/client/framework/test/shared-head.js",
|
||||
this);
|
||||
|
||||
var { CurlUtils } = Cu.import("resource://devtools/client/shared/Curl.jsm", {});
|
||||
var NetworkHelper = require("devtools/shared/webconsole/network-helper");
|
||||
var { Toolbox } = require("devtools/client/framework/toolbox");
|
||||
|
||||
|
|
|
@ -37,13 +37,11 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["Curl", "CurlUtils"];
|
||||
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
const Services = require("Services");
|
||||
|
||||
const DEFAULT_HTTP_VERSION = "HTTP/1.1";
|
||||
|
||||
this.Curl = {
|
||||
const Curl = {
|
||||
/**
|
||||
* Generates a cURL command string which can be used from the command line etc.
|
||||
*
|
||||
|
@ -138,10 +136,12 @@ this.Curl = {
|
|||
}
|
||||
};
|
||||
|
||||
exports.Curl = Curl;
|
||||
|
||||
/**
|
||||
* Utility functions for the Curl command generator.
|
||||
*/
|
||||
this.CurlUtils = {
|
||||
const CurlUtils = {
|
||||
/**
|
||||
* Check if the request is an URL encoded request.
|
||||
*
|
||||
|
@ -398,3 +398,5 @@ this.CurlUtils = {
|
|||
.replace(/[\r\n]+/g, "\"^$&\"") + "\"";
|
||||
}
|
||||
};
|
||||
|
||||
exports.CurlUtils = CurlUtils;
|
|
@ -21,7 +21,7 @@ DevToolsModules(
|
|||
'browser-loader.js',
|
||||
'css-angle.js',
|
||||
'css-reload.js',
|
||||
'Curl.jsm',
|
||||
'curl.js',
|
||||
'demangle.js',
|
||||
'developer-toolbar.js',
|
||||
'devices.js',
|
||||
|
|
Загрузка…
Ссылка в новой задаче