зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1338567 - Update debugger frontend (2/10/2017) r=jdescottes.
MozReview-Commit-ID: 1Sl9jB0M0af --HG-- extra : rebase_source : 772a73f4139dccc003c107793292b2fe44d2d5bb
This commit is contained in:
Родитель
a539a77119
Коммит
bd7f27ff38
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -21,11 +21,11 @@
|
|||
src="chrome://devtools/content/shared/theme-switching.js"></script>
|
||||
<script type="text/javascript">
|
||||
const { BrowserLoader } = Components.utils.import("resource://devtools/client/shared/browser-loader.js", {});
|
||||
const { require: devtoolsRequire } = BrowserLoader({
|
||||
const { require } = BrowserLoader({
|
||||
baseURI: "resource://devtools/client/debugger/new/",
|
||||
window,
|
||||
});
|
||||
Debugger = require("devtools/client/debugger/new/debugger");
|
||||
</script>
|
||||
<script type="text/javascript" src="resource://devtools/client/debugger/new/debugger.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -6,6 +6,7 @@
|
|||
DevToolsModules(
|
||||
'debugger.css',
|
||||
'debugger.js',
|
||||
'integration-tests.js',
|
||||
'panel.js',
|
||||
'pretty-print-worker.js',
|
||||
'source-map-worker.js'
|
||||
|
|
|
@ -1,34 +1,19 @@
|
|||
var Debugger =
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
(function webpackUniversalModuleDefinition(root, factory) {
|
||||
if(typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = factory();
|
||||
else if(typeof define === 'function' && define.amd)
|
||||
define([], factory);
|
||||
else {
|
||||
var a = factory();
|
||||
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
||||
}
|
||||
})(this, function() {
|
||||
return /******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/ // SingleModulePlugin
|
||||
/******/ const smpCache = this.smpCache = this.smpCache || {};
|
||||
/******/ const smpMap = this.smpMap = this.smpMap || new Map();
|
||||
/******/ function sanitizeString(text) {
|
||||
/******/ return text.replace(/__webpack_require__\(\d+\)/g,"");
|
||||
/******/ }
|
||||
/******/ function getModuleBody(id) {
|
||||
/******/ if (smpCache.hasOwnProperty(id)) {
|
||||
/******/ return smpCache[id];
|
||||
/******/ }
|
||||
/******/
|
||||
/******/ const body = sanitizeString(String(modules[id]));
|
||||
/******/ smpCache[id] = body;
|
||||
/******/ return body;
|
||||
/******/ }
|
||||
/******/ if (!installedModules[moduleId]) {
|
||||
/******/ const body = getModuleBody(moduleId);
|
||||
/******/ if (smpMap.has(body)) {
|
||||
/******/ installedModules[moduleId] = installedModules[smpMap.get(body)];
|
||||
/******/ }
|
||||
/******/ else {
|
||||
/******/ smpMap.set(body, moduleId)
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId])
|
||||
|
@ -70,14 +55,16 @@ var Debugger =
|
|||
/***/ 0:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(679);
|
||||
module.exports = __webpack_require__(788);
|
||||
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 252:
|
||||
/***/ 223:
|
||||
/***/ function(module, exports) {
|
||||
|
||||
"use strict";
|
||||
|
||||
function assert(condition, message) {
|
||||
if (!condition) {
|
||||
throw new Error(`Assertion failure: ${message}`);
|
||||
|
@ -88,11 +75,13 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 679:
|
||||
/***/ 788:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var prettyFast = __webpack_require__(680);
|
||||
var assert = __webpack_require__(252);
|
||||
"use strict";
|
||||
|
||||
var prettyFast = __webpack_require__(789);
|
||||
var assert = __webpack_require__(223);
|
||||
|
||||
function prettyPrint(_ref) {
|
||||
var url = _ref.url,
|
||||
|
@ -110,7 +99,7 @@ var Debugger =
|
|||
mappings: prettified.map._mappings
|
||||
};
|
||||
} catch (e) {
|
||||
return new Error(`${ e.message }\n${ e.stack }`);
|
||||
throw new Error(`${e.message}\n${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -156,7 +145,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 680:
|
||||
/***/ 789:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/* -*- indent-tabs-mode: nil; js-indent-level: 2; fill-column: 80 -*- */
|
||||
|
@ -178,8 +167,8 @@ var Debugger =
|
|||
}(this, function () {
|
||||
"use strict";
|
||||
|
||||
var acorn = this.acorn || __webpack_require__(681);
|
||||
var sourceMap = this.sourceMap || __webpack_require__(682);
|
||||
var acorn = this.acorn || __webpack_require__(790);
|
||||
var sourceMap = this.sourceMap || __webpack_require__(791);
|
||||
var SourceNode = sourceMap.SourceNode;
|
||||
|
||||
// If any of these tokens are seen before a "[" token, we know that "[" token
|
||||
|
@ -1038,7 +1027,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 681:
|
||||
/***/ 790:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Acorn is a tiny, fast JavaScript parser written in JavaScript.
|
||||
|
@ -3698,7 +3687,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 682:
|
||||
/***/ 791:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
/*
|
||||
|
@ -3706,14 +3695,14 @@ var Debugger =
|
|||
* Licensed under the New BSD license. See LICENSE.txt or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
exports.SourceMapGenerator = __webpack_require__(683).SourceMapGenerator;
|
||||
exports.SourceMapConsumer = __webpack_require__(689).SourceMapConsumer;
|
||||
exports.SourceNode = __webpack_require__(691).SourceNode;
|
||||
exports.SourceMapGenerator = __webpack_require__(792).SourceMapGenerator;
|
||||
exports.SourceMapConsumer = __webpack_require__(798).SourceMapConsumer;
|
||||
exports.SourceNode = __webpack_require__(800).SourceNode;
|
||||
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 683:
|
||||
/***/ 792:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_RESULT__;/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
|
@ -3727,10 +3716,10 @@ var Debugger =
|
|||
}
|
||||
!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, module) {
|
||||
|
||||
var base64VLQ = __webpack_require__(684);
|
||||
var util = __webpack_require__(686);
|
||||
var ArraySet = __webpack_require__(687).ArraySet;
|
||||
var MappingList = __webpack_require__(688).MappingList;
|
||||
var base64VLQ = __webpack_require__(793);
|
||||
var util = __webpack_require__(795);
|
||||
var ArraySet = __webpack_require__(796).ArraySet;
|
||||
var MappingList = __webpack_require__(797).MappingList;
|
||||
|
||||
/**
|
||||
* An instance of the SourceMapGenerator represents a source map which is
|
||||
|
@ -4120,7 +4109,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 684:
|
||||
/***/ 793:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_RESULT__;/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
|
@ -4164,7 +4153,7 @@ var Debugger =
|
|||
}
|
||||
!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, module) {
|
||||
|
||||
var base64 = __webpack_require__(685);
|
||||
var base64 = __webpack_require__(794);
|
||||
|
||||
// A single base 64 digit can contain 6 bits of data. For the base 64 variable
|
||||
// length quantities we use in the source map spec, the first bit is the sign,
|
||||
|
@ -4269,7 +4258,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 685:
|
||||
/***/ 794:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_RESULT__;/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
|
@ -4318,7 +4307,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 686:
|
||||
/***/ 795:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_RESULT__;/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
|
@ -4644,7 +4633,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 687:
|
||||
/***/ 796:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_RESULT__;/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
|
@ -4658,7 +4647,7 @@ var Debugger =
|
|||
}
|
||||
!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, module) {
|
||||
|
||||
var util = __webpack_require__(686);
|
||||
var util = __webpack_require__(795);
|
||||
|
||||
/**
|
||||
* A data structure which is a combination of an array and a set. Adding a new
|
||||
|
@ -4748,7 +4737,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 688:
|
||||
/***/ 797:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_RESULT__;/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
|
@ -4762,7 +4751,7 @@ var Debugger =
|
|||
}
|
||||
!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, module) {
|
||||
|
||||
var util = __webpack_require__(686);
|
||||
var util = __webpack_require__(795);
|
||||
|
||||
/**
|
||||
* Determine whether mappingB is after mappingA with respect to generated
|
||||
|
@ -4841,7 +4830,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 689:
|
||||
/***/ 798:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_RESULT__;/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
|
@ -4855,10 +4844,10 @@ var Debugger =
|
|||
}
|
||||
!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, module) {
|
||||
|
||||
var util = __webpack_require__(686);
|
||||
var binarySearch = __webpack_require__(690);
|
||||
var ArraySet = __webpack_require__(687).ArraySet;
|
||||
var base64VLQ = __webpack_require__(684);
|
||||
var util = __webpack_require__(795);
|
||||
var binarySearch = __webpack_require__(799);
|
||||
var ArraySet = __webpack_require__(796).ArraySet;
|
||||
var base64VLQ = __webpack_require__(793);
|
||||
|
||||
/**
|
||||
* A SourceMapConsumer instance represents a parsed source map which we can
|
||||
|
@ -5423,7 +5412,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 690:
|
||||
/***/ 799:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_RESULT__;/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
|
@ -5510,7 +5499,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 691:
|
||||
/***/ 800:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_RESULT__;/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
|
@ -5524,8 +5513,8 @@ var Debugger =
|
|||
}
|
||||
!(__WEBPACK_AMD_DEFINE_RESULT__ = function (require, exports, module) {
|
||||
|
||||
var SourceMapGenerator = __webpack_require__(683).SourceMapGenerator;
|
||||
var util = __webpack_require__(686);
|
||||
var SourceMapGenerator = __webpack_require__(792).SourceMapGenerator;
|
||||
var util = __webpack_require__(795);
|
||||
|
||||
// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
|
||||
// operating systems these days (capturing the result).
|
||||
|
@ -5931,5 +5920,7 @@ var Debugger =
|
|||
|
||||
/***/ }
|
||||
|
||||
/******/ });
|
||||
/******/ })
|
||||
});
|
||||
;
|
||||
//# sourceMappingURL=pretty-print-worker.js.map
|
|
@ -1,34 +1,19 @@
|
|||
var Debugger =
|
||||
/******/ (function(modules) { // webpackBootstrap
|
||||
(function webpackUniversalModuleDefinition(root, factory) {
|
||||
if(typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = factory();
|
||||
else if(typeof define === 'function' && define.amd)
|
||||
define([], factory);
|
||||
else {
|
||||
var a = factory();
|
||||
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
||||
}
|
||||
})(this, function() {
|
||||
return /******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/ // SingleModulePlugin
|
||||
/******/ const smpCache = this.smpCache = this.smpCache || {};
|
||||
/******/ const smpMap = this.smpMap = this.smpMap || new Map();
|
||||
/******/ function sanitizeString(text) {
|
||||
/******/ return text.replace(/__webpack_require__\(\d+\)/g,"");
|
||||
/******/ }
|
||||
/******/ function getModuleBody(id) {
|
||||
/******/ if (smpCache.hasOwnProperty(id)) {
|
||||
/******/ return smpCache[id];
|
||||
/******/ }
|
||||
/******/
|
||||
/******/ const body = sanitizeString(String(modules[id]));
|
||||
/******/ smpCache[id] = body;
|
||||
/******/ return body;
|
||||
/******/ }
|
||||
/******/ if (!installedModules[moduleId]) {
|
||||
/******/ const body = getModuleBody(moduleId);
|
||||
/******/ if (smpMap.has(body)) {
|
||||
/******/ installedModules[moduleId] = installedModules[smpMap.get(body)];
|
||||
/******/ }
|
||||
/******/ else {
|
||||
/******/ smpMap.set(body, moduleId)
|
||||
/******/ }
|
||||
/******/ }
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId])
|
||||
|
@ -70,7 +55,7 @@ var Debugger =
|
|||
/***/ 0:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
module.exports = __webpack_require__(692);
|
||||
module.exports = __webpack_require__(801);
|
||||
|
||||
|
||||
/***/ },
|
||||
|
@ -92,7 +77,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 125:
|
||||
/***/ 127:
|
||||
/***/ function(module, exports) {
|
||||
|
||||
function networkRequest(url, opts) {
|
||||
|
@ -128,253 +113,10 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 250:
|
||||
/***/ 223:
|
||||
/***/ function(module, exports) {
|
||||
|
||||
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
|
||||
|
||||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
||||
|
||||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/**
|
||||
* Utils for utils, by utils
|
||||
* @module utils/utils
|
||||
*/
|
||||
|
||||
/**
|
||||
* @memberof utils/utils
|
||||
* @static
|
||||
*/
|
||||
function handleError(err) {
|
||||
console.log("ERROR: ", err);
|
||||
}
|
||||
|
||||
/**
|
||||
* @memberof utils/utils
|
||||
* @static
|
||||
*/
|
||||
function promisify(context, method) {
|
||||
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
||||
args[_key - 2] = arguments[_key];
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
args.push(response => {
|
||||
if (response.error) {
|
||||
reject(response);
|
||||
} else {
|
||||
resolve(response);
|
||||
}
|
||||
});
|
||||
method.apply(context, args);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @memberof utils/utils
|
||||
* @static
|
||||
*/
|
||||
function truncateStr(str, size) {
|
||||
if (str.length > size) {
|
||||
return `${ str.slice(0, size) }...`;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* @memberof utils/utils
|
||||
* @static
|
||||
*/
|
||||
function endTruncateStr(str, size) {
|
||||
if (str.length > size) {
|
||||
return `...${ str.slice(str.length - size) }`;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
var msgId = 1;
|
||||
/**
|
||||
* @memberof utils/utils
|
||||
* @static
|
||||
*/
|
||||
function workerTask(worker, method) {
|
||||
return function () {
|
||||
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
args[_key2] = arguments[_key2];
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
var id = msgId++;
|
||||
worker.postMessage({ id, method, args });
|
||||
|
||||
var listener = (_ref) => {
|
||||
var result = _ref.data;
|
||||
|
||||
if (result.id !== id) {
|
||||
return;
|
||||
}
|
||||
|
||||
worker.removeEventListener("message", listener);
|
||||
if (result.error) {
|
||||
reject(result.error);
|
||||
} else {
|
||||
resolve(result.response);
|
||||
}
|
||||
};
|
||||
|
||||
worker.addEventListener("message", listener);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Interleaves two arrays element by element, returning the combined array, like
|
||||
* a zip. In the case of arrays with different sizes, undefined values will be
|
||||
* interleaved at the end along with the extra values of the larger array.
|
||||
*
|
||||
* @param Array a
|
||||
* @param Array b
|
||||
* @returns Array
|
||||
* The combined array, in the form [a1, b1, a2, b2, ...]
|
||||
* @memberof utils/utils
|
||||
* @static
|
||||
*/
|
||||
function zip(a, b) {
|
||||
if (!b) {
|
||||
return a;
|
||||
}
|
||||
if (!a) {
|
||||
return b;
|
||||
}
|
||||
var pairs = [];
|
||||
for (var i = 0, aLength = a.length, bLength = b.length; i < aLength || i < bLength; i++) {
|
||||
pairs.push([a[i], b[i]]);
|
||||
}
|
||||
return pairs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts an object into an array with 2-element arrays as key/value
|
||||
* pairs of the object. `{ foo: 1, bar: 2}` would become
|
||||
* `[[foo, 1], [bar 2]]` (order not guaranteed);
|
||||
*
|
||||
* @returns array
|
||||
* @memberof utils/utils
|
||||
* @static
|
||||
*/
|
||||
function entries(obj) {
|
||||
return Object.keys(obj).map(k => [k, obj[k]]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @memberof utils/utils
|
||||
* @static
|
||||
*/
|
||||
function mapObject(obj, iteratee) {
|
||||
return toObject(entries(obj).map((_ref2) => {
|
||||
var _ref3 = _slicedToArray(_ref2, 2),
|
||||
key = _ref3[0],
|
||||
value = _ref3[1];
|
||||
|
||||
return [key, iteratee(key, value)];
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes an array of 2-element arrays as key/values pairs and
|
||||
* constructs an object using them.
|
||||
* @memberof utils/utils
|
||||
* @static
|
||||
*/
|
||||
function toObject(arr) {
|
||||
var obj = {};
|
||||
for (var pair of arr) {
|
||||
obj[pair[0]] = pair[1];
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Composes the given functions into a single function, which will
|
||||
* apply the results of each function right-to-left, starting with
|
||||
* applying the given arguments to the right-most function.
|
||||
* `compose(foo, bar, baz)` === `args => foo(bar(baz(args)`
|
||||
*
|
||||
* @param ...function funcs
|
||||
* @returns function
|
||||
* @memberof utils/utils
|
||||
* @static
|
||||
*/
|
||||
function compose() {
|
||||
for (var _len3 = arguments.length, funcs = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
||||
funcs[_key3] = arguments[_key3];
|
||||
}
|
||||
|
||||
return function () {
|
||||
for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
||||
args[_key4] = arguments[_key4];
|
||||
}
|
||||
|
||||
var initialValue = funcs[funcs.length - 1].apply(null, args);
|
||||
var leftFuncs = funcs.slice(0, -1);
|
||||
return leftFuncs.reduceRight((composed, f) => f(composed), initialValue);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @memberof utils/utils
|
||||
* @static
|
||||
*/
|
||||
function updateObj(obj, fields) {
|
||||
return Object.assign({}, obj, fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* @memberof utils/utils
|
||||
* @static
|
||||
*/
|
||||
function throttle(func, ms) {
|
||||
var timeout = void 0,
|
||||
_this = void 0;
|
||||
return function () {
|
||||
for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
||||
args[_key5] = arguments[_key5];
|
||||
}
|
||||
|
||||
_this = this;
|
||||
if (!timeout) {
|
||||
timeout = setTimeout(() => {
|
||||
func.apply.apply(func, [_this].concat(_toConsumableArray(args)));
|
||||
timeout = null;
|
||||
}, ms);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
handleError,
|
||||
promisify,
|
||||
truncateStr,
|
||||
endTruncateStr,
|
||||
workerTask,
|
||||
zip,
|
||||
entries,
|
||||
toObject,
|
||||
mapObject,
|
||||
compose,
|
||||
updateObj,
|
||||
throttle
|
||||
};
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 252:
|
||||
/***/ function(module, exports) {
|
||||
"use strict";
|
||||
|
||||
function assert(condition, message) {
|
||||
if (!condition) {
|
||||
|
@ -386,20 +128,20 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 295:
|
||||
/***/ 233:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Utils for working with Source URLs
|
||||
* @module utils/source
|
||||
*/
|
||||
|
||||
var _require = __webpack_require__(250),
|
||||
var _require = __webpack_require__(234),
|
||||
endTruncateStr = _require.endTruncateStr;
|
||||
|
||||
var _require2 = __webpack_require__(296),
|
||||
var _require2 = __webpack_require__(235),
|
||||
basename = _require2.basename;
|
||||
|
||||
/**
|
||||
|
@ -569,9 +311,150 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 296:
|
||||
/***/ 234:
|
||||
/***/ function(module, exports) {
|
||||
|
||||
"use strict";
|
||||
|
||||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
||||
|
||||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/**
|
||||
* Utils for utils, by utils
|
||||
* @module utils/utils
|
||||
*/
|
||||
|
||||
/**
|
||||
* @memberof utils/utils
|
||||
* @static
|
||||
*/
|
||||
function handleError(err) {
|
||||
console.log("ERROR: ", err);
|
||||
}
|
||||
|
||||
/**
|
||||
* @memberof utils/utils
|
||||
* @static
|
||||
*/
|
||||
function promisify(context, method) {
|
||||
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
||||
args[_key - 2] = arguments[_key];
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
args.push(response => {
|
||||
if (response.error) {
|
||||
reject(response);
|
||||
} else {
|
||||
resolve(response);
|
||||
}
|
||||
});
|
||||
method.apply(context, args);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @memberof utils/utils
|
||||
* @static
|
||||
*/
|
||||
function endTruncateStr(str, size) {
|
||||
if (str.length > size) {
|
||||
return `...${str.slice(str.length - size)}`;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
var msgId = 1;
|
||||
/**
|
||||
* @memberof utils/utils
|
||||
* @static
|
||||
*/
|
||||
function workerTask(worker, method) {
|
||||
return function () {
|
||||
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
||||
args[_key2] = arguments[_key2];
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
var id = msgId++;
|
||||
worker.postMessage({ id, method, args });
|
||||
|
||||
var listener = (_ref) => {
|
||||
var result = _ref.data;
|
||||
|
||||
if (result.id !== id) {
|
||||
return;
|
||||
}
|
||||
|
||||
worker.removeEventListener("message", listener);
|
||||
if (result.error) {
|
||||
reject(result.error);
|
||||
} else {
|
||||
resolve(result.response);
|
||||
}
|
||||
};
|
||||
|
||||
worker.addEventListener("message", listener);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @memberof utils/utils
|
||||
* @static
|
||||
*/
|
||||
function updateObj(obj, fields) {
|
||||
return Object.assign({}, obj, fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* @memberof utils/utils
|
||||
* @static
|
||||
*/
|
||||
function throttle(func, ms) {
|
||||
var timeout = void 0,
|
||||
_this = void 0;
|
||||
return function () {
|
||||
for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
||||
args[_key3] = arguments[_key3];
|
||||
}
|
||||
|
||||
_this = this;
|
||||
if (!timeout) {
|
||||
timeout = setTimeout(() => {
|
||||
func.apply.apply(func, [_this].concat(_toConsumableArray(args)));
|
||||
timeout = null;
|
||||
}, ms);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function waitForMs(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
handleError,
|
||||
promisify,
|
||||
endTruncateStr,
|
||||
workerTask,
|
||||
updateObj,
|
||||
throttle,
|
||||
waitForMs
|
||||
};
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 235:
|
||||
/***/ function(module, exports) {
|
||||
|
||||
"use strict";
|
||||
|
||||
function basename(path) {
|
||||
return path.split("/").pop();
|
||||
}
|
||||
|
@ -599,10 +482,12 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 317:
|
||||
/***/ 247:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var md5 = __webpack_require__(318);
|
||||
"use strict";
|
||||
|
||||
var md5 = __webpack_require__(248);
|
||||
|
||||
function originalToGeneratedId(originalId) {
|
||||
var match = originalId.match(/(.*)\/originalSource/);
|
||||
|
@ -627,14 +512,14 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 318:
|
||||
/***/ 248:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
(function(){
|
||||
var crypt = __webpack_require__(319),
|
||||
utf8 = __webpack_require__(320).utf8,
|
||||
isBuffer = __webpack_require__(321),
|
||||
bin = __webpack_require__(320).bin,
|
||||
var crypt = __webpack_require__(249),
|
||||
utf8 = __webpack_require__(250).utf8,
|
||||
isBuffer = __webpack_require__(251),
|
||||
bin = __webpack_require__(250).bin,
|
||||
|
||||
// The core
|
||||
md5 = function (message, options) {
|
||||
|
@ -794,7 +679,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 319:
|
||||
/***/ 249:
|
||||
/***/ function(module, exports) {
|
||||
|
||||
(function() {
|
||||
|
@ -897,7 +782,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 320:
|
||||
/***/ 250:
|
||||
/***/ function(module, exports) {
|
||||
|
||||
var charenc = {
|
||||
|
@ -937,7 +822,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 321:
|
||||
/***/ 251:
|
||||
/***/ function(module, exports) {
|
||||
|
||||
/*!
|
||||
|
@ -965,7 +850,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 398:
|
||||
/***/ 568:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
// Copyright Joyent, Inc. and other Node contributors.
|
||||
|
@ -991,8 +876,8 @@ var Debugger =
|
|||
|
||||
'use strict';
|
||||
|
||||
var punycode = __webpack_require__(399);
|
||||
var util = __webpack_require__(400);
|
||||
var punycode = __webpack_require__(569);
|
||||
var util = __webpack_require__(570);
|
||||
|
||||
exports.parse = urlParse;
|
||||
exports.resolve = urlResolve;
|
||||
|
@ -1067,7 +952,7 @@ var Debugger =
|
|||
'gopher:': true,
|
||||
'file:': true
|
||||
},
|
||||
querystring = __webpack_require__(401);
|
||||
querystring = __webpack_require__(571);
|
||||
|
||||
function urlParse(url, parseQueryString, slashesDenoteHost) {
|
||||
if (url && util.isObject(url) && url instanceof Url) return url;
|
||||
|
@ -1704,7 +1589,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 399:
|
||||
/***/ 569:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/punycode v1.3.2 by @mathias */
|
||||
|
@ -2240,7 +2125,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 400:
|
||||
/***/ 570:
|
||||
/***/ function(module, exports) {
|
||||
|
||||
'use strict';
|
||||
|
@ -2263,18 +2148,18 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 401:
|
||||
/***/ 571:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
'use strict';
|
||||
|
||||
exports.decode = exports.parse = __webpack_require__(402);
|
||||
exports.encode = exports.stringify = __webpack_require__(403);
|
||||
exports.decode = exports.parse = __webpack_require__(572);
|
||||
exports.encode = exports.stringify = __webpack_require__(573);
|
||||
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 402:
|
||||
/***/ 572:
|
||||
/***/ function(module, exports) {
|
||||
|
||||
// Copyright Joyent, Inc. and other Node contributors.
|
||||
|
@ -2361,7 +2246,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 403:
|
||||
/***/ 573:
|
||||
/***/ function(module, exports) {
|
||||
|
||||
// Copyright Joyent, Inc. and other Node contributors.
|
||||
|
@ -2432,9 +2317,11 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 692:
|
||||
/***/ 801:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var _resolveAndFetch = (() => {
|
||||
var _ref = _asyncToGenerator(function* (generatedSource) {
|
||||
// Fetch the sourcemap over the network and create it.
|
||||
|
@ -2566,23 +2453,23 @@ var Debugger =
|
|||
* @module utils/source-map-worker
|
||||
*/
|
||||
|
||||
var networkRequest = __webpack_require__(125);
|
||||
var networkRequest = __webpack_require__(127);
|
||||
|
||||
var _require = __webpack_require__(398),
|
||||
var _require = __webpack_require__(568),
|
||||
parse = _require.parse;
|
||||
|
||||
var path = __webpack_require__(296);
|
||||
var path = __webpack_require__(235);
|
||||
|
||||
var _require2 = __webpack_require__(693),
|
||||
var _require2 = __webpack_require__(802),
|
||||
SourceMapConsumer = _require2.SourceMapConsumer,
|
||||
SourceMapGenerator = _require2.SourceMapGenerator;
|
||||
|
||||
var _require3 = __webpack_require__(295),
|
||||
var _require3 = __webpack_require__(233),
|
||||
getContentType = _require3.getContentType;
|
||||
|
||||
var assert = __webpack_require__(252);
|
||||
var assert = __webpack_require__(223);
|
||||
|
||||
var _require4 = __webpack_require__(317),
|
||||
var _require4 = __webpack_require__(247),
|
||||
originalToGeneratedId = _require4.originalToGeneratedId,
|
||||
generatedToOriginalId = _require4.generatedToOriginalId,
|
||||
isGeneratedId = _require4.isGeneratedId,
|
||||
|
@ -2710,7 +2597,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 693:
|
||||
/***/ 802:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
/*
|
||||
|
@ -2718,14 +2605,14 @@ var Debugger =
|
|||
* Licensed under the New BSD license. See LICENSE.txt or:
|
||||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
exports.SourceMapGenerator = __webpack_require__(694).SourceMapGenerator;
|
||||
exports.SourceMapConsumer = __webpack_require__(700).SourceMapConsumer;
|
||||
exports.SourceNode = __webpack_require__(703).SourceNode;
|
||||
exports.SourceMapGenerator = __webpack_require__(803).SourceMapGenerator;
|
||||
exports.SourceMapConsumer = __webpack_require__(809).SourceMapConsumer;
|
||||
exports.SourceNode = __webpack_require__(812).SourceNode;
|
||||
|
||||
|
||||
/***/ },
|
||||
|
||||
/***/ 694:
|
||||
/***/ 803:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
|
@ -2735,10 +2622,10 @@ var Debugger =
|
|||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var base64VLQ = __webpack_require__(695);
|
||||
var util = __webpack_require__(697);
|
||||
var ArraySet = __webpack_require__(698).ArraySet;
|
||||
var MappingList = __webpack_require__(699).MappingList;
|
||||
var base64VLQ = __webpack_require__(804);
|
||||
var util = __webpack_require__(806);
|
||||
var ArraySet = __webpack_require__(807).ArraySet;
|
||||
var MappingList = __webpack_require__(808).MappingList;
|
||||
|
||||
/**
|
||||
* An instance of the SourceMapGenerator represents a source map which is
|
||||
|
@ -3136,7 +3023,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 695:
|
||||
/***/ 804:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
|
@ -3176,7 +3063,7 @@ var Debugger =
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
var base64 = __webpack_require__(696);
|
||||
var base64 = __webpack_require__(805);
|
||||
|
||||
// A single base 64 digit can contain 6 bits of data. For the base 64 variable
|
||||
// length quantities we use in the source map spec, the first bit is the sign,
|
||||
|
@ -3283,7 +3170,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 696:
|
||||
/***/ 805:
|
||||
/***/ function(module, exports) {
|
||||
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
|
@ -3357,7 +3244,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 697:
|
||||
/***/ 806:
|
||||
/***/ function(module, exports) {
|
||||
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
|
@ -3781,7 +3668,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 698:
|
||||
/***/ 807:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
|
@ -3791,7 +3678,7 @@ var Debugger =
|
|||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var util = __webpack_require__(697);
|
||||
var util = __webpack_require__(806);
|
||||
var has = Object.prototype.hasOwnProperty;
|
||||
|
||||
/**
|
||||
|
@ -3892,7 +3779,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 699:
|
||||
/***/ 808:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
|
@ -3902,7 +3789,7 @@ var Debugger =
|
|||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var util = __webpack_require__(697);
|
||||
var util = __webpack_require__(806);
|
||||
|
||||
/**
|
||||
* Determine whether mappingB is after mappingA with respect to generated
|
||||
|
@ -3978,7 +3865,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 700:
|
||||
/***/ 809:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
|
@ -3988,11 +3875,11 @@ var Debugger =
|
|||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var util = __webpack_require__(697);
|
||||
var binarySearch = __webpack_require__(701);
|
||||
var ArraySet = __webpack_require__(698).ArraySet;
|
||||
var base64VLQ = __webpack_require__(695);
|
||||
var quickSort = __webpack_require__(702).quickSort;
|
||||
var util = __webpack_require__(806);
|
||||
var binarySearch = __webpack_require__(810);
|
||||
var ArraySet = __webpack_require__(807).ArraySet;
|
||||
var base64VLQ = __webpack_require__(804);
|
||||
var quickSort = __webpack_require__(811).quickSort;
|
||||
|
||||
function SourceMapConsumer(aSourceMap) {
|
||||
var sourceMap = aSourceMap;
|
||||
|
@ -5067,7 +4954,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 701:
|
||||
/***/ 810:
|
||||
/***/ function(module, exports) {
|
||||
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
|
@ -5185,7 +5072,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 702:
|
||||
/***/ 811:
|
||||
/***/ function(module, exports) {
|
||||
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
|
@ -5306,7 +5193,7 @@ var Debugger =
|
|||
|
||||
/***/ },
|
||||
|
||||
/***/ 703:
|
||||
/***/ 812:
|
||||
/***/ function(module, exports, __webpack_require__) {
|
||||
|
||||
/* -*- Mode: js; js-indent-level: 2; -*- */
|
||||
|
@ -5316,8 +5203,8 @@ var Debugger =
|
|||
* http://opensource.org/licenses/BSD-3-Clause
|
||||
*/
|
||||
|
||||
var SourceMapGenerator = __webpack_require__(694).SourceMapGenerator;
|
||||
var util = __webpack_require__(697);
|
||||
var SourceMapGenerator = __webpack_require__(803).SourceMapGenerator;
|
||||
var util = __webpack_require__(806);
|
||||
|
||||
// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
|
||||
// operating systems these days (capturing the result).
|
||||
|
@ -5720,5 +5607,7 @@ var Debugger =
|
|||
|
||||
/***/ }
|
||||
|
||||
/******/ });
|
||||
/******/ })
|
||||
});
|
||||
;
|
||||
//# sourceMappingURL=source-map-worker.js.map
|
|
@ -1,7 +1,7 @@
|
|||
[DEFAULT]
|
||||
tags = devtools
|
||||
subsuite = devtools
|
||||
skip-if = (os == 'linux' && debug && bits == 32)
|
||||
skip-if = debug # Disabled on debug platforms while tests are not run in debug on Github.
|
||||
support-files =
|
||||
head.js
|
||||
!/devtools/client/commandline/test/helpers.js
|
||||
|
@ -11,6 +11,7 @@ support-files =
|
|||
examples/sourcemaps2/main.min.js
|
||||
examples/sourcemaps2/main.js
|
||||
examples/sourcemaps2/main.js.map
|
||||
examples/doc-asm.html
|
||||
examples/doc-scripts.html
|
||||
examples/doc-script-switching.html
|
||||
examples/doc-exceptions.html
|
||||
|
@ -18,10 +19,12 @@ support-files =
|
|||
examples/doc-frames.html
|
||||
examples/doc-debugger-statements.html
|
||||
examples/doc-minified.html
|
||||
examples/doc-return-values.html
|
||||
examples/doc-sourcemaps.html
|
||||
examples/doc-sourcemaps2.html
|
||||
examples/doc-sourcemap-bogus.html
|
||||
examples/doc-sources.html
|
||||
examples/asm.js
|
||||
examples/bogus-map.js
|
||||
examples/entry.js
|
||||
examples/exceptions.js
|
||||
|
@ -37,8 +40,10 @@ support-files =
|
|||
examples/script-switching-01.js
|
||||
examples/times2.js
|
||||
|
||||
[browser_dbg-asm.js]
|
||||
[browser_dbg-breaking.js]
|
||||
[browser_dbg-breaking-from-console.js]
|
||||
skip-if = true
|
||||
[browser_dbg-breakpoints.js]
|
||||
[browser_dbg-breakpoints-cond.js]
|
||||
[browser_dbg-call-stack.js]
|
||||
|
@ -57,6 +62,7 @@ support-files =
|
|||
[browser_dbg-navigation.js]
|
||||
[browser_dbg-pretty-print.js]
|
||||
[browser_dbg-pretty-print-paused.js]
|
||||
[browser_dbg-returnvalues.js]
|
||||
[browser_dbg-searching.js]
|
||||
skip-if = true
|
||||
[browser_dbg-sourcemaps.js]
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Tests that asm.js AOT can be disabled and debugging of the asm.js code
|
||||
// is working.
|
||||
|
||||
const {
|
||||
setupTestRunner,
|
||||
asm
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
add_task(function*() {
|
||||
setupTestRunner(this);
|
||||
yield asm(this);
|
||||
});
|
|
@ -6,7 +6,7 @@
|
|||
// debugger.
|
||||
|
||||
add_task(function* () {
|
||||
const url = EXAMPLE_URL + "doc-script-switching.html";
|
||||
const url = `${EXAMPLE_URL }doc-script-switching.html`;
|
||||
const toolbox = yield openNewTabAndToolbox(url, "webconsole");
|
||||
|
||||
// Type "debugger" into console
|
||||
|
|
|
@ -3,30 +3,12 @@
|
|||
|
||||
// Tests the breakpoints are hit in various situations.
|
||||
|
||||
const {
|
||||
setupTestRunner,
|
||||
breaking
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
add_task(function*() {
|
||||
const dbg = yield initDebugger("doc-scripts.html");
|
||||
const { selectors: { getSelectedSource }, getState } = dbg;
|
||||
|
||||
// Make sure we can set a top-level breakpoint and it will be hit on
|
||||
// reload.
|
||||
yield addBreakpoint(dbg, "scripts.html", 18);
|
||||
reload(dbg);
|
||||
yield waitForPaused(dbg);
|
||||
assertPausedLocation(dbg, "scripts.html", 18);
|
||||
yield resume(dbg);
|
||||
|
||||
const paused = waitForPaused(dbg);
|
||||
|
||||
// Create an eval script that pauses itself.
|
||||
invokeInTab("doEval");
|
||||
|
||||
yield paused;
|
||||
yield resume(dbg);
|
||||
const source = getSelectedSource(getState()).toJS();
|
||||
ok(!source.url, "It is an eval source");
|
||||
|
||||
yield addBreakpoint(dbg, source, 5);
|
||||
invokeInTab("evaledFunc");
|
||||
yield waitForPaused(dbg);
|
||||
assertPausedLocation(dbg, source, 5);
|
||||
setupTestRunner(this);
|
||||
yield breaking(this);
|
||||
});
|
||||
|
|
|
@ -1,50 +1,14 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function findBreakpoint(dbg, url, line) {
|
||||
const { selectors: { getBreakpoint }, getState } = dbg;
|
||||
const source = findSource(dbg, url);
|
||||
return getBreakpoint(getState(), { sourceId: source.id, line });
|
||||
}
|
||||
// Tests basic pretty-printing functionality.
|
||||
|
||||
function setConditionalBreakpoint(dbg, index, condition) {
|
||||
return Task.spawn(function* () {
|
||||
rightClickElement(dbg, "gutter", index);
|
||||
selectMenuItem(dbg, 2);
|
||||
yield waitForElement(dbg, ".conditional-breakpoint-panel input");
|
||||
findElementWithSelector(dbg, ".conditional-breakpoint-panel input").focus();
|
||||
type(dbg, condition);
|
||||
pressKey(dbg, "Enter");
|
||||
});
|
||||
}
|
||||
const {
|
||||
breakpointsCond,
|
||||
setupTestRunner
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
add_task(function*() {
|
||||
const dbg = yield initDebugger("doc-scripts.html");
|
||||
yield selectSource(dbg, "simple2");
|
||||
|
||||
// Adding a conditional Breakpoint
|
||||
yield setConditionalBreakpoint(dbg, 5, "1");
|
||||
yield waitForDispatch(dbg, "ADD_BREAKPOINT");
|
||||
let bp = findBreakpoint(dbg, "simple2", 5);
|
||||
is(bp.condition, "1", "breakpoint is created with the condition");
|
||||
|
||||
// Editing a conditional Breakpoint
|
||||
yield setConditionalBreakpoint(dbg, 5, "2");
|
||||
yield waitForDispatch(dbg, "SET_BREAKPOINT_CONDITION");
|
||||
bp = findBreakpoint(dbg, "simple2", 5);
|
||||
is(bp.condition, "12", "breakpoint is created with the condition");
|
||||
|
||||
// Removing a conditional breakpoint
|
||||
clickElement(dbg, "gutter", 5);
|
||||
yield waitForDispatch(dbg, "REMOVE_BREAKPOINT");
|
||||
bp = findBreakpoint(dbg, "simple2", 5);
|
||||
is(bp, null, "breakpoint was removed");
|
||||
|
||||
// Adding a condition to a breakpoint
|
||||
clickElement(dbg, "gutter", 5);
|
||||
yield waitForDispatch(dbg, "ADD_BREAKPOINT");
|
||||
yield setConditionalBreakpoint(dbg, 5, "1");
|
||||
bp = findBreakpoint(dbg, "simple2", 5);
|
||||
is(bp.condition, "1", "breakpoint is created with the condition");
|
||||
setupTestRunner(this);
|
||||
yield breakpointsCond(this);
|
||||
});
|
||||
|
||||
|
|
|
@ -1,100 +1,17 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function toggleBreakpoint(dbg, index) {
|
||||
const bp = findElement(dbg, "breakpointItem", index);
|
||||
const input = bp.querySelector("input");
|
||||
input.click();
|
||||
}
|
||||
|
||||
function removeBreakpoint(dbg, index) {
|
||||
return Task.spawn(function* () {
|
||||
const bp = findElement(dbg, "breakpointItem", index);
|
||||
bp.querySelector(".close-btn").click();
|
||||
yield waitForDispatch(dbg, "REMOVE_BREAKPOINT");
|
||||
});
|
||||
}
|
||||
|
||||
function disableBreakpoint(dbg, index) {
|
||||
return Task.spawn(function* () {
|
||||
toggleBreakpoint(dbg, index);
|
||||
yield waitForDispatch(dbg, "REMOVE_BREAKPOINT");
|
||||
});
|
||||
}
|
||||
|
||||
function enableBreakpoint(dbg, index) {
|
||||
return Task.spawn(function* () {
|
||||
toggleBreakpoint(dbg, index);
|
||||
yield waitForDispatch(dbg, "ADD_BREAKPOINT");
|
||||
});
|
||||
}
|
||||
|
||||
function toggleBreakpoints(dbg) {
|
||||
return Task.spawn(function* () {
|
||||
clickElement(dbg, "toggleBreakpoints");
|
||||
yield waitForDispatch(dbg, "TOGGLE_BREAKPOINTS");
|
||||
});
|
||||
}
|
||||
|
||||
function findBreakpoint(dbg, url, line) {
|
||||
const { selectors: { getBreakpoint }, getState } = dbg;
|
||||
const source = findSource(dbg, url);
|
||||
return getBreakpoint(getState(), { sourceId: source.id, line });
|
||||
}
|
||||
|
||||
function findBreakpoints(dbg) {
|
||||
const { selectors: { getBreakpoints }, getState } = dbg;
|
||||
return getBreakpoints(getState());
|
||||
}
|
||||
const {
|
||||
breakpoints,
|
||||
setupTestRunner
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
add_task(function*() {
|
||||
const dbg = yield initDebugger("doc-scripts.html");
|
||||
|
||||
// Create two breakpoints
|
||||
yield selectSource(dbg, "simple2");
|
||||
yield addBreakpoint(dbg, "simple2", 3);
|
||||
yield addBreakpoint(dbg, "simple2", 5);
|
||||
|
||||
// Disable the first one
|
||||
yield disableBreakpoint(dbg, 1);
|
||||
let bp1 = findBreakpoint(dbg, "simple2", 3);
|
||||
let bp2 = findBreakpoint(dbg, "simple2", 5);
|
||||
is(bp1.disabled, true, "first breakpoint is disabled");
|
||||
is(bp2.disabled, false, "second breakpoint is enabled");
|
||||
|
||||
// Disable and Re-Enable the second one
|
||||
yield disableBreakpoint(dbg, 2);
|
||||
yield enableBreakpoint(dbg, 2);
|
||||
bp2 = findBreakpoint(dbg, "simple2", 5);
|
||||
is(bp2.disabled, false, "second breakpoint is enabled");
|
||||
setupTestRunner(this);
|
||||
yield breakpoints.toggle(this);
|
||||
});
|
||||
|
||||
// toggle all
|
||||
add_task(function* () {
|
||||
const dbg = yield initDebugger("doc-scripts.html");
|
||||
|
||||
// Create two breakpoints
|
||||
yield selectSource(dbg, "simple2");
|
||||
yield addBreakpoint(dbg, "simple2", 3);
|
||||
yield addBreakpoint(dbg, "simple2", 5);
|
||||
|
||||
// Disable all of the breakpoints
|
||||
yield toggleBreakpoints(dbg);
|
||||
let bp1 = findBreakpoint(dbg, "simple2", 3);
|
||||
let bp2 = findBreakpoint(dbg, "simple2", 5);
|
||||
is(bp1.disabled, true, "first breakpoint is disabled");
|
||||
is(bp2.disabled, true, "second breakpoint is disabled");
|
||||
|
||||
// Enable all of the breakpoints
|
||||
yield toggleBreakpoints(dbg);
|
||||
bp1 = findBreakpoint(dbg, "simple2", 3);
|
||||
bp2 = findBreakpoint(dbg, "simple2", 5);
|
||||
is(bp1.disabled, false, "first breakpoint is enabled");
|
||||
is(bp2.disabled, false, "second breakpoint is enabled");
|
||||
|
||||
// Remove the breakpoints
|
||||
yield removeBreakpoint(dbg, 1);
|
||||
yield removeBreakpoint(dbg, 1);
|
||||
const bps = findBreakpoints(dbg);
|
||||
is(bps.size, 0, "breakpoints are removed");
|
||||
});
|
||||
// add_task(function*() {
|
||||
// setupTestRunner(this);
|
||||
// yield breakpoints.toggleAll(this);
|
||||
// });
|
||||
|
|
|
@ -1,62 +1,17 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// checks to see if the frame is selected and the title is correct
|
||||
function isFrameSelected(dbg, index, title) {
|
||||
const $frame = findElement(dbg, "frame", index);
|
||||
const frame = dbg.selectors.getSelectedFrame(dbg.getState());
|
||||
|
||||
const elSelected = $frame.classList.contains("selected");
|
||||
const titleSelected = frame.displayName == title;
|
||||
|
||||
return elSelected && titleSelected;
|
||||
}
|
||||
|
||||
function toggleButton(dbg) {
|
||||
const callStackBody = findElement(dbg, "callStackBody");
|
||||
return callStackBody.querySelector(".show-more");
|
||||
}
|
||||
const {
|
||||
callStack,
|
||||
setupTestRunner
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
add_task(function*() {
|
||||
const dbg = yield initDebugger("doc-script-switching.html");
|
||||
|
||||
toggleCallStack(dbg);
|
||||
|
||||
const notPaused = findElement(dbg, "callStackBody").innerText;
|
||||
is(notPaused, "Not Paused", "Not paused message is shown");
|
||||
|
||||
invokeInTab("firstCall");
|
||||
yield waitForPaused(dbg);
|
||||
|
||||
ok(isFrameSelected(dbg, 1, "secondCall"), "the first frame is selected");
|
||||
|
||||
clickElement(dbg, "frame", 2);
|
||||
ok(isFrameSelected(dbg, 2, "firstCall"), "the second frame is selected");
|
||||
|
||||
let button = toggleButton(dbg);
|
||||
ok(!button, "toggle button shouldn't be there");
|
||||
setupTestRunner(this);
|
||||
yield callStack.test1(this);
|
||||
});
|
||||
|
||||
add_task(function*() {
|
||||
const dbg = yield initDebugger("doc-frames.html");
|
||||
|
||||
toggleCallStack(dbg);
|
||||
|
||||
invokeInTab("startRecursion");
|
||||
yield waitForPaused(dbg);
|
||||
|
||||
ok(isFrameSelected(dbg, 1, "recurseA"), "the first frame is selected");
|
||||
|
||||
// check to make sure that the toggle button isn't there
|
||||
let button = toggleButton(dbg);
|
||||
let frames = findAllElements(dbg, "frames");
|
||||
is(button.innerText, "Expand Rows", "toggle button should be expand");
|
||||
is(frames.length, 7, "There should be at most seven frames");
|
||||
|
||||
button.click();
|
||||
|
||||
button = toggleButton(dbg);
|
||||
frames = findAllElements(dbg, "frames");
|
||||
is(button.innerText, "Collapse Rows", "toggle button should be collapse");
|
||||
is(frames.length, 22, "All of the frames should be shown");
|
||||
setupTestRunner(this);
|
||||
yield callStack.test2(this);
|
||||
});
|
||||
|
|
|
@ -26,9 +26,9 @@ function onClose() {
|
|||
is(gProcess._dbgProcess.exitValue, (Services.appinfo.OS == "WINNT" ? 0 : 256),
|
||||
"The remote debugger process didn't die cleanly.");
|
||||
|
||||
info("process exit value: " + gProcess._dbgProcess.exitValue);
|
||||
info(`process exit value: ${ gProcess._dbgProcess.exitValue}`);
|
||||
|
||||
info("profile path: " + gProcess._dbgProfilePath);
|
||||
info(`profile path: ${ gProcess._dbgProfilePath}`);
|
||||
|
||||
finish();
|
||||
}
|
||||
|
@ -52,10 +52,10 @@ add_task(function* () {
|
|||
is(typeof gProcess._dbgProcess.pid, "number",
|
||||
"The remote debugger process doesn't have a pid (?!)");
|
||||
|
||||
info("process location: " + gProcess._dbgProcess.location);
|
||||
info("process pid: " + gProcess._dbgProcess.pid);
|
||||
info("process name: " + gProcess._dbgProcess.processName);
|
||||
info("process sig: " + gProcess._dbgProcess.processSignature);
|
||||
info(`process location: ${ gProcess._dbgProcess.location}`);
|
||||
info(`process pid: ${ gProcess._dbgProcess.pid}`);
|
||||
info(`process name: ${ gProcess._dbgProcess.processName}`);
|
||||
info(`process sig: ${ gProcess._dbgProcess.processSignature}`);
|
||||
|
||||
ok(gProcess._dbgProfilePath,
|
||||
"The remote debugger profile wasn't created properly!");
|
||||
|
@ -66,7 +66,7 @@ add_task(function* () {
|
|||
"The remote debugger profile isn't where we expect it!"
|
||||
);
|
||||
|
||||
info("profile path: " + gProcess._dbgProfilePath);
|
||||
info(`profile path: ${ gProcess._dbgProfilePath}`);
|
||||
|
||||
gProcess.close();
|
||||
});
|
||||
|
|
|
@ -46,7 +46,7 @@ function onNewGlobal() {
|
|||
|
||||
function onNewSource(event, packet) {
|
||||
if (packet.source.url.startsWith("chrome:")) {
|
||||
ok(true, "Received a new chrome source: " + packet.source.url);
|
||||
ok(true, `Received a new chrome source: ${ packet.source.url}`);
|
||||
gThreadClient.removeListener("newSource", onNewSource);
|
||||
gNewChromeSource.resolve();
|
||||
}
|
||||
|
|
|
@ -27,14 +27,19 @@ function getSplitConsole(dbg) {
|
|||
|
||||
add_task(function* () {
|
||||
Services.prefs.setBoolPref("devtools.toolbox.splitconsoleEnabled", true);
|
||||
const dbg = yield initDebugger("doc-script-switching.html");
|
||||
const dbg = yield initDebugger(
|
||||
"doc-script-switching.html"
|
||||
);
|
||||
|
||||
yield selectSource(dbg, "switching-01");
|
||||
|
||||
// open the console
|
||||
yield getSplitConsole(dbg);
|
||||
const jsterm = yield getSplitConsole(dbg);
|
||||
ok(dbg.toolbox.splitConsole, "Split console is shown.");
|
||||
|
||||
info("Evaluating a script in the console");
|
||||
yield jsterm.execute("1+1");
|
||||
|
||||
// close the console
|
||||
clickElement(dbg, "codeMirror");
|
||||
// First time to focus out of text area
|
||||
|
|
|
@ -1,54 +1,12 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function clickStepOver(dbg) {
|
||||
clickElement(dbg, "stepOver");
|
||||
return waitForPaused(dbg);
|
||||
}
|
||||
const {
|
||||
setupTestRunner,
|
||||
debuggerButtons
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
function clickStepIn(dbg) {
|
||||
clickElement(dbg, "stepIn");
|
||||
return waitForPaused(dbg);
|
||||
}
|
||||
|
||||
function clickStepOut(dbg) {
|
||||
clickElement(dbg, "stepOut");
|
||||
return waitForPaused(dbg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test debugger buttons
|
||||
* 1. resume
|
||||
* 2. stepOver
|
||||
* 3. stepIn
|
||||
* 4. stepOver to the end of a function
|
||||
* 5. stepUp at the end of a function
|
||||
*/
|
||||
add_task(function*() {
|
||||
const dbg = yield initDebugger("doc-debugger-statements.html");
|
||||
|
||||
yield reload(dbg);
|
||||
yield waitForPaused(dbg);
|
||||
assertPausedLocation(dbg, "debugger-statements.html", 8);
|
||||
|
||||
// resume
|
||||
clickElement(dbg, "resume");
|
||||
yield waitForPaused(dbg);
|
||||
assertPausedLocation(dbg, "debugger-statements.html", 12);
|
||||
|
||||
// step over
|
||||
yield clickStepOver(dbg);
|
||||
assertPausedLocation(dbg, "debugger-statements.html", 13);
|
||||
|
||||
// step into
|
||||
yield clickStepIn(dbg);
|
||||
assertPausedLocation(dbg, "debugger-statements.html", 18);
|
||||
|
||||
// step over
|
||||
yield clickStepOver(dbg);
|
||||
assertPausedLocation(dbg, "debugger-statements.html", 20);
|
||||
|
||||
// step out
|
||||
yield clickStepOut(dbg);
|
||||
assertPausedLocation(dbg, "debugger-statements.html", 20);
|
||||
setupTestRunner(this);
|
||||
yield debuggerButtons(this);
|
||||
});
|
||||
|
|
|
@ -1,64 +1,12 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Tests the breakpoint gutter and making sure breakpoint icons exist
|
||||
// correctly
|
||||
|
||||
// Utilities for interacting with the editor
|
||||
function clickGutter(dbg, line) {
|
||||
clickElement(dbg, "gutter", line);
|
||||
}
|
||||
|
||||
function getLineEl(dbg, line) {
|
||||
const lines = dbg.win.document.querySelectorAll(".CodeMirror-code > div");
|
||||
return lines[line - 1];
|
||||
}
|
||||
|
||||
function assertEditorBreakpoint(dbg, line, shouldExist) {
|
||||
const exists = !!getLineEl(dbg, line).querySelector(".new-breakpoint");
|
||||
ok(exists === shouldExist,
|
||||
"Breakpoint " + (shouldExist ? "exists" : "does not exist") +
|
||||
" on line " + line);
|
||||
}
|
||||
const {
|
||||
editorGutter,
|
||||
setupTestRunner
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
add_task(function*() {
|
||||
const dbg = yield initDebugger("doc-scripts.html");
|
||||
const { selectors: { getBreakpoints, getBreakpoint }, getState } = dbg;
|
||||
const source = findSource(dbg, "simple1.js");
|
||||
|
||||
yield selectSource(dbg, source.url);
|
||||
|
||||
// Make sure that clicking the gutter creates a breakpoint icon.
|
||||
clickGutter(dbg, 4);
|
||||
yield waitForDispatch(dbg, "ADD_BREAKPOINT");
|
||||
is(getBreakpoints(getState()).size, 1, "One breakpoint exists");
|
||||
assertEditorBreakpoint(dbg, 4, true);
|
||||
|
||||
// Make sure clicking at the same place removes the icon.
|
||||
clickGutter(dbg, 4);
|
||||
yield waitForDispatch(dbg, "REMOVE_BREAKPOINT");
|
||||
is(getBreakpoints(getState()).size, 0, "No breakpoints exist");
|
||||
assertEditorBreakpoint(dbg, 4, false);
|
||||
|
||||
// Test that a breakpoint icon slides down to the correct line.
|
||||
clickGutter(dbg, 2);
|
||||
yield waitForDispatch(dbg, "ADD_BREAKPOINT");
|
||||
is(getBreakpoints(getState()).size, 1, "One breakpoint exists");
|
||||
ok(getBreakpoint(getState(), { sourceId: source.id, line: 4 }),
|
||||
"Breakpoint has correct line");
|
||||
assertEditorBreakpoint(dbg, 2, false);
|
||||
assertEditorBreakpoint(dbg, 4, true);
|
||||
|
||||
// Do the same sliding and make sure it works if there's already a
|
||||
// breakpoint.
|
||||
clickGutter(dbg, 2);
|
||||
yield waitForDispatch(dbg, "ADD_BREAKPOINT");
|
||||
is(getBreakpoints(getState()).size, 1, "One breakpoint exists");
|
||||
assertEditorBreakpoint(dbg, 2, false);
|
||||
assertEditorBreakpoint(dbg, 4, true);
|
||||
|
||||
clickGutter(dbg, 4);
|
||||
yield waitForDispatch(dbg, "REMOVE_BREAKPOINT");
|
||||
is(getBreakpoints(getState()).size, 0, "No breakpoints exist");
|
||||
assertEditorBreakpoint(dbg, 4, false);
|
||||
setupTestRunner(this);
|
||||
yield editorGutter(this);
|
||||
});
|
||||
|
|
|
@ -1,46 +1,12 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Tests that the editor will always highight the right line, no
|
||||
// matter if the source text doesn't exist yet or even if the source
|
||||
// doesn't exist.
|
||||
const {
|
||||
setupTestRunner,
|
||||
editorHighlight
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
add_task(function*() {
|
||||
const dbg = yield initDebugger("doc-scripts.html");
|
||||
const { selectors: { getSourceText }, getState } = dbg;
|
||||
const sourceUrl = EXAMPLE_URL + "long.js";
|
||||
|
||||
// The source itself doesn't even exist yet, and using
|
||||
// `selectSourceURL` will set a pending request to load this source
|
||||
// and highlight a specific line.
|
||||
dbg.actions.selectSourceURL(sourceUrl, { line: 66 });
|
||||
|
||||
// Wait for the source text to load and make sure we're in the right
|
||||
// place.
|
||||
yield waitForDispatch(dbg, "LOAD_SOURCE_TEXT");
|
||||
assertHighlightLocation(dbg, "long.js", 66);
|
||||
|
||||
// Jump to line 16 and make sure the editor scrolled.
|
||||
yield selectSource(dbg, "long.js", 16);
|
||||
assertHighlightLocation(dbg, "long.js", 16);
|
||||
|
||||
// Make sure only one line is ever highlighted and the flash
|
||||
// animation is cancelled on old lines.
|
||||
yield selectSource(dbg, "long.js", 17);
|
||||
yield selectSource(dbg, "long.js", 18);
|
||||
assertHighlightLocation(dbg, "long.js", 18);
|
||||
is(findAllElements(dbg, "highlightLine").length, 1,
|
||||
"Only 1 line is highlighted");
|
||||
|
||||
// Test jumping to a line in a source that exists but hasn't been
|
||||
// loaded yet.
|
||||
selectSource(dbg, "simple1.js", 6);
|
||||
|
||||
// Make sure the source is in the loading state, wait for it to be
|
||||
// fully loaded, and check the highlighted line.
|
||||
const simple1 = findSource(dbg, "simple1.js");
|
||||
ok(getSourceText(getState(), simple1.id).get("loading"));
|
||||
yield waitForDispatch(dbg, "LOAD_SOURCE_TEXT");
|
||||
ok(getSourceText(getState(), simple1.id).get("text"));
|
||||
assertHighlightLocation(dbg, "simple1.js", 6);
|
||||
setupTestRunner(this);
|
||||
yield editorHighlight(this);
|
||||
});
|
||||
|
|
|
@ -1,54 +1,12 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Tests that the editor highlights the correct location when the
|
||||
// debugger pauses
|
||||
|
||||
// checks to see if the first breakpoint is visible
|
||||
function isElementVisible(dbg, elementName) {
|
||||
const bpLine = findElement(dbg, elementName);
|
||||
const cm = findElement(dbg, "codeMirror");
|
||||
return bpLine && isVisibleWithin(cm, bpLine);
|
||||
}
|
||||
const {
|
||||
setupTestRunner,
|
||||
editorSelect
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
add_task(function*() {
|
||||
// This test runs too slowly on linux debug. I'd like to figure out
|
||||
// which is the slowest part of this and make it run faster, but to
|
||||
// fix a frequent failure allow a longer timeout.
|
||||
requestLongerTimeout(2);
|
||||
|
||||
const dbg = yield initDebugger("doc-scripts.html");
|
||||
const { selectors: { getSelectedSource }, getState } = dbg;
|
||||
const simple1 = findSource(dbg, "simple1.js");
|
||||
const simple2 = findSource(dbg, "simple2.js");
|
||||
|
||||
// Set the initial breakpoint.
|
||||
yield addBreakpoint(dbg, simple1, 4);
|
||||
ok(!getSelectedSource(getState()), "No selected source");
|
||||
|
||||
// Call the function that we set a breakpoint in.
|
||||
invokeInTab("main");
|
||||
yield waitForPaused(dbg);
|
||||
assertPausedLocation(dbg, simple1, 4);
|
||||
|
||||
// Step through to another file and make sure it's paused in the
|
||||
// right place.
|
||||
yield stepIn(dbg);
|
||||
assertPausedLocation(dbg, simple2, 2);
|
||||
|
||||
// Step back out to the initial file.
|
||||
yield stepOut(dbg);
|
||||
yield stepOut(dbg);
|
||||
assertPausedLocation(dbg, simple1, 5);
|
||||
yield resume(dbg);
|
||||
|
||||
// Make sure that we can set a breakpoint on a line out of the
|
||||
// viewport, and that pausing there scrolls the editor to it.
|
||||
let longSrc = findSource(dbg, "long.js");
|
||||
yield addBreakpoint(dbg, longSrc, 66);
|
||||
|
||||
invokeInTab("testModel");
|
||||
yield waitForPaused(dbg);
|
||||
assertPausedLocation(dbg, longSrc, 66);
|
||||
ok(isElementVisible(dbg, "breakpoint"), "Breakpoint is visible");
|
||||
setupTestRunner(this);
|
||||
yield editorSelect(this);
|
||||
});
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
const {
|
||||
setupTestRunner,
|
||||
expressions
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
add_task(function*() {
|
||||
setupTestRunner(this);
|
||||
yield expressions(this);
|
||||
});
|
|
@ -1,26 +1,12 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/**
|
||||
* Test debugging a page with iframes
|
||||
* 1. pause in the main thread
|
||||
* 2. pause in the iframe
|
||||
*/
|
||||
const {
|
||||
setupTestRunner,
|
||||
iframes
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
add_task(function*() {
|
||||
const dbg = yield initDebugger("doc-iframes.html");
|
||||
|
||||
// test pausing in the main thread
|
||||
yield reload(dbg);
|
||||
yield waitForPaused(dbg);
|
||||
assertPausedLocation(dbg, "iframes.html", 8);
|
||||
|
||||
// test pausing in the iframe
|
||||
yield resume(dbg);
|
||||
yield waitForPaused(dbg);
|
||||
assertPausedLocation(dbg, "debugger-statements.html", 8);
|
||||
|
||||
// test pausing in the iframe
|
||||
yield resume(dbg);
|
||||
yield waitForPaused(dbg);
|
||||
assertPausedLocation(dbg, "debugger-statements.html", 12);
|
||||
setupTestRunner(this);
|
||||
yield iframes(this);
|
||||
});
|
||||
|
|
|
@ -1,47 +1,12 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function countSources(dbg) {
|
||||
const sources = dbg.selectors.getSources(dbg.getState());
|
||||
return sources.size;
|
||||
}
|
||||
const {
|
||||
setupTestRunner,
|
||||
navigation
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
/**
|
||||
* Test navigating
|
||||
* navigating while paused will reset the pause state and sources
|
||||
*/
|
||||
add_task(function*() {
|
||||
const dbg = yield initDebugger("doc-script-switching.html");
|
||||
const { selectors: { getSelectedSource, getPause }, getState } = dbg;
|
||||
|
||||
invokeInTab("firstCall");
|
||||
yield waitForPaused(dbg);
|
||||
|
||||
yield navigate(dbg, "doc-scripts.html", "simple1.js");
|
||||
yield addBreakpoint(dbg, "simple1.js", 4);
|
||||
invokeInTab("main");
|
||||
yield waitForPaused(dbg);
|
||||
assertPausedLocation(dbg, "simple1.js", 4);
|
||||
is(countSources(dbg), 4, "4 sources are loaded.");
|
||||
|
||||
yield navigate(dbg, "about:blank");
|
||||
yield waitForDispatch(dbg, "NAVIGATE");
|
||||
is(countSources(dbg), 0, "0 sources are loaded.");
|
||||
ok(!getPause(getState()), "No pause state exists");
|
||||
|
||||
yield navigate(dbg,
|
||||
"doc-scripts.html",
|
||||
"simple1.js",
|
||||
"simple2.js",
|
||||
"long.js",
|
||||
"scripts.html"
|
||||
);
|
||||
|
||||
is(countSources(dbg), 4, "4 sources are loaded.");
|
||||
|
||||
// Test that the current select source persists across reloads
|
||||
yield selectSource(dbg, "long.js");
|
||||
yield reload(dbg, "long.js");
|
||||
ok(getSelectedSource(getState()).get("url").includes("long.js"),
|
||||
"Selected source is long.js");
|
||||
setupTestRunner(this);
|
||||
yield navigation(this);
|
||||
});
|
||||
|
|
|
@ -1,46 +1,12 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function uncaughtException() {
|
||||
return invokeInTab("uncaughtException").catch(() => {});
|
||||
}
|
||||
const {
|
||||
setupTestRunner,
|
||||
pauseOnExceptions
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
function caughtException() {
|
||||
return invokeInTab("caughtException");
|
||||
}
|
||||
|
||||
/*
|
||||
Tests Pausing on exception
|
||||
1. skip an uncaught exception
|
||||
2. pause on an uncaught exception
|
||||
3. pause on a caught error
|
||||
4. skip a caught error
|
||||
*/
|
||||
add_task(function*() {
|
||||
const dbg = yield initDebugger("doc-exceptions.html");
|
||||
|
||||
// test skipping an uncaught exception
|
||||
yield togglePauseOnExceptions(dbg, false, false);
|
||||
yield uncaughtException();
|
||||
ok(!isPaused(dbg));
|
||||
|
||||
// Test pausing on an uncaught exception
|
||||
yield togglePauseOnExceptions(dbg, true, false);
|
||||
uncaughtException();
|
||||
yield waitForPaused(dbg);
|
||||
assertPausedLocation(dbg, "exceptions.js", 2);
|
||||
yield resume(dbg);
|
||||
|
||||
// Test pausing on a caught Error
|
||||
caughtException();
|
||||
yield waitForPaused(dbg);
|
||||
assertPausedLocation(dbg, "exceptions.js", 15);
|
||||
yield resume(dbg);
|
||||
|
||||
// Test skipping a caught error
|
||||
yield togglePauseOnExceptions(dbg, true, true);
|
||||
caughtException();
|
||||
yield waitForPaused(dbg);
|
||||
assertPausedLocation(dbg, "exceptions.js", 17);
|
||||
yield resume(dbg);
|
||||
setupTestRunner(this);
|
||||
yield pauseOnExceptions(this);
|
||||
});
|
||||
|
|
|
@ -3,20 +3,12 @@
|
|||
|
||||
// Tests pretty-printing a source that is currently paused.
|
||||
|
||||
const {
|
||||
setupTestRunner,
|
||||
prettyPrintPaused
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
add_task(function*() {
|
||||
const dbg = yield initDebugger("doc-minified.html");
|
||||
|
||||
yield selectSource(dbg, "math.min.js");
|
||||
yield addBreakpoint(dbg, "math.min.js", 2);
|
||||
|
||||
invokeInTab("arithmetic");
|
||||
yield waitForPaused(dbg);
|
||||
assertPausedLocation(dbg, "math.min.js", 2);
|
||||
|
||||
clickElement(dbg, "prettyPrintButton");
|
||||
yield waitForDispatch(dbg, "TOGGLE_PRETTY_PRINT");
|
||||
|
||||
assertPausedLocation(dbg, "math.min.js:formatted", 18);
|
||||
|
||||
yield resume(dbg);
|
||||
setupTestRunner(this);
|
||||
yield prettyPrintPaused(this);
|
||||
});
|
||||
|
|
|
@ -3,29 +3,12 @@
|
|||
|
||||
// Tests basic pretty-printing functionality.
|
||||
|
||||
const {
|
||||
prettyPrint,
|
||||
setupTestRunner
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
add_task(function*() {
|
||||
const dbg = yield initDebugger("doc-minified.html");
|
||||
|
||||
yield selectSource(dbg, "math.min.js");
|
||||
clickElement(dbg, "prettyPrintButton");
|
||||
yield waitForDispatch(dbg, "TOGGLE_PRETTY_PRINT");
|
||||
|
||||
const ppSrc = findSource(dbg, "math.min.js:formatted");
|
||||
ok(ppSrc, "Pretty-printed source exists");
|
||||
|
||||
yield addBreakpoint(dbg, ppSrc, 18);
|
||||
|
||||
invokeInTab("arithmetic");
|
||||
yield waitForPaused(dbg);
|
||||
assertPausedLocation(dbg, ppSrc, 18);
|
||||
yield stepOver(dbg);
|
||||
assertPausedLocation(dbg, ppSrc, 27);
|
||||
yield resume(dbg);
|
||||
|
||||
// The pretty-print button should go away in the pretty-printed
|
||||
// source.
|
||||
ok(!findElement(dbg, "sourceFooter"), "Footer is hidden");
|
||||
|
||||
yield selectSource(dbg, "math.min.js");
|
||||
ok(findElement(dbg, "sourceFooter"), "Footer is hidden");
|
||||
setupTestRunner(this);
|
||||
yield prettyPrint(this);
|
||||
});
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
const {
|
||||
setupTestRunner,
|
||||
returnvalues
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
add_task(function*() {
|
||||
setupTestRunner(this);
|
||||
yield returnvalues(this);
|
||||
});
|
|
@ -1,22 +1,12 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function toggleNode(dbg, index) {
|
||||
clickElement(dbg, "scopeNode", index);
|
||||
}
|
||||
|
||||
function getLabel(dbg, index) {
|
||||
return findElement(dbg, "scopeNode", index).innerText;
|
||||
}
|
||||
const {
|
||||
setupTestRunner,
|
||||
scopes
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
add_task(function*() {
|
||||
const dbg = yield initDebugger("doc-script-switching.html");
|
||||
|
||||
toggleScopes(dbg);
|
||||
|
||||
invokeInTab("firstCall");
|
||||
yield waitForPaused(dbg);
|
||||
|
||||
is(getLabel(dbg, 1), "secondCall");
|
||||
is(getLabel(dbg, 2), "<this>");
|
||||
setupTestRunner(this);
|
||||
yield scopes(this);
|
||||
});
|
||||
|
|
|
@ -2,27 +2,12 @@
|
|||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Testing source search
|
||||
const {
|
||||
setupTestRunner,
|
||||
searching
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
add_task(function*() {
|
||||
const dbg = yield initDebugger("doc-script-switching.html");
|
||||
|
||||
pressKey(dbg, "sourceSearch");
|
||||
yield waitForElement(dbg, "input");
|
||||
findElementWithSelector(dbg, "input").focus();
|
||||
type(dbg, "sw");
|
||||
pressKey(dbg, "Enter");
|
||||
|
||||
yield waitForDispatch(dbg, "LOAD_SOURCE_TEXT");
|
||||
let source = dbg.selectors.getSelectedSource(dbg.getState());
|
||||
ok(source.get("url").match(/switching-01/), "first source is selected");
|
||||
|
||||
// 2. arrow keys and check to see if source is selected
|
||||
pressKey(dbg, "sourceSearch");
|
||||
findElementWithSelector(dbg, "input").focus();
|
||||
type(dbg, "sw");
|
||||
pressKey(dbg, "Down");
|
||||
pressKey(dbg, "Enter");
|
||||
|
||||
yield waitForDispatch(dbg, "LOAD_SOURCE_TEXT");
|
||||
source = dbg.selectors.getSelectedSource(dbg.getState());
|
||||
ok(source.get("url").match(/switching-02/), "second source is selected");
|
||||
setupTestRunner(this);
|
||||
yield searching(this);
|
||||
});
|
||||
|
|
|
@ -4,20 +4,12 @@
|
|||
// Test that an error while loading a sourcemap does not break
|
||||
// debugging.
|
||||
|
||||
const {
|
||||
setupTestRunner,
|
||||
sourceMapsBogus
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
add_task(function*() {
|
||||
const dbg = yield initDebugger("doc-sourcemap-bogus.html");
|
||||
const { selectors: { getSources }, getState } = dbg;
|
||||
|
||||
yield selectSource(dbg, "bogus-map.js");
|
||||
|
||||
// We should still be able to set breakpoints and pause in the
|
||||
// generated source.
|
||||
yield addBreakpoint(dbg, "bogus-map.js", 4);
|
||||
invokeInTab("runCode");
|
||||
yield waitForPaused(dbg);
|
||||
assertPausedLocation(dbg, "bogus-map.js", 4);
|
||||
|
||||
// Make sure that only the single generated source exists. The
|
||||
// sourcemap failed to download.
|
||||
is(getSources(getState()).size, 1, "Only 1 source exists");
|
||||
setupTestRunner(this);
|
||||
yield sourceMapsBogus(this);
|
||||
});
|
||||
|
|
|
@ -3,42 +3,12 @@
|
|||
|
||||
// Tests loading sourcemapped sources, setting breakpoints, and
|
||||
// stepping in them.
|
||||
const {
|
||||
setupTestRunner,
|
||||
sourceMaps
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
add_task(function*() {
|
||||
const dbg = yield initDebugger("doc-sourcemaps.html");
|
||||
const { selectors: { getBreakpoint, getBreakpoints }, getState } = dbg;
|
||||
|
||||
yield waitForSources(dbg, "entry.js", "output.js", "times2.js", "opts.js");
|
||||
ok(true, "Original sources exist");
|
||||
const entrySrc = findSource(dbg, "entry.js");
|
||||
|
||||
yield selectSource(dbg, entrySrc);
|
||||
ok(dbg.win.cm.getValue().includes("window.keepMeAlive"),
|
||||
"Original source text loaded correctly");
|
||||
|
||||
// Test that breakpoint sliding is not attempted. The breakpoint
|
||||
// should not move anywhere.
|
||||
yield addBreakpoint(dbg, entrySrc, 13);
|
||||
is(getBreakpoints(getState()).size, 1, "One breakpoint exists");
|
||||
ok(getBreakpoint(getState(), { sourceId: entrySrc.id, line: 13 }),
|
||||
"Breakpoint has correct line");
|
||||
|
||||
// Test breaking on a breakpoint
|
||||
yield addBreakpoint(dbg, "entry.js", 15);
|
||||
is(getBreakpoints(getState()).size, 2, "Two breakpoints exist");
|
||||
ok(getBreakpoint(getState(), { sourceId: entrySrc.id, line: 15 }),
|
||||
"Breakpoint has correct line");
|
||||
|
||||
invokeInTab("keepMeAlive");
|
||||
yield waitForPaused(dbg);
|
||||
assertPausedLocation(dbg, entrySrc, 15);
|
||||
|
||||
yield stepIn(dbg);
|
||||
assertPausedLocation(dbg, "times2.js", 2);
|
||||
yield stepOver(dbg);
|
||||
assertPausedLocation(dbg, "times2.js", 3);
|
||||
|
||||
yield stepOut(dbg);
|
||||
yield stepOut(dbg);
|
||||
assertPausedLocation(dbg, "entry.js", 16);
|
||||
setupTestRunner(this);
|
||||
yield sourceMaps(this);
|
||||
});
|
||||
|
|
|
@ -5,26 +5,12 @@
|
|||
// stepping in them.
|
||||
|
||||
// This source map does not have source contents, so it's fetched separately
|
||||
const {
|
||||
setupTestRunner,
|
||||
sourceMaps2
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
add_task(function*() {
|
||||
const dbg = yield initDebugger("doc-sourcemaps2.html");
|
||||
const { selectors: { getBreakpoint, getBreakpoints }, getState } = dbg;
|
||||
|
||||
yield waitForSources(dbg, "main.js", "main.min.js");
|
||||
|
||||
ok(true, "Original sources exist");
|
||||
const mainSrc = findSource(dbg, "main.js");
|
||||
|
||||
yield selectSource(dbg, mainSrc);
|
||||
|
||||
// Test that breakpoint is not off by a line.
|
||||
yield addBreakpoint(dbg, mainSrc, 4);
|
||||
is(getBreakpoints(getState()).size, 1, "One breakpoint exists");
|
||||
ok(getBreakpoint(getState(), { sourceId: mainSrc.id, line: 4 }),
|
||||
"Breakpoint has correct line");
|
||||
|
||||
invokeInTab("logMessage");
|
||||
|
||||
yield waitForPaused(dbg);
|
||||
assertPausedLocation(dbg, "main.js", 4);
|
||||
setupTestRunner(this);
|
||||
yield sourceMaps2(this);
|
||||
});
|
||||
|
|
|
@ -1,60 +1,12 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Tests that the source tree works.
|
||||
|
||||
function* waitForSourceCount(dbg, i) {
|
||||
// We are forced to wait until the DOM nodes appear because the
|
||||
// source tree batches its rendering.
|
||||
yield waitUntil(() => {
|
||||
return findAllElements(dbg, "sourceNodes").length === i;
|
||||
});
|
||||
}
|
||||
const {
|
||||
setupTestRunner,
|
||||
sources
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
add_task(function*() {
|
||||
const dbg = yield initDebugger("doc-sources.html");
|
||||
const { selectors: { getSelectedSource }, getState } = dbg;
|
||||
|
||||
yield waitForSources(dbg, "simple1");
|
||||
|
||||
// Expand nodes and make sure more sources appear.
|
||||
is(findAllElements(dbg, "sourceNodes").length, 2);
|
||||
|
||||
clickElement(dbg, "sourceArrow", 2);
|
||||
is(findAllElements(dbg, "sourceNodes").length, 7);
|
||||
|
||||
clickElement(dbg, "sourceArrow", 3);
|
||||
is(findAllElements(dbg, "sourceNodes").length, 8);
|
||||
|
||||
// Select a source.
|
||||
ok(!findElementWithSelector(dbg, ".sources-list .focused"),
|
||||
"Source is not focused");
|
||||
const selected = waitForDispatch(dbg, "SELECT_SOURCE");
|
||||
clickElement(dbg, "sourceNode", 4);
|
||||
yield selected;
|
||||
ok(findElementWithSelector(dbg, ".sources-list .focused"),
|
||||
"Source is focused");
|
||||
ok(getSelectedSource(getState()).get("url").includes("nested-source.js"),
|
||||
"The right source is selected");
|
||||
|
||||
// Make sure new sources appear in the list.
|
||||
ContentTask.spawn(gBrowser.selectedBrowser, null, function() {
|
||||
const script = content.document.createElement("script");
|
||||
script.src = "math.min.js";
|
||||
content.document.body.appendChild(script);
|
||||
});
|
||||
|
||||
yield waitForSourceCount(dbg, 9);
|
||||
is(findElement(dbg, "sourceNode", 7).textContent,
|
||||
"math.min.js",
|
||||
"The dynamic script exists");
|
||||
|
||||
// Make sure named eval sources appear in the list.
|
||||
ContentTask.spawn(gBrowser.selectedBrowser, null, function() {
|
||||
content.eval("window.evaledFunc = function() {} //# sourceURL=evaled.js");
|
||||
});
|
||||
yield waitForSourceCount(dbg, 11);
|
||||
is(findElement(dbg, "sourceNode", 2).textContent,
|
||||
"evaled.js",
|
||||
"The eval script exists");
|
||||
setupTestRunner(this);
|
||||
yield sources(this);
|
||||
});
|
||||
|
|
|
@ -1,46 +1,12 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/**
|
||||
* Test keyboard shortcuts.
|
||||
*/
|
||||
|
||||
function pressResume(dbg) {
|
||||
pressKey(dbg, "resumeKey");
|
||||
return waitForPaused(dbg);
|
||||
}
|
||||
|
||||
function pressStepOver(dbg) {
|
||||
pressKey(dbg, "stepOverKey");
|
||||
return waitForPaused(dbg);
|
||||
}
|
||||
|
||||
function pressStepIn(dbg) {
|
||||
pressKey(dbg, "stepInKey");
|
||||
return waitForPaused(dbg);
|
||||
}
|
||||
|
||||
function pressStepOut(dbg) {
|
||||
pressKey(dbg, "stepOutKey");
|
||||
return waitForPaused(dbg);
|
||||
}
|
||||
const {
|
||||
setupTestRunner,
|
||||
keyboardShortcuts
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
add_task(function*() {
|
||||
const dbg = yield initDebugger("doc-debugger-statements.html");
|
||||
|
||||
yield reload(dbg);
|
||||
yield waitForPaused(dbg);
|
||||
assertPausedLocation(dbg, "debugger-statements.html", 8);
|
||||
|
||||
yield pressResume(dbg);
|
||||
assertPausedLocation(dbg, "debugger-statements.html", 12);
|
||||
|
||||
yield pressStepIn(dbg);
|
||||
assertPausedLocation(dbg, "debugger-statements.html", 13);
|
||||
|
||||
yield pressStepOut(dbg);
|
||||
assertPausedLocation(dbg, "debugger-statements.html", 14);
|
||||
|
||||
yield pressStepOver(dbg);
|
||||
assertPausedLocation(dbg, "debugger-statements.html", 9);
|
||||
setupTestRunner(this);
|
||||
yield keyboardShortcuts(this);
|
||||
});
|
||||
|
|
|
@ -3,27 +3,12 @@
|
|||
|
||||
// Tests that keyboard navigation into and out of debugger code editor
|
||||
|
||||
const {
|
||||
setupTestRunner,
|
||||
keyboardNavigation
|
||||
} = require("devtools/client/debugger/new/integration-tests");
|
||||
|
||||
add_task(function*() {
|
||||
const dbg = yield initDebugger("doc-scripts.html");
|
||||
let doc = dbg.win.document;
|
||||
|
||||
yield selectSource(dbg, "simple2");
|
||||
|
||||
yield waitForElement(dbg, ".CodeMirror");
|
||||
findElementWithSelector(dbg, ".CodeMirror").focus();
|
||||
|
||||
// Enter code editor
|
||||
pressKey(dbg, "Enter");
|
||||
is(findElementWithSelector(dbg, "textarea"), doc.activeElement,
|
||||
"Editor is enabled");
|
||||
|
||||
// Exit code editor and focus on container
|
||||
pressKey(dbg, "Escape");
|
||||
is(findElementWithSelector(dbg, ".CodeMirror"), doc.activeElement,
|
||||
"Focused on container");
|
||||
|
||||
// Enter code editor
|
||||
pressKey(dbg, "Tab");
|
||||
is(findElementWithSelector(dbg, "textarea"), doc.activeElement,
|
||||
"Editor is enabled");
|
||||
setupTestRunner(this);
|
||||
yield keyboardNavigation(this);
|
||||
});
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
var asmjs = (function () {
|
||||
"use asm";
|
||||
function f() {
|
||||
return 1|0;
|
||||
}
|
||||
return {f: f};
|
||||
})()
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<!-- Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ -->
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Asm.js</title>
|
||||
<script src="asm.js"></script>
|
||||
<script>
|
||||
function runAsm() {
|
||||
console.log(asmjs.f());
|
||||
}
|
||||
debugger; // see browser_dbg-asm.js reload() comment
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<button onclick="runAsm()">test</button>
|
||||
</body>
|
||||
</html>
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
<body>
|
||||
<script>
|
||||
debugger;
|
||||
// This inline script allows this HTML page to show up as a
|
||||
// source. It also needs to introduce a new global variable so
|
||||
// it's not immediately garbage collected.
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Return Values</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script>
|
||||
function return_something(x) {
|
||||
debugger;
|
||||
return x;
|
||||
}
|
||||
|
||||
function callee(x) {
|
||||
throw x;
|
||||
}
|
||||
|
||||
function throw_something(x) {
|
||||
try {
|
||||
callee(x);
|
||||
} catch (e) {
|
||||
// Ignore.
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -13,6 +13,14 @@
|
|||
|
||||
<script type="text/javascript" src="script-switching-01.js"></script>
|
||||
<script type="text/javascript" src="script-switching-02.js"></script>
|
||||
<script>
|
||||
// This inline script allows this HTML page to show up as a
|
||||
// source. It also needs to introduce a new global variable so
|
||||
// it's not immediately garbage collected.
|
||||
function inline_script() { var x = 5; }
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
@ -11,13 +11,18 @@
|
|||
<script src="simple1.js"></script>
|
||||
<script src="simple2.js"></script>
|
||||
<script src="long.js"></script>
|
||||
<script src="nested/nested-source.js"></script>
|
||||
<script>
|
||||
// This inline script allows this HTML page to show up as a
|
||||
// source. It also needs to introduce a new global variable so
|
||||
// it's not immediately garbage collected.
|
||||
function inline_script() { var x = 5; }
|
||||
|
||||
function loadScript() {
|
||||
const script = document.createElement("script");
|
||||
script.src = "math.min.js";
|
||||
document.body.appendChild(script);
|
||||
}
|
||||
</script>
|
||||
<script src="nested/nested-source.js"></script>
|
||||
<script src="nested/deeper/deeper-source.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -19,6 +19,6 @@ function recurseB(i) {
|
|||
}
|
||||
|
||||
|
||||
window.startRecursion = function() {
|
||||
function startRecursion() {
|
||||
return recurseA(0);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function firstCall() {
|
||||
secondCall();
|
||||
}
|
||||
|
|
|
@ -41,6 +41,11 @@ Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", true);
|
|||
Services.prefs.clearUserPref("devtools.debugger.tabs")
|
||||
Services.prefs.clearUserPref("devtools.debugger.pending-selected-location")
|
||||
|
||||
this.gBrowser = gBrowser;
|
||||
this.Services = Services;
|
||||
this.EXAMPLE_URL = EXAMPLE_URL;
|
||||
this.EventUtils = EventUtils;
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
|
||||
delete window.resumeTest;
|
||||
|
@ -288,6 +293,7 @@ function createDebuggerContext(toolbox) {
|
|||
getState: store.getState,
|
||||
store: store,
|
||||
client: win.Debugger.client,
|
||||
threadClient: toolbox.threadClient,
|
||||
toolbox: toolbox,
|
||||
win: win
|
||||
};
|
||||
|
@ -306,7 +312,8 @@ function initDebugger(url, ...sources) {
|
|||
return Task.spawn(function* () {
|
||||
Services.prefs.clearUserPref("devtools.debugger.tabs")
|
||||
Services.prefs.clearUserPref("devtools.debugger.pending-selected-location")
|
||||
const toolbox = yield openNewTabAndToolbox(EXAMPLE_URL + url, "jsdebugger");
|
||||
url = url.startsWith("data:") ? url : EXAMPLE_URL + url;
|
||||
const toolbox = yield openNewTabAndToolbox(url, "jsdebugger");
|
||||
return createDebuggerContext(toolbox);
|
||||
});
|
||||
}
|
||||
|
@ -439,7 +446,7 @@ function resume(dbg) {
|
|||
* @static
|
||||
*/
|
||||
function reload(dbg, ...sources) {
|
||||
return dbg.client.reload().then(() => waitForSources(...sources));
|
||||
return dbg.client.reload().then(() => waitForSources(dbg, ...sources));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -524,6 +531,7 @@ function togglePauseOnExceptions(dbg,
|
|||
* @return {Promise}
|
||||
* @static
|
||||
*/
|
||||
|
||||
function invokeInTab(fnc) {
|
||||
info(`Invoking function ${fnc} in tab`);
|
||||
return ContentTask.spawn(gBrowser.selectedBrowser, fnc, function* (fnc) {
|
||||
|
|
|
@ -14,6 +14,14 @@
|
|||
# that collapses the left and right panes in the debugger UI.
|
||||
collapsePanes=Collapse panes
|
||||
|
||||
# LOCALIZATION NOTE (copySourceUrl): This is the text that appears in the
|
||||
# context menu to copy the source URL of file open.
|
||||
copySourceUrl=Copy Source Url
|
||||
|
||||
# LOCALIZATION NOTE (copySourceUrl.accesskey): Access key to copy the source URL of a file from
|
||||
# the context menu.
|
||||
copySourceUrl.accesskey=u
|
||||
|
||||
# LOCALIZATION NOTE (expandPanes): This is the tooltip for the button
|
||||
# that expands the left and right panes in the debugger UI.
|
||||
expandPanes=Expand panes
|
||||
|
@ -116,6 +124,10 @@ blackBoxCheckboxTooltip=Toggle black boxing
|
|||
# searching all the source files the debugger has seen.
|
||||
sources.search.key=P
|
||||
|
||||
# LOCALIZATION NOTE (sources.searchAlt.key): Alternate key shortcut to open
|
||||
# the search for searching all the source files the debugger has seen.
|
||||
sources.searchAlt.key=O
|
||||
|
||||
# LOCALIZATION NOTE (sourceSearch.search.key): Key shortcut to open the search
|
||||
# for searching within a the currently opened files in the editor
|
||||
sourceSearch.search.key=F
|
||||
|
@ -124,9 +136,9 @@ sourceSearch.search.key=F
|
|||
# the search for re-searching the same search triggered from a sourceSearch
|
||||
sourceSearch.search.again.key=G
|
||||
|
||||
# LOCALIZATION NOTE (sourceSearch.resultsSummary): Shows a summary of
|
||||
# LOCALIZATION NOTE (sourceSearch.resultsSummary1): Shows a summary of
|
||||
# the number of matches for autocomplete
|
||||
sourceSearch.resultsSummary=%d instances of “%S”
|
||||
sourceSearch.resultsSummary1=%d results
|
||||
|
||||
# LOCALIZATION NOTE (noMatchingStringsText): The text to display in the
|
||||
# global search results when there are no matching strings after filtering.
|
||||
|
@ -251,6 +263,10 @@ editor.addConditionalBreakpoint=Add Conditional Breakpoint
|
|||
# input element inside ConditionalPanel component
|
||||
editor.conditionalPanel.placeholder=This breakpoint will pause when the expression is true
|
||||
|
||||
# LOCALIZATION NOTE (editor.conditionalPanel.placeholder): Tooltip text for
|
||||
# close button inside ConditionalPanel component
|
||||
editor.conditionalPanel.close=Cancel edit breakpoint and close
|
||||
|
||||
# LOCALIZATION NOTE (editor.jumpToMappedLocation1): Context menu item
|
||||
# for navigating to a source mapped location
|
||||
editor.jumpToMappedLocation1=Jump to %S location
|
||||
|
@ -269,18 +285,58 @@ expressions.placeholder=Add Watch Expression
|
|||
# for closing the selected tab below the mouse.
|
||||
sourceTabs.closeTab=Close tab
|
||||
|
||||
# LOCALIZATION NOTE (sourceTabs.closeTab.accesskey): Access key to close the currently select
|
||||
# source tab from the editor context menu item.
|
||||
sourceTabs.closeTab.accesskey=c
|
||||
|
||||
# LOCALIZATION NOTE (sourceTabs.closeOtherTabs): Editor source tab context menu item
|
||||
# for closing the other tabs.
|
||||
sourceTabs.closeOtherTabs=Close others
|
||||
|
||||
# LOCALIZATION NOTE (sourceTabs.closeTabsToRight): Editor source tab context menu item
|
||||
# for closing the tabs to the right of the selected tab.
|
||||
sourceTabs.closeTabsToRight=Close tabs to the right
|
||||
# LOCALIZATION NOTE (sourceTabs.closeOtherTabs.accesskey): Access key to close other source tabs
|
||||
# from the editor context menu.
|
||||
sourceTabs.closeOtherTabs.accesskey=o
|
||||
|
||||
# LOCALIZATION NOTE (sourceTabs.closeTabsToEnd): Editor source tab context menu item
|
||||
# for closing the tabs to the end (the right for LTR languages) of the selected tab.
|
||||
sourceTabs.closeTabsToEnd=Close tabs to the right
|
||||
|
||||
# LOCALIZATION NOTE (sourceTabs.closeTabsToEnd.accesskey): Access key to close source tabs
|
||||
# after the selected tab from the editor context menu.
|
||||
sourceTabs.closeTabsToEnd.accesskey=e
|
||||
|
||||
# LOCALIZATION NOTE (sourceTabs.closeAllTabs): Editor source tab context menu item
|
||||
# for closing all tabs.
|
||||
sourceTabs.closeAllTabs=Close all tabs
|
||||
|
||||
# LOCALIZATION NOTE (sourceTabs.closeAllTabs.accesskey): Access key to close all tabs from the
|
||||
# editor context menu.
|
||||
sourceTabs.closeAllTabs.accesskey=a
|
||||
|
||||
# LOCALIZATION NOTE (sourceTabs.revealInTree): Editor source tab context menu item
|
||||
# for revealing source in tree.
|
||||
sourceTabs.revealInTree=Reveal in Tree
|
||||
|
||||
# LOCALIZATION NOTE (sourceTabs.revealInTree.accesskey): Access key to reveal a source in the
|
||||
# tree from the context menu.
|
||||
sourceTabs.revealInTree.accesskey=r
|
||||
|
||||
# LOCALIZATION NOTE (sourceTabs.copyLink): Editor source tab context menu item
|
||||
# for copying a link address.
|
||||
sourceTabs.copyLink=Copy Link Address
|
||||
|
||||
# LOCALIZATION NOTE (sourceTabs.copyLink.accesskey): Access key to copy a link addresss from the
|
||||
# editor context menu.
|
||||
sourceTabs.copyLink.accesskey=l
|
||||
|
||||
# LOCALIZATION NOTE (sourceTabs.prettyPrint): Editor source tab context menu item
|
||||
# for pretty printing the source.
|
||||
sourceTabs.prettyPrint=Pretty Print Source
|
||||
|
||||
# LOCALIZATION NOTE (sourceTabs.prettyPrint.accesskey): Access key to pretty print a source from
|
||||
# the editor context menu.
|
||||
sourceTabs.prettyPrint.accesskey=p
|
||||
|
||||
# LOCALIZATION NOTE (sourceTabs.closeTabButtonTooltip): The tooltip that is displayed
|
||||
# for close tab button in source tabs.
|
||||
sourceTabs.closeTabButtonTooltip=Close tab
|
||||
|
@ -453,6 +509,8 @@ watchExpressionsSeparatorLabel2=\u0020→
|
|||
# in the functions search panel as a separator between function's inferred name
|
||||
# and its real name (if available).
|
||||
functionSearchSeparatorLabel=←
|
||||
functionSearch.search.placeholder=Search Functions…
|
||||
functionSearch.search.key=O
|
||||
|
||||
# LOCALIZATION NOTE (resumptionOrderPanelTitle): This is the text that appears
|
||||
# as a description in the notification panel popup, when multiple debuggers are
|
||||
|
|
Загрузка…
Ссылка в новой задаче