Merge m-c to autoland on a CLOSED TREE. a=merge

--HG--
extra : amend_source : a40e5ae025083e5d00d96f08cc8e78119721317a
This commit is contained in:
Ryan VanderMeulen 2017-11-10 16:15:26 -05:00
commit f850c5874e
305 changed files with 12955 additions and 5694 deletions

View File

@ -245,6 +245,7 @@ dom/vr/**
dom/webauthn/**
dom/webbrowserpersist/**
dom/webidl/**
dom/websocket/**
dom/workers/**
dom/worklet/**
dom/xbl/**

View File

@ -35,7 +35,7 @@ var gGrid = {
/**
* All sites contained in the grid's cells. Sites may be empty.
*/
get sites() { return [for (cell of this.cells) cell.site]; },
get sites() { return this.cells.map(cell => cell.site); },
// Tells whether the grid has already been initialized.
get ready() { return !!this._ready; },

View File

@ -12,25 +12,27 @@ dnl AC_SOMETHING(foo,AC_SUBST(),bar)
define([AC_SUBST],
[ifdef([AC_SUBST_SET_$1], [m4_fatal([Cannot use AC_SUBST and AC_SUBST_SET on the same variable ($1)])],
[ifdef([AC_SUBST_LIST_$1], [m4_fatal([Cannot use AC_SUBST and AC_SUBST_LIST on the same variable ($1)])],
[ifdef([AC_SUBST_TOML_LIST_$1], [m4_fatal([Cannot use AC_SUBST and AC_SUBST_TOML_LIST on the same variable ($1)])],
[ifdef([AC_SUBST_$1], ,
[define([AC_SUBST_$1], )dnl
AC_DIVERT_PUSH(MOZ_DIVERSION_SUBST)dnl
(''' $1 ''', r''' [$]$1 ''')
AC_DIVERT_POP()dnl
])])])])
])])])])])
dnl Like AC_SUBST, but makes the value available as a set in python,
dnl with values got from the value of the environment variable, split on
dnl whitespaces.
define([AC_SUBST_SET],
[ifdef([AC_SUBST_$1], [m4_fatal([Cannot use AC_SUBST and AC_SUBST_SET on the same variable ($1)])],
[ifdef([AC_SUBST_LIST$1], [m4_fatal([Cannot use AC_SUBST_LIST and AC_SUBST_SET on the same variable ($1)])],
[ifdef([AC_SUBST_LIST_$1], [m4_fatal([Cannot use AC_SUBST_LIST and AC_SUBST_SET on the same variable ($1)])],
[ifdef([AC_SUBST_TOML_LIST_$1], [m4_fatal([Cannot use AC_SUBST_TOML_LIST and AC_SUBST_SET on the same variable ($1)])],
[ifdef([AC_SUBST_SET_$1], ,
[define([AC_SUBST_SET_$1], )dnl
AC_DIVERT_PUSH(MOZ_DIVERSION_SUBST)dnl
(''' $1 ''', unique_list(split(r''' [$]$1 ''')))
AC_DIVERT_POP()dnl
])])])])
])])])])])
dnl Like AC_SUBST, but makes the value available as a list in python,
dnl with values got from the value of the environment variable, split on
@ -38,12 +40,29 @@ dnl whitespaces.
define([AC_SUBST_LIST],
[ifdef([AC_SUBST_$1], [m4_fatal([Cannot use AC_SUBST and AC_SUBST_LIST on the same variable ($1)])],
[ifdef([AC_SUBST_SET_$1], [m4_fatal([Cannot use AC_SUBST_SET and AC_SUBST_LIST on the same variable ($1)])],
[ifdef([AC_SUBST_TOML_LIST_$1], [m4_fatal([Cannot use AC_SUBST_TOML_LIST and AC_SUBST_LIST on the same variable ($1)])],
[ifdef([AC_SUBST_LIST_$1], ,
[define([AC_SUBST_LIST_$1], )dnl
AC_DIVERT_PUSH(MOZ_DIVERSION_SUBST)dnl
(''' $1 ''', list(split(r''' [$]$1 ''')))
AC_DIVERT_POP()dnl
])])])])
])])])])])
dnl Like AC_SUBST, but makes the value available as a string of comma-separated
dnl quoted strings in python, with values got from the value of the environment
dnl variable, split on whitespaces. The value is suitable for embedding into a
dnl .toml list.
define([AC_SUBST_TOML_LIST],
[ifdef([AC_SUBST_$1], [m4_fatal([Cannot use AC_SUBST and AC_SUBST_TOML_LIST on the same variable ($1)])],
[ifdef([AC_SUBST_SET_$1], [m4_fatal([Cannot use AC_SUBST_SET and AC_SUBST_TOML_LIST on the same variable ($1)])],
[ifdef([AC_SUBST_LIST_$1], [m4_fatal([Cannot use AC_SUBST_LIST and AC_SUBST_TOML_LIST on the same variable ($1)])],
[ifdef([AC_SUBST_TOML_LIST_$1], ,
[define([AC_SUBST_TOML_LIST_$1], )dnl
AC_DIVERT_PUSH(MOZ_DIVERSION_SUBST)dnl
(''' $1 ''', r''' %s ''' % str(', '.join("'%s'" % s for s in split(r''' [$]$1 '''))))
AC_DIVERT_POP()dnl
])])])])])
dnl Ignore AC_SUBSTs for variables we don't have use for but that autoconf
dnl itself exports.

View File

@ -1072,16 +1072,13 @@ option(env='BINDGEN_CFLAGS',
@depends('BINDGEN_CFLAGS')
@checking('bindgen cflags', lambda s: s if s and s.strip() else 'no')
@checking('bindgen cflags', lambda s: s if s else 'no')
def bindgen_cflags(value):
if value and len(value):
# Reformat the env value for substitution into a toml list.
flags = value[0].split()
return ', '.join('"' + flag + '"' for flag in flags)
return ''
return value[0].split()
set_config('BINDGEN_CFLAGS', bindgen_cflags)
add_old_configure_assignment('_BINDGEN_CFLAGS', bindgen_cflags)
@depends(c_compiler)

View File

@ -1,7 +1,7 @@
This is the debugger.html project output.
See https://github.com/devtools-html/debugger.html
Taken from upstream commit: d9f18b2cd0792de70289d4dcde5ed3e38be87cf1
Taken from upstream commit: be179268c9b89390c13bdc9c4cca6000f6f583e5
Packages:
- babel-plugin-transform-es2015-modules-commonjs @6.26.0

View File

@ -410,6 +410,10 @@ body {
padding-left: 3px;
font-weight: normal;
}
/* 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/>. */
.modal-wrapper {
position: fixed;
display: flex;
@ -473,6 +477,10 @@ body {
transform: translateY(30px);
}
}
/* 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/>. */
.shortcuts-content {
padding: 15px;
-moz-column-width: 250px;
@ -486,20 +494,6 @@ body {
color: var(--theme-content-color1);
}
.mac .keystroke {
border-style: solid;
border-width: 1px;
border-radius: 3px;
border-color: var(--theme-graphs-grey);
background-color: var(--theme-selection-color);
width: 21px;
height: 17px;
display: inline-block;
font-size: 10px;
text-align: center;
padding-top: 2px;
}
.shortcuts-section {
display: inline-block;
margin: 5px;
@ -529,6 +523,10 @@ body {
width: 100%;
}
}
/* 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/>. */
:root {
--arrow-width: 10px;
}
@ -544,6 +542,10 @@ body {
--search-overlays-semitransparent: rgba(42, 46, 56, 0.66);
--popup-shadow-color: #5c667b;
}
/* 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/>. */
* {
box-sizing: border-box;
}
@ -602,6 +604,10 @@ button:focus {
left: 50%;
transform: translate(-50%, -50%);
}
/* 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/>. */
menupopup {
position: fixed;
z-index: 10000;
@ -922,6 +928,10 @@ menuseparator {
.split-box.dragging > .uncontrolled {
pointer-events: none;
}
/* 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/>. */
.arrow,
.worker,
.refresh,
@ -1035,6 +1045,10 @@ html .arrow.expanded svg {
.theme-dark .webpack {
opacity: 0.5;
}
/* 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/>. */
.managed-tree .tree {
-webkit-user-select: none;
-moz-user-select: none;
@ -1076,6 +1090,10 @@ html[dir="rtl"] .managed-tree .tree .node > div {
.managed-tree .tree-node button {
position: fixed;
}
/* 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/>. */
.close-btn path {
fill: var(--theme-comment-alt);
}
@ -1123,6 +1141,10 @@ html[dir="rtl"] .managed-tree .tree .node > div {
.close-btn.big .close svg {
width: 9px;
}
/* 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/>. */
.search-field {
width: calc(100% - 1px);
height: 27px;
@ -1229,6 +1251,10 @@ html[dir="rtl"] .managed-tree .tree .node > div {
.search-field .search-nav-buttons .nav-btn path {
fill: var(--theme-comment);
}
/* 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/>. */
.project-text-search {
flex-grow: 1;
display: flex;
@ -1317,6 +1343,10 @@ html[dir="rtl"] .managed-tree .tree .node > div {
.project-text-search .managed-tree .tree {
height: 100%;
}
/* 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/>. */
.search-container {
position: absolute;
top: 30px;
@ -1329,6 +1359,10 @@ html[dir="rtl"] .managed-tree .tree .node > div {
background-color: var(--theme-body-background);
overflow-y: hidden;
}
/* 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/>. */
.sources-panel {
background-color: var(--theme-sidebar-background);
display: flex;
@ -1420,6 +1454,7 @@ html[dir="rtl"] .managed-tree .tree .node > div {
-moz-user-select: none;
user-select: none;
box-sizing: border-box;
height: 29px;
}
.source-outline-tabs .tab {
@ -1488,6 +1523,10 @@ html[dir="rtl"] .managed-tree .tree .node > div {
.theme-dark .sources-list .managed-tree .tree .node.focused img.blackBox {
background-color: white;
}
/* 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/>. */
.outline {
overflow-y: auto;
}
@ -1533,6 +1572,10 @@ html[dir="rtl"] .managed-tree .tree .node > div {
.outline-list__element:hover {
background: var(--theme-toolbar-background-hover);
}
/* 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/>. */
.function-signature {
align-self: center;
}
@ -1552,6 +1595,10 @@ html[dir="rtl"] .managed-tree .tree .node > div {
.function-signature .comma {
color: var(--object-color);
}
/* 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/>. */
.toggle-button-start,
.toggle-button-end {
transform: translate(0, 0px);
@ -1597,6 +1644,10 @@ html .toggle-button-end.vertical svg {
.toggle-button-end.collapsed {
transform: rotate(180deg);
}
/* 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/>. */
.source-footer {
background: var(--theme-body-background);
border-top: 1px solid var(--theme-splitter-color);
@ -1683,6 +1734,10 @@ html .toggle-button-end.vertical svg {
.source-footer .blackbox-summary {
color: var(--theme-body-color);
}
/* 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/>. */
.search-bar {
display: flex;
flex-direction: column;
@ -2063,6 +2118,10 @@ html[dir="rtl"] .arrow svg,
opacity: 0.6;
}
/* 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/>. */
.bracket-arrow {
position: absolute;
}
@ -2105,6 +2164,10 @@ html[dir="rtl"] .arrow svg,
border-top-color: var(--theme-body-background);
top: -1px;
}
/* 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/>. */
.popover {
position: fixed;
z-index: 100;
@ -2114,6 +2177,10 @@ html[dir="rtl"] .arrow svg,
height: 5px;
padding-top: 5px;
}
/* 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/>. */
.popover .preview-popup {
background: var(--theme-body-background);
width: 350px;
@ -2238,6 +2305,10 @@ html[dir="rtl"] .arrow svg,
font-size: 14px;
color: var(--theme-content-color3);
}
/* 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/>. */
.call-site {
background: #f0f9ff;
position: relative;
@ -2283,9 +2354,17 @@ html[dir="rtl"] .arrow svg,
.theme-dark .call-site-bp::before {
border-bottom-color: #dd4d4d;
}
/* 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/>. */
.empty-line .CodeMirror-linenumber {
opacity: 0.5;
}
/* 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/>. */
.conditional-breakpoint-panel {
cursor: initial;
margin: 1em 0;
@ -2320,6 +2399,10 @@ html[dir="rtl"] .arrow svg,
.conditional-breakpoint-panel input:focus {
outline-width: 0;
}
/* 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/>. */
.editor-wrapper {
--debug-line-border: rgb(145, 188, 219);
--debug-expression-background: rgba(202, 227, 255, 0.5);
@ -2327,6 +2410,7 @@ html[dir="rtl"] .arrow svg,
--editor-second-searchbar-height: 27px;
--debug-line-error-border: rgb(255, 0, 0);
--debug-expression-error-background: rgba(231, 116, 113, 0.3);
--editor-header-height: 30px;
}
.theme-dark .editor-wrapper {
@ -2352,9 +2436,9 @@ html[dir="rtl"] .arrow svg,
*/
.editor-wrapper {
position: absolute;
height: calc(100% - 29px);
height: calc(100% - var(--editor-header-height));
width: calc(100% - 1px);
top: 29px;
top: var(--editor-header-height);
left: 0px;
--editor-footer-height: 24px;
}
@ -2534,6 +2618,10 @@ debug-expression-error {
.visible {
visibility: visible;
}
/* 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/>. */
.cm-highlight {
position: relative;
}
@ -2559,6 +2647,10 @@ debug-expression-error {
border-radius: 2px;
margin: 0 -1px -1px -1px;
}
/* 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/>. */
.breakpoints-toggle {
margin: 2px 3px;
}
@ -2671,6 +2763,10 @@ html .breakpoints-list .breakpoint.paused {
.breakpoint:hover .close {
visibility: visible;
}
/* 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/>. */
.input-expression {
width: 100%;
margin: 0px;
@ -2752,6 +2848,10 @@ html .breakpoints-list .breakpoint.paused {
.expression-input {
max-width: 50%;
}
/* 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/>. */
.frames ul .frames-group .group,
.frames ul .frames-group .group .location {
font-weight: 500;
@ -2775,6 +2875,10 @@ html .breakpoints-list .breakpoint.paused {
border-top: 1px solid var(--theme-splitter-color);
border-bottom: 1px solid var(--theme-splitter-color);
}
/* 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/>. */
.why-paused {
background-color: var(--theme-body-background);
color: var(--theme-body-color);
@ -2803,6 +2907,10 @@ html .breakpoints-list .breakpoint.paused {
font-weight: bold;
font-style: normal;
}
/* 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/>. */
.frames ul {
list-style: none;
margin: 0;
@ -2895,6 +3003,10 @@ html .breakpoints-list .breakpoint.paused {
:root.theme-dark .annotation-logo svg path {
fill: var(--theme-highlight-blue);
}
/* 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/>. */
.event-listeners {
list-style: none;
margin: 0;
@ -2940,6 +3052,10 @@ html .breakpoints-list .breakpoint.paused {
.event-listeners .listener:hover .close {
display: block;
}
/* 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/>. */
.workers-list * {
user-select: none;
}
@ -2952,6 +3068,10 @@ html .breakpoints-list .breakpoint.paused {
position: relative;
transition: all 0.25s ease;
}
/* 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/>. */
:root {
--accordion-header-background: var(--theme-toolbar-background);
}
@ -3028,6 +3148,10 @@ html .breakpoints-list .breakpoint.paused {
.accordion .header-buttons button::-moz-focus-inner {
border: none;
}
/* 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/>. */
.command-bar {
flex: 0 0 29px;
border-bottom: 1px solid var(--theme-splitter-color);
@ -3156,6 +3280,10 @@ img.resume {
.command-bar.bottom > button:hover {
color: var(--theme-body-color);
}
/* 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/>. */
.object-node.default-property {
opacity: 0.6;
}
@ -3186,6 +3314,10 @@ img.resume {
.scopes-list .function-signature {
display: inline-block;
}
/* 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/>. */
.secondary-panes {
overflow: auto;
display: flex;
@ -3230,6 +3362,10 @@ img.resume {
.theme-dark .secondary-panes .accordion .arrow svg {
fill: var(--theme-content-color3);
}
/* 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/>. */
.welcomebox {
width: calc(100% - 1px);
@ -3311,6 +3447,10 @@ html .welcomebox .toggle-button-end.collapsed {
display: block;
}
}
/* 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/>. */
.source-header {
border-bottom: 1px solid var(--theme-splitter-color);
width: 100%;
@ -3439,6 +3579,10 @@ html .welcomebox .toggle-button-end.collapsed {
.source-tab:hover .close-btn {
visibility: visible;
}
/* 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/>. */
.dropdown {
--width: 150px;
background: var(--theme-body-background);
@ -3502,6 +3646,10 @@ html[dir="rtl"] .dropdown {
left: 0;
top: 0;
}
/* 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/>. */
.result-list {
list-style: none;
margin: 0px;
@ -3591,3 +3739,5 @@ html[dir="rtl"] .dropdown {
.theme-dark .result-list {
background-color: var(--theme-body-background);
}
/*# sourceMappingURL=debugger.css.map*/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -275,6 +275,10 @@ var _devtoolsUtils = __webpack_require__(1363);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/* 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/>. */
const { workerHandler } = _devtoolsUtils.workerUtils;
function prettyPrint({ url, indent, source }) {
@ -7587,4 +7591,5 @@ exports.SourceNode = SourceNode;
/***/ })
/******/ });
});
});
//# sourceMappingURL=pretty-print-worker.js.map

View File

@ -482,7 +482,9 @@ var _url = __webpack_require__(334);
* @memberof utils/source
* @static
*/
/* 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 working with Source URLs
@ -593,7 +595,12 @@ function getFilename(source) {
return getFormattedSourceId(id);
}
return getFilenameFromURL(url);
let filename = getFilenameFromURL(url);
const qMarkIdx = filename.indexOf("?");
if (qMarkIdx > 0) {
filename = filename.slice(0, qMarkIdx);
}
return filename;
}
/**
@ -658,13 +665,17 @@ function getSourceLineCount(source) {
* @static
*/
function getMode(source) {
function getMode(source, sourceMetaData) {
const { contentType, text, isWasm, url } = source;
if (!text || isWasm) {
return { name: "text" };
}
if (url && url.match(/\.jsx$/i) || sourceMetaData && sourceMetaData.isReactComponent) {
return "jsx";
}
// if the url ends with .marko we set the name to Javascript so
// syntax highlighting works for marko too
if (url && url.match(/\.marko$/i)) {
@ -735,7 +746,7 @@ const {
isOriginalId
} = __webpack_require__(1389);
const { workerUtils: { WorkerDispatcher } } = __webpack_require__(1390);
const { workerUtils: { WorkerDispatcher } } = __webpack_require__(1363);
const dispatcher = new WorkerDispatcher();
@ -793,7 +804,9 @@ module.exports = {
Object.defineProperty(exports, "__esModule", {
value: true
});
/* 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
@ -1111,180 +1124,6 @@ module.exports = {
/***/ }),
/***/ 1390:
/***/ (function(module, exports, __webpack_require__) {
/* 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/. */
const networkRequest = __webpack_require__(1391);
const workerUtils = __webpack_require__(1392);
module.exports = {
networkRequest,
workerUtils
};
/***/ }),
/***/ 1391:
/***/ (function(module, exports) {
/* 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/. */
function networkRequest(url, opts) {
return fetch(url, {
cache: opts.loadFromCache ? "default" : "no-cache"
}).then(res => {
if (res.status >= 200 && res.status < 300) {
return res.text().then(text => ({ content: text }));
}
return Promise.reject(`request failed with status ${res.status}`);
});
}
module.exports = networkRequest;
/***/ }),
/***/ 1392:
/***/ (function(module, exports) {
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
function WorkerDispatcher() {
this.msgId = 1;
this.worker = null;
} /* 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/. */
WorkerDispatcher.prototype = {
start(url) {
this.worker = new Worker(url);
this.worker.onerror = () => {
console.error(`Error in worker ${url}`);
};
},
stop() {
if (!this.worker) {
return;
}
this.worker.terminate();
this.worker = null;
},
task(method) {
return (...args) => {
return new Promise((resolve, reject) => {
const id = this.msgId++;
this.worker.postMessage({ id, method, args });
const listener = ({ data: result }) => {
if (result.id !== id) {
return;
}
this.worker.removeEventListener("message", listener);
if (result.error) {
reject(result.error);
} else {
resolve(result.response);
}
};
this.worker.addEventListener("message", listener);
});
};
}
};
function workerHandler(publicInterface) {
return function (msg) {
const { id, method, args } = msg.data;
try {
const response = publicInterface[method].apply(undefined, args);
if (response instanceof Promise) {
response.then(val => self.postMessage({ id, response: val }),
// Error can't be sent via postMessage, so be sure to
// convert to string.
err => self.postMessage({ id, error: err.toString() }));
} else {
self.postMessage({ id, response });
}
} catch (error) {
// Error can't be sent via postMessage, so be sure to convert to
// string.
self.postMessage({ id, error: error.toString() });
}
};
}
function streamingWorkerHandler(publicInterface, { timeout = 100 } = {}, worker = self) {
let streamingWorker = (() => {
var _ref = _asyncToGenerator(function* (id, tasks) {
let isWorking = true;
const intervalId = setTimeout(function () {
isWorking = false;
}, timeout);
const results = [];
while (tasks.length !== 0 && isWorking) {
const { callback, context, args } = tasks.shift();
const result = yield callback.call(context, args);
results.push(result);
}
worker.postMessage({ id, status: "pending", data: results });
clearInterval(intervalId);
if (tasks.length !== 0) {
yield streamingWorker(id, tasks);
}
});
return function streamingWorker(_x, _x2) {
return _ref.apply(this, arguments);
};
})();
return (() => {
var _ref2 = _asyncToGenerator(function* (msg) {
const { id, method, args } = msg.data;
const workerMethod = publicInterface[method];
if (!workerMethod) {
console.error(`Could not find ${method} defined in worker.`);
}
worker.postMessage({ id, status: "start" });
try {
const tasks = workerMethod(args);
yield streamingWorker(id, tasks);
worker.postMessage({ id, status: "done" });
} catch (error) {
worker.postMessage({ id, status: "error", error });
}
});
return function (_x3) {
return _ref2.apply(this, arguments);
};
})();
}
module.exports = {
WorkerDispatcher,
workerHandler,
streamingWorkerHandler
};
/***/ }),
/***/ 1393:
/***/ (function(module, exports, __webpack_require__) {
@ -1294,6 +1133,10 @@ module.exports = {
Object.defineProperty(exports, "__esModule", {
value: true
});
/* 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/>. */
function basename(path) {
return path.split("/").pop();
}
@ -1385,8 +1228,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
function ignoreWhiteSpace(str) {
return (/^\s{0,2}$/.test(str) ? "(?!\\s*.*)" : str
);
}
} /* 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/>. */
function wholeMatch(query, wholeWord) {
if (query === "" || !wholeWord) {
@ -1456,7 +1300,9 @@ var _devtoolsUtils = __webpack_require__(1363);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const { workerHandler } = _devtoolsUtils.workerUtils;
const { workerHandler } = _devtoolsUtils.workerUtils; /* 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/>. */
self.onmessage = workerHandler({ getMatches: _getMatches2.default, findSourceMatches: _projectSearch.findSourceMatches });
@ -1496,7 +1342,9 @@ function getMatches(query, text, modifiers) {
}
}
return matchedLocations;
}
} /* 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/>. */
/***/ }),
@ -1541,7 +1389,11 @@ function findSourceMatches(source, queryText) {
matches = [].concat(...matches);
return matches;
} // Maybe reuse file search's functions?
} /* 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/>. */
// Maybe reuse file search's functions?
/***/ }),
@ -1861,7 +1713,7 @@ module.exports = charenc;
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
@ -3441,4 +3293,5 @@ module.exports = freeGlobal;
/***/ })
/******/ });
});
});
//# sourceMappingURL=search-worker.js.map

View File

@ -51,6 +51,7 @@ support-files =
examples/output.js
examples/simple1.js
examples/simple2.js
examples/simple3.js
examples/frames.js
examples/script-mutate.js
examples/script-switching-02.js
@ -65,7 +66,6 @@ support-files =
[browser_dbg-breakpoints.js]
[browser_dbg-breakpoints-toggle.js]
[browser_dbg-breakpoints-reloading.js]
skip-if = true # Bug 1383576
[browser_dbg-breakpoints-cond.js]
[browser_dbg-browser-content-toolbox.js]
skip-if = !e10s # This test is only valid in e10s
@ -73,7 +73,6 @@ skip-if = !e10s # This test is only valid in e10s
[browser_dbg-scopes.js]
[browser_dbg-chrome-create.js]
[browser_dbg-chrome-debugging.js]
skip-if = debug # bug 1374187
[browser_dbg-console.js]
[browser_dbg-debugger-buttons.js]
[browser_dbg-editor-gutter.js]
@ -83,23 +82,25 @@ skip-if = debug # bug 1374187
[browser_dbg-expressions-error.js]
[browser_dbg-iframes.js]
[browser_dbg_keyboard_navigation.js]
skip-if = true # regular failures during release in Bug 1415300
[browser_dbg_keyboard-shortcuts.js]
skip-if = os == "linux" # bug 1351952
[browser_dbg-layout-changes.js]
[browser_dbg-pause-exceptions.js]
skip-if = true # Bug 1393121
[browser_dbg-navigation.js]
[browser_dbg-minified.js]
[browser_dbg-pretty-print.js]
[browser_dbg-pretty-print-console.js]
[browser_dbg-pretty-print-paused.js]
[browser_dbg-preview.js]
skip-if = true # regular failures during release in Bug 1415300
[browser_dbg-returnvalues.js]
[browser_dbg-scopes-mutations.js]
[browser_dbg-search-file.js]
skip-if = os == "win" # Bug 1393121
[browser_dbg-quick-open.js]
skip-if = true
skip-if = true # regular failures during release in Bug 1415300
[browser_dbg-search-project.js]
skip-if = true # Bug 1393121, 1393299
[browser_dbg-sourcemaps.js]
[browser_dbg-sourcemaps-reloading.js]
[browser_dbg-sourcemaps2.js]
@ -108,5 +109,5 @@ skip-if = true # Bug 1393121, 1393299
[browser_dbg-tabs.js]
[browser_dbg-toggling-tools.js]
[browser_dbg-wasm-sourcemaps.js]
skip-if = true
skip-if = true # regular failures during release in Bug 1415300
[browser_dbg-reload.js]

View File

@ -12,16 +12,15 @@ add_task(async function() {
await addBreakpoint(dbg, "scripts.html", 18);
reload(dbg);
await waitForPaused(dbg);
await waitForLoadedSource(dbg, "doc-scripts.html");
assertPausedLocation(dbg);
await resume(dbg);
const paused = waitForPaused(dbg);
// Create an eval script that pauses itself.
invokeInTab("doEval");
await waitForPaused(dbg);
await paused;
await resume(dbg);
const source = getSelectedSource(getState()).toJS();
ok(!source.url, "It is an eval source");

View File

@ -1,21 +1,31 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
function clickStepOver(dbg) {
clickElement(dbg, "stepOver");
function clickButton(dbg, button) {
const resumeFired = waitForDispatch(dbg, "COMMAND");
clickElement(dbg, button);
return resumeFired;
}
async function clickStepOver(dbg) {
await clickButton(dbg, "stepOver");
return waitForPaused(dbg);
}
function clickStepIn(dbg) {
clickElement(dbg, "stepIn");
async function clickStepIn(dbg) {
await clickButton(dbg, "stepIn");
return waitForPaused(dbg);
}
function clickStepOut(dbg) {
clickElement(dbg, "stepOut");
async function clickStepOut(dbg) {
await clickButton(dbg, "stepOut");
return waitForPaused(dbg);
}
async function clickResume(dbg) {
return clickButton(dbg, "resume");
}
/**
* Test debugger buttons
* 1. resume
@ -33,7 +43,7 @@ add_task(async function() {
assertPausedLocation(dbg);
// resume
clickElement(dbg, "resume");
await clickResume(dbg)
await waitForPaused(dbg);
assertPausedLocation(dbg);

View File

@ -4,13 +4,6 @@
// 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);
}
add_task(async 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
@ -54,5 +47,5 @@ add_task(async function() {
await waitForLoadedSource(dbg, "long.js");
assertPausedLocation(dbg);
ok(isElementVisible(dbg, "breakpoint"), "Breakpoint is visible");
ok(isVisibleInEditor(dbg, findElement(dbg, "breakpoint")), "Breakpoint is visible");
});

View File

@ -40,7 +40,6 @@ async function addExpression(dbg, input) {
findElementWithSelector(dbg, expressionSelectors.input).focus();
type(dbg, input);
pressKey(dbg, "Enter");
await waitForDispatch(dbg, "EVALUATE_EXPRESSION");
}
@ -48,10 +47,11 @@ async function editExpression(dbg, input) {
info("updating the expression");
dblClickElement(dbg, "expressionNode", 1);
// Position cursor reliably at the end of the text.
const evaluation = waitForDispatch(dbg, "EVALUATE_EXPRESSION")
pressKey(dbg, "End");
type(dbg, input);
pressKey(dbg, "Enter");
await waitForDispatch(dbg, "EVALUATE_EXPRESSION");
await evaluation;
}
/*
@ -59,13 +59,18 @@ async function editExpression(dbg, input) {
* resume, and wait for the expression to finish being evaluated.
*/
async function addBadExpression(dbg, input) {
const paused = waitForPaused(dbg);
const added = addExpression(dbg, input);
const evaluation = waitForDispatch(dbg, "EVALUATE_EXPRESSION")
findElementWithSelector(dbg, expressionSelectors.input).focus();
type(dbg, input);
pressKey(dbg, "Enter");
await waitForPaused(dbg);
await paused;
ok(dbg.selectors.isEvaluatingExpression(dbg.getState()));
await resume(dbg);
await added;
await evaluation;
}
add_task(async function() {

View File

@ -24,7 +24,7 @@ add_task(async function() {
await waitForLoadedSource(dbg, "simple1");
assertPausedLocation(dbg);
is(countSources(dbg), 4, "4 sources are loaded.");
is(countSources(dbg), 5, "5 sources are loaded.");
await navigate(dbg, "about:blank");
await waitForDispatch(dbg, "NAVIGATE");
@ -36,11 +36,12 @@ add_task(async function() {
"doc-scripts.html",
"simple1.js",
"simple2.js",
"simple3.js",
"long.js",
"scripts.html"
);
is(countSources(dbg), 4, "4 sources are loaded.");
is(countSources(dbg), 5, "5 sources are loaded.");
// Test that the current select source persists across reloads
await selectSource(dbg, "long.js");

View File

@ -19,26 +19,34 @@ function caughtException() {
add_task(async function() {
const dbg = await initDebugger("doc-exceptions.html");
// test skipping an uncaught exception
log("1. test skipping an uncaught exception");
await uncaughtException();
ok(!isPaused(dbg));
// Test pausing on an uncaught exception
log("2. Test pausing on an uncaught exception");
await togglePauseOnExceptions(dbg, true, false);
uncaughtException();
await waitForPaused(dbg);
assertPausedLocation(dbg);
await resume(dbg);
await waitForActive(dbg);
// Test pausing on a caught Error
log("3. Test pausing on a caught Error");
caughtException();
await waitForPaused(dbg);
assertPausedLocation(dbg);
log("3.b Test pausing in the catch statement");
await resume(dbg);
await waitForPaused(dbg);
assertPausedLocation(dbg);
await resume(dbg);
// Test skipping a caught error
log("4. Test skipping a caught error");
await togglePauseOnExceptions(dbg, true, true);
caughtException();
log("4.b Test pausing in the catch statement");
await waitForPaused(dbg);
assertPausedLocation(dbg);
await resume(dbg);

View File

@ -0,0 +1,68 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
function getCoordsFromPosition(cm, { line, ch }) {
return cm.charCoords({ line: ~~line, ch: ~~ch });
}
function hoverAtPos(dbg, { line, ch }) {
const cm = getCM(dbg);
const coords = getCoordsFromPosition(cm, { line: line - 1, ch });
const tokenEl = dbg.win.document.elementFromPoint(coords.left, coords.top);
tokenEl.dispatchEvent(
new MouseEvent("mouseover", {
bubbles: true,
cancelable: true,
view: dbg.win
})
);
}
function assertTooltip(dbg, { result, expression }) {
const previewEl = findElement(dbg, "tooltip");
is(previewEl.innerText, result, "Preview text shown to user");
const preview = dbg.selectors.getPreview(dbg.getState());
is(`${preview.result}`, result, "Preview.result");
is(preview.updating, false, "Preview.updating");
is(preview.expression, expression, "Preview.expression");
}
function assertPopup(dbg, { field, value, expression }) {
const previewEl = findElement(dbg, "popup");
is(previewEl.innerText, "", "Preview text shown to user");
const preview = dbg.selectors.getPreview(dbg.getState());
is(
`${preview.result.preview.ownProperties[field].value}`,
value,
"Preview.result"
);
is(preview.updating, false, "Preview.updating");
is(preview.expression, expression, "Preview.expression");
}
add_task(async function() {
const dbg = await initDebugger("doc-scripts.html");
const { selectors: { getSelectedSource }, getState } = dbg;
const simple3 = findSource(dbg, "simple3.js");
await selectSource(dbg, "simple3");
await addBreakpoint(dbg, simple3, 5);
invokeInTab("simple");
await waitForPaused(dbg);
const tooltipPreviewed = waitForDispatch(dbg, "SET_PREVIEW");
hoverAtPos(dbg, { line: 5, ch: 12 });
await tooltipPreviewed;
assertTooltip(dbg, { result: "3", expression: "result" });
const popupPreviewed = waitForDispatch(dbg, "SET_PREVIEW");
hoverAtPos(dbg, { line: 2, ch: 10 });
await popupPreviewed;
assertPopup(dbg, { field: "foo", value: "1", expression: "obj" });
assertPopup(dbg, { field: "bar", value: "2", expression: "obj" });
});

View File

@ -99,7 +99,7 @@ add_task(async function() {
quickOpen(dbg, "#");
is(resultCount(dbg), 1, "one variable result");
const results = findAllElements(dbg, "resultItems");
results.forEach(result => is(result.textContent, "x:13"));
results.forEach(result => is(result.textContent, "x13"));
await waitToClose(dbg);
info("Testing goto line:column");

View File

@ -0,0 +1,69 @@
function getLabel(dbg, index) {
return findElement(dbg, "scopeNode", index).innerText;
}
function getValue(dbg, index) {
return findElement(dbg, "scopeValue", index).innerText;
}
function toggleScopes(dbg) {
return findElement(dbg, "scopesHeader").click();
}
async function testReturnValue(dbg, val) {
invokeInTab("return_something", val);
await waitForPaused(dbg);
// "Step in" 3 times to get to the point where the debugger can
// see the return value.
await stepIn(dbg);
await stepIn(dbg);
await stepIn(dbg);
is(getLabel(dbg, 1), "return_something", "check for return_something");
// We don't show "undefined" but we do show other falsy values.
let label = getLabel(dbg, 2);
if (val === "undefined") {
ok(label !== "<return>", "do not show <return> for undefined");
} else {
is(label, "<return>", "check for <return>");
// The "uneval" call here gives us the way one would write `val` as
// a JavaScript expression, similar to the way the debugger
// displays values, so this test works when `val` is a string.
is(getValue(dbg, 2), uneval(val), `check value is ${uneval(val)}`);
}
await resume(dbg);
assertNotPaused(dbg);
}
async function testThrowValue(dbg, val) {
invokeInTab("throw_something", val);
await waitForPaused(dbg);
// "Step in" once to get to the point where the debugger can see the
// exception.
await stepIn(dbg);
is(getLabel(dbg, 1), "callee", "check for callee");
is(getLabel(dbg, 2), "<exception>", "check for <exception>");
// The "uneval" call here gives us the way one would write `val` as
// a JavaScript expression, similar to the way the debugger
// displays values, so this test works when `val` is a string.
is(getValue(dbg, 2), uneval(val), `check exception is ${uneval(val)}`);
await resume(dbg);
await waitForPaused(dbg);
await resume(dbg);
assertNotPaused(dbg);
}
add_task(async function() {
const dbg = await initDebugger("doc-return-values.html");
toggleScopes(dbg);
await togglePauseOnExceptions(dbg, true, false);
await testReturnValue(dbg, "to sender");
await testThrowValue(dbg, "a fit");
});

View File

@ -78,10 +78,8 @@ add_task(async function() {
'The "lastName" element has the expected "Doe" value'
);
info("Resuming");
onPaused = waitForPaused(dbg);
await resume(dbg);
await onPaused;
await waitForPaused(dbg);
is(
getScopeNodeLabel(dbg, 2),

View File

@ -78,7 +78,6 @@ add_task(async function() {
assertPausedLocation(dbg);
await stepIn(dbg);
// await waitForMappedScopes(dbg);
assertPausedLocation(dbg);
await stepOver(dbg);

View File

@ -1,11 +1,10 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
function assertBpInGutter(dbg, lineNumber) {
const el = findElement(dbg, "breakpoint");
const bpLineNumber = +el.querySelector(".CodeMirror-linenumber").innerText;
is(bpLineNumber, lineNumber);
is(bpLineNumber, lineNumber, "Breakpoint is on the correct line in the gutter");
}
// Tests loading sourcemapped sources, setting breakpoints, and

View File

@ -11,6 +11,7 @@ add_task(async function() {
// "A promise chain failed to handle a rejection: Debugger.Frame is not live"
await waitForSource(dbg, "doc-wasm-sourcemaps");
await waitForLoadedSources(dbg);
await reload(dbg);
await waitForPaused(dbg);

View File

@ -8,8 +8,10 @@
</head>
<body>
<button onclick="simple()">Click me!</button>
<script src="simple1.js"></script>
<script src="simple2.js"></script>
<script src="simple3.js"></script>
<script src="long.js"></script>
<script>
// This inline script allows this HTML page to show up as a

View File

@ -7,25 +7,33 @@ function main() {
}
function doEval() {
eval("(" + function() {
debugger;
eval(
"(" +
function() {
debugger;
window.evaledFunc = function() {
var foo = 1;
var bar = 2;
return foo + bar;
};
}.toString() + ")()");
window.evaledFunc = function() {
var foo = 1;
var bar = 2;
return foo + bar;
};
}.toString() +
")()"
);
}
function doNamedEval() {
eval("(" + function() {
debugger;
eval(
"(" +
function() {
debugger;
window.evaledFunc = function() {
var foo = 1;
var bar = 2;
return foo + bar;
};
}.toString() + ")();\n //# sourceURL=evaled.js");
window.evaledFunc = function() {
var foo = 1;
var bar = 2;
return foo + bar;
};
}.toString() +
")();\n //# sourceURL=evaled.js"
);
}

View File

@ -0,0 +1,6 @@
function simple() {
const obj = { foo: 1, bar: 2 };
const func = foo(1, 2);
const result = func();
return result;
}

View File

@ -52,6 +52,18 @@ registerCleanupFunction(() => {
delete window.resumeTest;
});
function log(msg, data) {
info(`${msg} ${!data ? "" : JSON.stringify(data)}`);
}
function logThreadEvents(dbg, event) {
const thread = dbg.toolbox.threadClient;
thread.addListener(event, function onEvent(eventName, ...args) {
info(`Thread event '${eventName}' fired.`);
});
}
// Wait until an action of `type` is dispatched. This is different
// then `_afterDispatchDone` because it doesn't wait for async actions
// to be done/errored. Use this if you want to listen for the "start"
@ -109,11 +121,11 @@ function waitForDispatch(dbg, type, eventRepeat = 1) {
let count = 0;
return Task.spawn(function*() {
info("Waiting for " + type + " to dispatch " + eventRepeat + " time(s)");
info(`Waiting for ${type} to dispatch ${eventRepeat} time(s)`);
while (count < eventRepeat) {
yield _afterDispatchDone(dbg.store, type);
count++;
info(type + " dispatched " + count + " time(s)");
info(`${type} dispatched ${count} time(s)`);
}
});
}
@ -128,12 +140,12 @@ function waitForDispatch(dbg, type, eventRepeat = 1) {
* @static
*/
function waitForThreadEvents(dbg, eventName) {
info("Waiting for thread event '" + eventName + "' to fire.");
info(`Waiting for thread event '${eventName}' to fire.`);
const thread = dbg.toolbox.threadClient;
return new Promise(function(resolve, reject) {
thread.addListener(eventName, function onEvent(eventName, ...args) {
info("Thread event '" + eventName + "' fired.");
info(`Thread event '${eventName}' fired.`);
thread.removeListener(eventName, onEvent);
resolve.apply(resolve, args);
});
@ -180,7 +192,7 @@ function waitForSources(dbg, ...sources) {
return Promise.resolve();
}
info("Waiting on sources: " + sources.join(", "));
info(`Waiting on sources: ${sources.join(", ")}`);
const { selectors: { getSources }, store } = dbg;
return Promise.all(
sources.map(url => {
@ -232,7 +244,7 @@ function waitForSelectedSource(dbg, url) {
return true;
}
const newSource = findSource(dbg, url);
const newSource = findSource(dbg, url, { silent: true });
if (newSource.id != source.get("id")) {
return false;
}
@ -244,6 +256,15 @@ function waitForSelectedSource(dbg, url) {
);
}
/**
* Assert that the debugger is not currently paused.
* @memberof mochitest/asserts
* @static
*/
function assertNotPaused(dbg) {
ok(!isPaused(dbg), "client is not paused");
}
/**
* Assert that the debugger is paused at the correct location.
*
@ -262,6 +283,8 @@ function assertPausedLocation(dbg) {
const pause = getPause(getState());
const pauseLine = pause && pause.frame && pause.frame.location.line;
assertDebugLine(dbg, pauseLine);
ok(isVisibleInEditor(dbg, getCM(dbg).display.gutters), "gutter is visible");
}
function assertDebugLine(dbg, line) {
@ -278,10 +301,15 @@ function assertDebugLine(dbg, line) {
}
ok(
lineInfo.wrapClass.includes("debug-line"),
lineInfo.wrapClass.includes("new-debug-line"),
"Line is highlighted as paused"
);
const debugLine = findElementWithSelector(dbg, ".new-debug-line")
|| findElementWithSelector(dbg, ".new-debug-line-error");
ok(isVisibleInEditor(dbg, debugLine), "debug line is visible");
const markedSpans = lineInfo.handle.markedSpans;
if (markedSpans && markedSpans.length > 0) {
const marker = markedSpans[0].marker;
@ -311,10 +339,7 @@ function assertHighlightLocation(dbg, source, line) {
// Check the highlight line
const lineEl = findElement(dbg, "highlightLine");
ok(lineEl, "Line is highlighted");
ok(
isVisibleWithin(findElement(dbg, "codeMirror"), lineEl),
"Highlighted line is visible"
);
ok(isVisibleInEditor(dbg, lineEl), "Highlighted line is visible");
ok(
getCM(dbg)
.lineInfo(line - 1)
@ -335,6 +360,14 @@ function isPaused(dbg) {
return !!getPause(getState());
}
async function waitForLoadedObjects(dbg) {
const { hasLoadingObjects } = dbg.selectors;
return waitForState(
dbg,
state => !hasLoadingObjects(state),
"loaded objects"
);
}
/**
* Waits for the debugger to be fully paused.
*
@ -343,13 +376,36 @@ function isPaused(dbg) {
* @static
*/
async function waitForPaused(dbg) {
// We want to make sure that we get both a real paused event and
// that the state is fully populated. The client may do some more
// work (call other client methods) before populating the state.
let loading = waitForDispatch(dbg, "LOAD_OBJECT_PROPERTIES");
await waitForThreadEvents(dbg, "paused");
await waitForState(dbg, state => isPaused(dbg));
await loading;
const { getSelectedScope, hasLoadingObjects } = dbg.selectors;
return waitForState(
dbg,
state => {
const paused = isPaused(dbg);
const scope = !!getSelectedScope(state);
const loaded = !hasLoadingObjects(state);
return paused && scope && loaded;
},
"paused"
);
}
/*
* useful for when you want to see what is happening
* e.g await waitForever()
*/
function waitForever() {
return new Promise(r => {});
}
/*
* useful for waiting for a short amount of time as
* a placeholder for a better waitForX handler.
*
* e.g await waitForTime(500)
*/
function waitForTime(ms) {
return new Promise(r => setTimeout(r, ms));
}
/**
@ -463,7 +519,7 @@ function pauseTest() {
* @return {Object} source
* @static
*/
function findSource(dbg, url) {
function findSource(dbg, url, { silent } = { silent: false }) {
if (typeof url !== "string") {
// Support passing in a source object itelf all APIs that use this
// function support both styles
@ -475,7 +531,11 @@ function findSource(dbg, url) {
const source = sources.find(s => (s.get("url") || "").includes(url));
if (!source) {
throw new Error("Unable to find source: " + url);
if (silent) {
return false;
}
throw new Error(`Unable to find source: ${url}`);
}
return source.toJS();
@ -484,11 +544,21 @@ function findSource(dbg, url) {
function waitForLoadedSource(dbg, url) {
return waitForState(
dbg,
state => findSource(dbg, url).loadedState == "loaded",
`loaded source`
state => findSource(dbg, url, { silent: true }).loadedState == "loaded",
"loaded source"
);
}
function waitForLoadedSources(dbg) {
return waitForState(
dbg,
state => {
const sources = dbg.selectors.getSources(state).valueSeq().toJS()
return !sources.some(source => source.loadedState == "loading")
},
"loaded source"
);
}
/**
* Selects the source.
*
@ -500,13 +570,13 @@ function waitForLoadedSource(dbg, url) {
* @static
*/
function selectSource(dbg, url, line) {
info("Selecting source: " + url);
info(`Selecting source: ${url}`);
const source = findSource(dbg, url);
return dbg.actions.selectSource(source.id, { location: { line } });
}
function closeTab(dbg, url) {
info("Closing tab: " + url);
info(`Closing tab: ${url}`);
const source = findSource(dbg, url);
return dbg.actions.closeTab(source.url);
}
@ -519,9 +589,9 @@ function closeTab(dbg, url) {
* @return {Promise}
* @static
*/
function stepOver(dbg) {
async function stepOver(dbg) {
info("Stepping over");
dbg.actions.stepOver();
await dbg.actions.stepOver();
return waitForPaused(dbg);
}
@ -533,9 +603,9 @@ function stepOver(dbg) {
* @return {Promise}
* @static
*/
function stepIn(dbg) {
async function stepIn(dbg) {
info("Stepping in");
dbg.actions.stepIn();
await dbg.actions.stepIn();
return waitForPaused(dbg);
}
@ -547,9 +617,9 @@ function stepIn(dbg) {
* @return {Promise}
* @static
*/
function stepOut(dbg) {
async function stepOut(dbg) {
info("Stepping out");
dbg.actions.stepOut();
await dbg.actions.stepOut();
return waitForPaused(dbg);
}
@ -563,8 +633,7 @@ function stepOut(dbg) {
*/
function resume(dbg) {
info("Resuming");
dbg.actions.resume();
return waitForState(dbg, state => !dbg.selectors.isPaused(state), "resumed");
return dbg.actions.resume();
}
function deleteExpression(dbg, input) {
@ -652,7 +721,7 @@ function removeBreakpoint(dbg, sourceId, line, col) {
* @return {Promise}
* @static
*/
function togglePauseOnExceptions(
async function togglePauseOnExceptions(
dbg,
pauseOnExceptions,
ignoreCaughtExceptions
@ -663,26 +732,37 @@ function togglePauseOnExceptions(
);
if (!isPaused(dbg)) {
return waitForThreadEvents(dbg, "resumed");
await waitForThreadEvents(dbg, "resumed");
await waitForLoadedObjects(dbg);
}
return command;
}
function waitForActive(dbg) {
return waitForState(dbg, state => !dbg.selectors.isPaused(state), "active");
}
// Helpers
/**
* Invokes a global function in the debuggee tab.
*
* @memberof mochitest/helpers
* @param {String} fnc
* @param {String} fnc The name of a global function on the content window to
* call. This is applied to structured clones of the
* remaining arguments to invokeInTab.
* @param {Any} ...args Remaining args to serialize and pass to fnc.
* @return {Promise}
* @static
*/
function invokeInTab(fnc) {
info(`Invoking function ${fnc} in tab`);
return ContentTask.spawn(gBrowser.selectedBrowser, fnc, function*(fnc) {
content.wrappedJSObject[fnc](); // eslint-disable-line mozilla/no-cpows-in-tests, max-len
function invokeInTab(fnc, ...args) {
info(`Invoking in tab: ${fnc}(${args.map(uneval).join(",")})`);
return ContentTask.spawn(gBrowser.selectedBrowser, { fnc, args }, function*({
fnc,
args
}) {
content.wrappedJSObject[fnc](...args); // eslint-disable-line mozilla/no-cpows-in-tests, max-len
});
}
@ -755,10 +835,54 @@ function type(dbg, string) {
string.split("").forEach(char => EventUtils.synthesizeKey(char, {}, dbg.win));
}
function isVisibleWithin(outerEl, innerEl) {
/*
* Checks to see if the inner element is visible inside the editor.
*
* @memberof mochitest/helpers
* @param {Object} dbg
* @param {HTMLElement} inner element
* @return {boolean}
* @static
*/
function isVisibleInEditor(dbg, element) {
return isVisible(findElement(dbg, "codeMirror"), element);
}
/*
* Checks to see if the inner element is visible inside the
* outer element.
*
* Note, the inner element does not need to be entirely visible,
* it is possible for it to be somewhat clipped by the outer element's
* bounding element or for it to span the entire length, starting before the
* outer element and ending after.
*
* @memberof mochitest/helpers
* @param {HTMLElement} outer element
* @param {HTMLElement} inner element
* @return {boolean}
* @static
*/
function isVisible(outerEl, innerEl) {
if (!innerEl || !outerEl) {
return false;
}
const innerRect = innerEl.getBoundingClientRect();
const outerRect = outerEl.getBoundingClientRect();
return innerRect.top > outerRect.top && innerRect.bottom < outerRect.bottom;
const verticallyVisible =
(innerRect.top >= outerRect.top || innerRect.bottom <= outerRect.bottom)
|| (innerRect.top < outerRect.top && innerRect.bottom > outerRect.bottom);
const horizontallyVisible =
(innerRect.left >= outerRect.left || innerRect.right <= outerRect.right)
|| (innerRect.left < outerRect.left && innerRect.right > outerRect.right);
const visible = verticallyVisible && horizontallyVisible;
return visible;
}
const selectors = {
@ -785,7 +909,7 @@ const selectors = {
highlightLine: ".CodeMirror-code > .highlight-line",
codeMirror: ".CodeMirror",
resume: ".resume.active",
sourceTabs: `.source-tabs`,
sourceTabs: ".source-tabs",
stepOver: ".stepOver.active",
stepOut: ".stepOut.active",
stepIn: ".stepIn.active",
@ -796,8 +920,10 @@ const selectors = {
sourceNode: i => `.sources-list .tree-node:nth-child(${i})`,
sourceNodes: ".sources-list .tree-node",
sourceArrow: i => `.sources-list .tree-node:nth-child(${i}) .arrow`,
resultItems: `.result-list .result-item`,
fileMatch: `.managed-tree .result`
resultItems: ".result-list .result-item",
fileMatch: ".managed-tree .result",
popup: ".popover",
tooltip: ".tooltip"
};
function getSelector(elementName, ...args) {

View File

@ -1140,14 +1140,15 @@ addAsyncAnimTest("tree_ordering", { observe: div, subtree: true }, function*() {
var divAnimations = div.getAnimations();
var childAAnimations = childA.getAnimations();
var childBAnimations = childB.getAnimations();
var divBeforeAnimations =
[ for (x of docAnims) if (x.effect.target.parentElement == div &&
x.effect.target.type == "::before") x ];
docAnims.filter(x => (x.effect.target.parentElement == div &&
x.effect.target.type == "::before"));
var divAfterAnimations =
[ for (x of docAnims) if (x.effect.target.parentElement == div &&
x.effect.target.type == "::after") x ];
docAnims.filter(x => (x.effect.target.parentElement == div &&
x.effect.target.type == "::after"));
var childBPseudoAnimations =
[ for (x of docAnims) if (x.effect.target.parentElement == childB) x ];
docAnims.filter(x => x.effect.target.parentElement == childB);
// The order in which we get the corresponding records is currently
// based on the order we visit these nodes when updating styles.

View File

@ -216,7 +216,6 @@ EXPORTS.mozilla.dom += [
'TimeoutManager.h',
'TreeWalker.h',
'WebKitCSSMatrix.h',
'WebSocket.h',
'WindowOrientationObserver.h',
]
@ -364,7 +363,6 @@ UNIFIED_SOURCES += [
'TimeoutManager.cpp',
'TreeWalker.cpp',
'WebKitCSSMatrix.cpp',
'WebSocket.cpp',
'WindowNamedPropertiesHandler.cpp',
'WindowOrientationObserver.cpp',
'XPathGenerator.cpp',

View File

@ -34,4 +34,3 @@ support-files = file_navigator_resolve_identity_xrays.xul
[test_sandboxed_blob_uri.html]
[test_sendQueryContentAndSelectionSetEvent.html]
[test_urgent_start.html]
[test_websocket_frame.html]

View File

@ -34,7 +34,7 @@ var test = function (isContent) {
};
// Returns generator object that iterates through pref values.
let prefVals = (for (prefVal of [false, true]) prefVal);
let prefVals = (function*() { yield false; yield true; })();
// The main test function, runs until all pref values are exhausted.
let nextTest = function () {

View File

@ -65,7 +65,6 @@ support-files =
file_bug1091883_frame.html
file_bug1091883_subframe.html
file_bug1091883_target.html
file_bug1384658.html
file_bug28293.sjs
file_bug326337.xml
file_bug326337_inner.html
@ -156,15 +155,6 @@ support-files =
file_timer_flood.html
file_viewport_scroll_quirks.html
file_viewport_scroll_xml.xml
file_websocket_basic_wsh.py
file_websocket_bigBlob_wsh.py
file_websocket_hello_wsh.py
file_websocket_http_resource.txt
file_websocket_permessage_deflate_wsh.py
file_websocket_permessage_deflate_disabled_wsh.py
file_websocket_permessage_deflate_rejected_wsh.py
file_websocket_permessage_deflate_params_wsh.py
file_websocket_wsh.py
file_x-frame-options_main.html
file_x-frame-options_page.sjs
file_xhtmlserializer_1.xhtml
@ -224,8 +214,6 @@ support-files =
file_bug1250148.sjs
file_bug1268962.sjs
mozbrowser_api_utils.js
websocket_helpers.js
websocket_tests.js
!/dom/security/test/cors/file_CrossSiteXHR_server.sjs
!/image/test/mochitest/blue.png
script_bug1238440.js
@ -250,8 +238,6 @@ support-files =
file4_setting_opener.html
PASS.html
FAIL.html
window_bug1384658.html
frame_bug1384658.html
[test_anchor_area_referrer.html]
[test_anchor_area_referrer_changing.html]
@ -599,8 +585,6 @@ skip-if = stylo # bug 1293844
[test_bug1064481.html]
[test_bug1070015.html]
[test_bug1075702.html]
[test_bug1081686.html]
skip-if = toolkit == 'android'
[test_bug1091883.html]
[test_bug1101364.html]
skip-if = toolkit == 'android'
@ -625,8 +609,6 @@ skip-if = toolkit == 'android'
[test_bug1318303.html]
[test_bug1375050.html]
[test_bug1381710.html]
[test_bug1384658.html]
skip-if = toolkit == 'android'
[test_bug1384661.html]
[test_bug1399603.html]
[test_bug1399605.html]
@ -805,27 +787,6 @@ skip-if = toolkit == 'android'
tags = audiochannel
[test_webaudioNotificationStopOnNavigation.html]
tags = audiochannel
[test_websocket_basic.html]
skip-if = toolkit == 'android'
[test_websocket_hello.html]
skip-if = toolkit == 'android'
[test_websocket_permessage_deflate.html]
skip-if = toolkit == 'android'
[test_webSocket_sandbox.html]
skip-if = toolkit == 'android'
support-files = iframe_webSocket_sandbox.html
[test_websocket1.html]
skip-if = toolkit == 'android'
[test_websocket2.html]
skip-if = toolkit == 'android'
[test_websocket3.html]
skip-if = toolkit == 'android'
[test_websocket4.html]
skip-if = toolkit == 'android'
[test_websocket5.html]
skip-if = toolkit == 'android'
[test_websocket_bigBlob.html]
skip-if = toolkit == 'android'
[test_window_constructor.html]
[test_window_content.html]
[test_window_cross_origin_props.html]

View File

@ -11,7 +11,6 @@ XPCSHELL_TESTS_MANIFESTS += [
MOCHITEST_MANIFESTS += [
'mochitest.ini',
'websocket_hybi/mochitest.ini',
]
MOCHITEST_CHROME_MANIFESTS += [

View File

@ -75,7 +75,10 @@ ClientManager::~ClientManager()
Shutdown();
MOZ_DIAGNOSTIC_ASSERT(this == PR_GetThreadPrivate(sClientManagerThreadLocalIndex));
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
PRStatus status =
#endif
PR_SetThreadPrivate(sClientManagerThreadLocalIndex, nullptr);
MOZ_DIAGNOSTIC_ASSERT(status == PR_SUCCESS);
}
@ -171,7 +174,9 @@ ClientManager::GetOrCreateForCurrentThread()
if (!cm) {
cm = new ClientManager();
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
PRStatus status =
#endif
PR_SetThreadPrivate(sClientManagerThreadLocalIndex, cm.get());
MOZ_DIAGNOSTIC_ASSERT(status == PR_SUCCESS);
}
@ -193,7 +198,9 @@ void
ClientManager::Startup()
{
MOZ_ASSERT(NS_IsMainThread());
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
PRStatus status =
#endif
PR_NewThreadPrivateIndex(&sClientManagerThreadLocalIndex, nullptr);
MOZ_DIAGNOSTIC_ASSERT(status == PR_SUCCESS);
}

View File

@ -65,7 +65,7 @@ function makeHandler(nameTemplate, eventName, expectedStates) {
function doTest() {
var iosvc = SpecialPowers.Cc["@mozilla.org/network/io-service;1"]
.getService(SpecialPowers.Ci.nsIIOService2);
.getService(SpecialPowers.Ci.nsIIOService);
iosvc.manageOfflineStatus = false;
iosvc.offline = false;
ok(navigator.onLine, "navigator.onLine should be true, since we've just " +

View File

@ -549,14 +549,14 @@ mozilla::ipc::IPCResult
ContentChild::RecvSetXPCOMProcessAttributes(const XPCOMInitData& aXPCOMInit,
const StructuredCloneData& aInitialData,
nsTArray<LookAndFeelInt>&& aLookAndFeelIntCache,
nsTArray<SystemFontListEntry>&& aFontList)
nsTArray<FontFamilyListEntry>&& aFontFamilyList)
{
if (!sShutdownCanary) {
return IPC_OK();
}
mLookAndFeelCache = Move(aLookAndFeelIntCache);
mFontList = Move(aFontList);
mFontFamilies = Move(aFontFamilyList);
gfx::gfxVars::SetValuesForInitialize(aXPCOMInit.gfxNonDefaultVarUpdates());
InitXPCOM(aXPCOMInit, aInitialData);
InitGraphicsDeviceData(aXPCOMInit.contentDeviceData());
@ -2541,14 +2541,6 @@ ContentChild::RecvUpdateDictionaryList(InfallibleTArray<nsString>&& aDictionarie
return IPC_OK();
}
mozilla::ipc::IPCResult
ContentChild::RecvUpdateFontList(InfallibleTArray<SystemFontListEntry>&& aFontList)
{
mFontList = Move(aFontList);
gfxPlatform::GetPlatform()->UpdateFontList();
return IPC_OK();
}
mozilla::ipc::IPCResult
ContentChild::RecvUpdateAppLocales(nsTArray<nsCString>&& aAppLocales)
{

View File

@ -399,8 +399,6 @@ public:
virtual mozilla::ipc::IPCResult RecvUpdateDictionaryList(InfallibleTArray<nsString>&& aDictionaries) override;
virtual mozilla::ipc::IPCResult RecvUpdateFontList(InfallibleTArray<SystemFontListEntry>&& aFontList) override;
virtual mozilla::ipc::IPCResult RecvUpdateAppLocales(nsTArray<nsCString>&& aAppLocales) override;
virtual mozilla::ipc::IPCResult RecvUpdateRequestedLocales(nsTArray<nsCString>&& aRequestedLocales) override;
@ -605,7 +603,7 @@ public:
RecvSetXPCOMProcessAttributes(const XPCOMInitData& aXPCOMInit,
const StructuredCloneData& aInitialData,
nsTArray<LookAndFeelInt>&& aLookAndFeelIntCache,
nsTArray<SystemFontListEntry>&& aFontList) override;
nsTArray<FontFamilyListEntry>&& aFontFamilyList) override;
virtual mozilla::ipc::IPCResult
RecvProvideAnonymousTemporaryFile(const uint64_t& aID, const FileDescOrError& aFD) override;
@ -643,11 +641,11 @@ public:
SendGetA11yContentId();
#endif // defined(XP_WIN) && defined(ACCESSIBILITY)
// Get a reference to the font list passed from the chrome process,
// Get a reference to the font family list passed from the chrome process,
// for use during gfx initialization.
InfallibleTArray<mozilla::dom::SystemFontListEntry>&
SystemFontList() {
return mFontList;
InfallibleTArray<mozilla::dom::FontFamilyListEntry>&
SystemFontFamilyList() {
return mFontFamilies;
}
// PURLClassifierChild
@ -751,10 +749,10 @@ private:
InfallibleTArray<nsString> mAvailableDictionaries;
// Temporary storage for a list of available fonts, passed from the
// Temporary storage for a list of available font families, passed from the
// parent process and used to initialize gfx in the child. Currently used
// only on MacOSX and Linux.
InfallibleTArray<mozilla::dom::SystemFontListEntry> mFontList;
// only on MacOSX.
InfallibleTArray<mozilla::dom::FontFamilyListEntry> mFontFamilies;
// Temporary storage for nsXPLookAndFeel flags.
nsTArray<LookAndFeelInt> mLookAndFeelCache;

View File

@ -171,7 +171,6 @@
#include "nsDocShell.h"
#include "nsOpenURIInFrameParams.h"
#include "mozilla/net/NeckoMessageUtils.h"
#include "gfxPlatform.h"
#include "gfxPrefs.h"
#include "prio.h"
#include "private/pprio.h"
@ -2225,10 +2224,9 @@ ContentParent::InitInternal(ProcessPriority aInitialPriority,
}
}
}
// This is only implemented (returns a non-empty list) by MacOSX and Linux
// at present.
nsTArray<SystemFontListEntry> fontList;
gfxPlatform::GetPlatform()->ReadSystemFontList(&fontList);
// This is only implemented (returns a non-empty list) by MacOSX at present.
nsTArray<FontFamilyListEntry> fontFamilies;
gfxPlatform::GetPlatform()->GetSystemFontFamilyList(&fontFamilies);
nsTArray<LookAndFeelInt> lnfCache = LookAndFeel::GetIntCache();
// Content processes have no permission to access profile directory, so we
@ -2271,7 +2269,7 @@ ContentParent::InitInternal(ProcessPriority aInitialPriority,
screenManager.CopyScreensToRemote(this);
Unused << SendSetXPCOMProcessAttributes(xpcomInit, initialData, lnfCache,
fontList);
fontFamilies);
if (aSendRegisteredChrome) {
nsCOMPtr<nsIChromeRegistry> registrySvc = nsChromeRegistry::GetService();
@ -4265,17 +4263,6 @@ ContentParent::NotifyUpdatedDictionaries()
}
}
void
ContentParent::NotifyUpdatedFonts()
{
InfallibleTArray<SystemFontListEntry> fontList;
gfxPlatform::GetPlatform()->ReadSystemFontList(&fontList);
for (auto* cp : AllProcesses(eLive)) {
Unused << cp->SendUpdateFontList(fontList);
}
}
/*static*/ void
ContentParent::UnregisterRemoteFrame(const TabId& aTabId,
const ContentParentId& aCpId,

View File

@ -269,8 +269,6 @@ public:
static void NotifyUpdatedDictionaries();
static void NotifyUpdatedFonts();
#if defined(XP_WIN)
/**
* Windows helper for firing off an update window request to a plugin

View File

@ -132,19 +132,6 @@ struct FontFamilyListEntry {
uint8_t entryType;
};
// Used on Linux to pass list of font patterns from chrome to content.
struct FontPatternListEntry {
nsCString pattern;
bool appFontFamily;
};
// Wrap the Font*ListEntry records in a union so the SetXPCOMProcessAttributes
// message can pass an array of either type.
union SystemFontListEntry {
FontFamilyListEntry;
FontPatternListEntry;
};
union PrefValue {
nsCString;
int32_t;
@ -442,8 +429,6 @@ child:
async UpdateDictionaryList(nsString[] dictionaries);
async UpdateFontList(SystemFontListEntry[] fontList);
async UpdateAppLocales(nsCString[] appLocales);
async UpdateRequestedLocales(nsCString[] requestedLocales);
@ -491,8 +476,8 @@ child:
async SetXPCOMProcessAttributes(XPCOMInitData xpcomInit,
StructuredCloneData initialData,
LookAndFeelInt[] lookAndFeelIntCache,
/* used on MacOSX and Linux only: */
SystemFontListEntry[] systemFontList);
/* used on MacOSX only: */
FontFamilyListEntry[] fontFamilyList);
// Notify child that last-pb-context-exited notification was observed
async LastPrivateDocShellDestroyed();

View File

@ -152,18 +152,21 @@ add_task(async function() {
`http://www.example.com:80${defaultPath}`,
];
// Open tabs an collect corresponding browsers
let browsers = [
for (url of tabURLs) BrowserTestUtils.addTab(gBrowser, url).linkedBrowser
];
let browsers = tabURLs.map(url => BrowserTestUtils.addTab(gBrowser, url).linkedBrowser);
// Once all the pages have loaded, run a bunch of tests in "parallel".
await Promise.all((
for (browser of browsers) BrowserTestUtils.browserLoaded(browser)
));
await Promise.all((function*() {
for (let browser of browsers) {
yield BrowserTestUtils.browserLoaded(browser);
}
})());
// Flood random browsers with requests. Once promises settle, check that
// responses all pass.
const results = await Promise.all((
for (browser of randBrowsers(browsers, 50)) ManifestObtainer.browserObtainManifest(browser)
));
const results = await Promise.all((function*() {
for (let browser of randBrowsers(browsers, 50)) {
yield ManifestObtainer.browserObtainManifest(browser);
}
})());
const pass = results.every(manifest => manifest.name === 'pass');
ok(pass, 'Expect every manifest to have name equal to `pass`.');
//cleanup

View File

@ -108,6 +108,7 @@ DIRS += [
'worklet',
'script',
'payments',
'websocket',
]
if CONFIG['OS_ARCH'] == 'WINNT':

View File

@ -64,7 +64,7 @@ public:
}
DOMHighResTimeStamp WorkerStart() const {
return mTiming && mTiming->TimingAllowed()
return mTiming
? mTiming->WorkerStartHighRes()
: 0;
}

34
dom/websocket/moz.build Normal file
View File

@ -0,0 +1,34 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
with Files("**"):
BUG_COMPONENT = ("Core", "DOM")
EXPORTS.mozilla.dom += [
'WebSocket.h',
]
UNIFIED_SOURCES += [
'WebSocket.cpp',
]
LOCAL_INCLUDES += [
'/dom/base',
'/dom/workers',
]
MOCHITEST_CHROME_MANIFESTS += [
'tests/chrome.ini',
]
MOCHITEST_MANIFESTS += [
'tests/mochitest.ini',
'tests/websocket_hybi/mochitest.ini',
]
include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'

View File

@ -0,0 +1,4 @@
[DEFAULT]
skip-if = os == 'android'
[test_websocket_frame.html]

View File

@ -8,7 +8,7 @@
bc.close();
}
try {
new WebSocket("ws://mochi.test:8888/tests/dom/base/test/file_websocket_basic");
new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_basic");
done(true); // no hang!
} catch (e) {
done(false);

View File

@ -23,7 +23,7 @@ if (location.search == '?nested') {
"</scr" + "ipt></html>";
} else if (location.search == '?opener') {
try{
var socket = new WebSocket('ws://mochi.test:8888/tests/dom/base/test/file_websocket_basic');
var socket = new WebSocket('ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_basic');
socket.onerror = function(e) {
opener.postMessage('WS onerror', '*');
close();
@ -44,7 +44,7 @@ if (location.search == '?nested') {
ifr.srcdoc = `
<html><script>
try{
var socket = new WebSocket('ws://mochi.test:8888/tests/dom/base/test/file_websocket_basic');
var socket = new WebSocket('ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_basic');
socket.onerror = function(e) {
parent.postMessage('WS onerror', '*');
};

View File

@ -0,0 +1,48 @@
[DEFAULT]
skip-if = toolkit == 'android' # bug 982828
support-files =
file_websocket_basic_wsh.py
file_websocket_hello_wsh.py
file_websocket_http_resource.txt
file_websocket_permessage_deflate_wsh.py
file_websocket_permessage_deflate_disabled_wsh.py
file_websocket_permessage_deflate_rejected_wsh.py
file_websocket_permessage_deflate_params_wsh.py
file_websocket_wsh.py
websocket_helpers.js
websocket_tests.js
websocket_worker_helpers.js
[test_bug1081686.html]
[test_bug1384658.html]
support-files = window_bug1384658.html frame_bug1384658.html file_bug1384658.html
[test_websocket1.html]
[test_websocket2.html]
[test_websocket3.html]
[test_websocket4.html]
[test_websocket5.html]
[test_websocket_basic.html]
[test_websocket_hello.html]
[test_websocket_permessage_deflate.html]
[test_webSocket_sandbox.html]
support-files = iframe_webSocket_sandbox.html
[test_worker_websocket1.html]
support-files = websocket_worker1.js
[test_worker_websocket2.html]
support-files = websocket_worker2.js
[test_worker_websocket3.html]
support-files = websocket_worker3.js
[test_worker_websocket4.html]
support-files = websocket_worker4.js
[test_worker_websocket5.html]
support-files = websocket_worker5.js
[test_worker_websocket_basic.html]
support-files = websocket_basic_worker.js
[test_worker_websocket_https.html]
support-files = websocket_worker_https.html websocket_https_worker.js
[test_worker_websocket_loadgroup.html]
support-files = websocket_loadgroup_worker.js
[test_webSocket_sharedWorker.html]
support-files = webSocket_sharedWorker.js
[test_websocket_bigBlob.html]
support-files = file_websocket_bigBlob_wsh.py

View File

@ -27,7 +27,7 @@ function forcegc()
}
function testWebSocket () {
ws = new WebSocket("ws://mochi.test:8888/tests/dom/base/test/file_websocket_hello");
ws = new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_hello");
ws.onopen = function(e) {
ws.send("data");
}
@ -39,7 +39,7 @@ function testWebSocket () {
is(ws.binaryType, 'blob', 'WebSocket.binaryType is blob');
ws.binaryType = 'arraybuffer';
is(ws.binaryType, 'arraybuffer', 'WebSocket.binaryType is arraybuffer');
is(ws.url, 'ws://mochi.test:8888/tests/dom/base/test/file_websocket_hello', 'WebSocket.url is correct');
is(ws.url, 'ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_hello', 'WebSocket.url is correct');
ws.close();
ws.send('foobar');
SimpleTest.finish();

View File

@ -23,7 +23,7 @@ function test_frameset() {
}
function test_window() {
var win = window.open("http://example.com/tests/dom/base/test/window_bug1384658.html",
var win = window.open("http://example.com/tests/dom/websocket/tests/window_bug1384658.html",
"_blank", "width=100,height=100");
var bc = new BroadcastChannel("test_channel");
bc.onmessage = ev => {

View File

@ -9,9 +9,9 @@
<div id="container"></div>
<iframe id="frame"></iframe>
<script type="application/javascript;version=1.8">
var urls = [ "https://example.com/tests/dom/base/test/iframe_webSocket_sandbox.html",
"https://example.com/tests/dom/base/test/iframe_webSocket_sandbox.html?nested",
"https://example.com/tests/dom/base/test/iframe_webSocket_sandbox.html?popup" ];
var urls = [ "https://example.com/tests/dom/websocket/tests/iframe_webSocket_sandbox.html",
"https://example.com/tests/dom/websocket/tests/iframe_webSocket_sandbox.html?nested",
"https://example.com/tests/dom/websocket/tests/iframe_webSocket_sandbox.html?popup" ];
onmessage = function(e) {
is(e.data, "WS Throws!", "ws://URI cannot be used by a https iframe");

View File

@ -14,7 +14,7 @@
<pre id="test">
<script class="testbody" type="text/javascript">
const kUrl = "ws://mochi.test:8888/tests/dom/base/test/file_websocket_basic";
const kUrl = "ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_basic";
var gTestElement;
var ws;
@ -37,7 +37,7 @@ function testWebSocket1() {
gTestElement.textContent = "Running testWebSocket1()";
var results = ["test",
"/tests/dom/base/test/file_websocket_basic",
"/tests/dom/websocket/tests/file_websocket_basic",
"http://mochi.test:8888",
"end"];

View File

@ -10,7 +10,7 @@
<body>
<script class="testbody" type="text/javascript">
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket_bigBlob");
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_bigBlob");
is(ws.readyState, 0, "Initial readyState is 0");
ws.binaryType = "blob";

View File

@ -12,7 +12,7 @@
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
const URI = "ws://mochi.test:8888/tests/dom/base/test/file_websocket_basic";
const URI = "ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_basic";
var frameReceivedCounter = 0;
var frameSentCounter = 0;

View File

@ -18,7 +18,7 @@
var ws;
function testWebSocket () {
ws = new WebSocket("ws://mochi.test:8888/tests/dom/base/test/file_websocket_hello");
ws = new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_hello");
ws.onopen = function(e) {
ws.send("data");
}

View File

@ -21,13 +21,13 @@ var sendText = true;
tests = [
// enable PMCE
[ true, true, "ws://mochi.test:8888/tests/dom/base/test/file_websocket_permessage_deflate" ],
[ true, true, "ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_permessage_deflate" ],
// disable PMCE
[ false, false, "ws://mochi.test:8888/tests/dom/base/test/file_websocket_permessage_deflate_disabled" ],
[ false, false, "ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_permessage_deflate_disabled" ],
// server rejects offered PMCE
[ true, false, "ws://mochi.test:8888/tests/dom/base/test/file_websocket_permessage_deflate_rejected" ],
[ true, false, "ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_permessage_deflate_rejected" ],
// server returns parameters in the handshake
[ true, true, "ws://mochi.test:8888/tests/dom/base/test/file_websocket_permessage_deflate_params" ]
[ true, true, "ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_permessage_deflate_params" ]
]
function ab2str(buf) {

View File

@ -25,6 +25,6 @@
</script>
</pre>
<iframe src="https://example.com/tests/dom/workers/test/websocket_https.html"></iframe>
<iframe src="https://example.com/tests/dom/websocket/tests/websocket_worker_https.html"></iframe>
</body>
</html>

View File

@ -1,5 +1,5 @@
onconnect = function(evt) {
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/base/test/file_websocket_hello");
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_hello");
ws.onopen = function(e) {
evt.ports[0].postMessage({type: 'status', status: true, msg: 'OnOpen called' });

View File

@ -19,7 +19,7 @@ onmessage = function(event) {
postMessage({type: 'status', status: status, msg: 'WebSocket object:' + WebSocket});
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/base/test/file_websocket_hello");
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_hello");
ws.onopen = function(e) {
postMessage({type: 'status', status: true, msg: 'OnOpen called' });
ws.send("data");

View File

@ -1,7 +1,7 @@
onmessage = function() {
var wsCreated = true;
try {
new WebSocket("ws://mochi.test:8888/tests/dom/base/test/file_websocket_hello");
new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_hello");
} catch(e) {
wsCreated = false;
}

View File

@ -39,7 +39,7 @@ function createArrayBufferContainingAllDistinctBytes()
return array.buffer;
}
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/base/test/websocket_hybi/file_binary-frames");
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/websocket_hybi/file_binary-frames");
ws.binaryType = "arraybuffer";
is(ws.binaryType, "arraybuffer", "should be equal to 'arraybuffer'");

View File

@ -39,7 +39,7 @@ function createArrayBufferContainingAllDistinctBytes()
return array.buffer;
}
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/base/test/websocket_hybi/file_binary-frames");
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/websocket_hybi/file_binary-frames");
is(ws.binaryType, "blob", "should be 'blob'");
var closeEvent;

View File

@ -44,7 +44,7 @@ function createArrayBufferContainingAllDistinctBytes()
return array.buffer;
}
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/base/test/websocket_hybi/file_check-binary-messages");
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/websocket_hybi/file_check-binary-messages");
var closeEvent;
ws.onopen = function()

View File

@ -35,7 +35,7 @@ var filesToCreate = [
];
SpecialPowers.createFiles(filesToCreate, function (files) {
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/base/test/websocket_hybi/file_check-binary-messages");
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/websocket_hybi/file_check-binary-messages");
var closeEvent;
ws.onopen = function()

View File

@ -9,7 +9,7 @@ onmessage = function(event) {
return;
}
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/base/test/file_websocket_hello");
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_hello");
ws.onopen = function(e) {
postMessage('opened');
}

View File

@ -2,7 +2,7 @@
function test1() {
return new Promise(function(resolve, reject) {
try {
var ws = CreateTestWS("http://mochi.test:8888/tests/dom/base/test/file_websocket");
var ws = CreateTestWS("http://mochi.test:8888/tests/dom/websocket/tests/file_websocket");
ok(false, "test1 failed");
} catch (e) {
ok(true, "test1 failed");
@ -20,8 +20,8 @@ function test2() {
var waitTest2Part1 = true;
var waitTest2Part2 = true;
var ws1 = CreateTestWS("ws://sub2.test2.example.com/tests/dom/base/test/file_websocket", "test-2.1");
var ws2 = CreateTestWS("ws://sub2.test2.example.com/tests/dom/base/test/file_websocket", "test-2.2");
var ws1 = CreateTestWS("ws://sub2.test2.example.com/tests/dom/websocket/tests/file_websocket", "test-2.1");
var ws2 = CreateTestWS("ws://sub2.test2.example.com/tests/dom/websocket/tests/file_websocket", "test-2.2");
var ws2CanConnect = false;
@ -93,21 +93,21 @@ function test4() {
function test5() {
return new Promise(function(resolve, reject) {
try {
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "");
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "");
ok(false, "couldn't accept an empty string in the protocol parameter");
} catch (e) {
ok(true, "couldn't accept an empty string in the protocol parameter");
}
try {
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "\n");
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "\n");
ok(false, "couldn't accept any not printable ASCII character in the protocol parameter");
} catch (e) {
ok(true, "couldn't accept any not printable ASCII character in the protocol parameter");
}
try {
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test 5");
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test 5");
ok(false, "U+0020 not acceptable in protocol parameter");
} catch (e) {
ok(true, "U+0020 not acceptable in protocol parameter");
@ -120,7 +120,7 @@ function test5() {
// test6: counter and encoding check;
function test6() {
return new Promise(function(resolve, reject) {
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-6");
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-6");
var counter = 1;
ws.onopen = function() {
@ -148,7 +148,7 @@ function test6() {
// test7: onmessage event origin property check
function test7() {
return new Promise(function(resolve, reject) {
var ws = CreateTestWS("ws://sub2.test2.example.org/tests/dom/base/test/file_websocket", "test-7");
var ws = CreateTestWS("ws://sub2.test2.example.org/tests/dom/websocket/tests/file_websocket", "test-7");
var gotmsg = false;
ws.onopen = function() {
@ -174,7 +174,7 @@ function test7() {
// code or reason) in acknowledgement;
function test8() {
return new Promise(function(resolve, reject) {
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-8");
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-8");
ws.onopen = function() {
is(ws.protocol, "test-8", "test-8 subprotocol selection");
@ -195,7 +195,7 @@ function test8() {
// test9: client closes the connection before the ws connection is established;
function test9() {
return new Promise(function(resolve, reject) {
var ws = CreateTestWS("ws://test2.example.org/tests/dom/base/test/file_websocket", "test-9");
var ws = CreateTestWS("ws://test2.example.org/tests/dom/websocket/tests/file_websocket", "test-9");
ws._receivedErrorEvent = false;
@ -218,7 +218,7 @@ function test9() {
// test10: client sends a message before the ws connection is established;
function test10() {
return new Promise(function(resolve, reject) {
var ws = CreateTestWS("ws://sub1.test1.example.com/tests/dom/base/test/file_websocket", "test-10");
var ws = CreateTestWS("ws://sub1.test1.example.com/tests/dom/websocket/tests/file_websocket", "test-10");
ws.onclose = function(e) {
shouldCloseCleanly(e);
@ -243,7 +243,7 @@ function test10() {
// test11: a simple hello echo;
function test11() {
return new Promise(function(resolve, reject) {
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-11");
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-11");
is(ws.readyState, 0, "create bad readyState in test-11!");
ws.onopen = function() {
@ -273,7 +273,7 @@ function test11() {
// test12: client sends a message containing unpaired surrogates
function test12() {
return new Promise(function(resolve, reject) {
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-12");
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-12");
ws.onopen = function() {
try {
@ -311,7 +311,7 @@ function test13() {
// returned, but the protocol stack typically closes down after reporting a
// protocol level error - trying to resync is too dangerous
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-13");
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-13");
ws._timesCalledOnError = 0;
ws.onerror = function() {
@ -329,7 +329,7 @@ function test13() {
// and it keeps sending normal ws messages;
function test14() {
return new Promise(function(resolve, reject) {
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-14");
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-14");
ws.onmessage = function() {
ok(false, "shouldn't received message after the server sent the close frame");
@ -351,7 +351,7 @@ function test15() {
*/
resolve();
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-15");
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-15");
ws.onclose = function(e) {
shouldCloseNotCleanly(e);
resolve();
@ -366,7 +366,7 @@ function test15() {
// test16: client calls close() and tries to send a message;
function test16() {
return new Promise(function(resolve, reject) {
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-16");
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-16");
ws.onopen = function() {
ws.close();
@ -392,7 +392,7 @@ function test17() {
var status_test17 = "not started";
var test17func = function() {
var local_ws = new WebSocket("ws://sub1.test2.example.org/tests/dom/base/test/file_websocket", "test-17");
var local_ws = new WebSocket("ws://sub1.test2.example.org/tests/dom/websocket/tests/file_websocket", "test-17");
status_test17 = "started";
local_ws.onopen = function(e) {
@ -435,7 +435,7 @@ function test17() {
// test18: client tries to connect to an http resource;
function test18() {
return new Promise(function(resolve, reject) {
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket_http_resource.txt");
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_http_resource.txt");
ws.onopen = shouldNotOpen;
ws.onerror = ignoreError;
ws.onclose = function(e)
@ -450,7 +450,7 @@ function test18() {
// connection;
function test19() {
return new Promise(function(resolve, reject) {
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-19");
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-19");
ws.onopen = shouldNotOpen;
ws.onerror = ignoreError;
ws.onclose = function(e)
@ -465,7 +465,7 @@ function test19() {
function test20() {
return new Promise(function(resolve, reject) {
var test20func = function() {
var local_ws = new WebSocket("ws://sub1.test1.example.org/tests/dom/base/test/file_websocket", "test-20");
var local_ws = new WebSocket("ws://sub1.test1.example.org/tests/dom/websocket/tests/file_websocket", "test-20");
local_ws.onerror = function() {
ok(false, "onerror called on test " + current_test + "!");
@ -491,7 +491,7 @@ function test20() {
function test21() {
return new Promise(function(resolve, reject) {
var test21func = function() {
var local_ws = new WebSocket("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-21");
var local_ws = new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-21");
var received_message = false;
local_ws.onopen = function(e) {
@ -535,7 +535,7 @@ function test22() {
const pref_open = "network.websocket.timeout.open";
SpecialPowers.setIntPref(pref_open, 5);
var ws = CreateTestWS("ws://sub2.test2.example.org/tests/dom/base/test/file_websocket", "test-22");
var ws = CreateTestWS("ws://sub2.test2.example.org/tests/dom/websocket/tests/file_websocket", "test-22");
ws.onopen = shouldNotOpen;
ws.onerror = ignoreError;
@ -560,7 +560,7 @@ function test23() {
// test24: server rejects sub-protocol string
function test24() {
return new Promise(function(resolve, reject) {
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-does-not-exist");
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-does-not-exist");
ws.onopen = shouldNotOpen;
ws.onclose = function(e) {
@ -578,7 +578,7 @@ function test25() {
return new Promise(function(resolve, reject) {
var prots=[];
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
// This test errors because the server requires a sub-protocol, but
// the test just wants to ensure that the ctor doesn't generate an
@ -600,7 +600,7 @@ function test26() {
var prots=[""];
try {
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
ok(false, "testing empty element sub protocol array");
} catch (e) {
ok(true, "testing empty sub element protocol array");
@ -617,7 +617,7 @@ function test27() {
var prots=["test27", ""];
try {
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
ok(false, "testing empty element mixed sub protocol array");
} catch (e) {
ok(true, "testing empty element mixed sub protocol array");
@ -632,7 +632,7 @@ function test28() {
return new Promise(function(resolve, reject) {
var prots=["test28"];
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
ws.onopen = function(e) {
ok(true, "test 28 protocol array open");
@ -652,7 +652,7 @@ function test29() {
return new Promise(function(resolve, reject) {
var prots=["test29a", "test29b"];
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
ws.onopen = function(e) {
ok(true, "test 29 protocol array open");
@ -671,7 +671,7 @@ function test29() {
function test30() {
return new Promise(function(resolve, reject) {
var prots=["test-does-not-exist"];
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
ws.onopen = shouldNotOpen;
@ -690,7 +690,7 @@ function test30() {
function test31() {
return new Promise(function(resolve, reject) {
var prots=["test-does-not-exist", "test31"];
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
ws.onopen = function(e) {
ok(true, "test 31 protocol array open");
@ -711,7 +711,7 @@ function test32() {
var prots=["test32","test32"];
try {
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
ok(false, "testing duplicated element sub protocol array");
} catch (e) {
ok(true, "testing duplicated sub element protocol array");
@ -726,7 +726,7 @@ function test33() {
return new Promise(function(resolve, reject) {
var prots=["test33"];
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
ws.onopen = function(e) {
ok(true, "test 33 open");
@ -748,7 +748,7 @@ function test34() {
return new Promise(function(resolve, reject) {
var prots=["test-34"];
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
ws.onopen = function(e) {
ok(true, "test 34 open");
@ -769,7 +769,7 @@ function test34() {
// test35: test for sending custom close code and reason
function test35() {
return new Promise(function(resolve, reject) {
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-35a");
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-35a");
ws.onopen = function(e) {
ok(true, "test 35a open");
@ -779,7 +779,7 @@ function test35() {
ws.onclose = function(e) {
ok(true, "test 35a close");
ok(e.wasClean, "test 35a closed cleanly");
var wsb = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-35b");
var wsb = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-35b");
wsb.onopen = function(e) {
ok(true, "test 35b open");
@ -802,7 +802,7 @@ function test36() {
return new Promise(function(resolve, reject) {
var prots=["test-36"];
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
ws.onopen = function(e) {
ok(true, "test 36 open");
@ -829,7 +829,7 @@ function test37() {
return new Promise(function(resolve, reject) {
var prots=["test-37"];
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
ws.onopen = function(e) {
ok(true, "test 37 open");
@ -847,7 +847,7 @@ function test37() {
ok(true, "test 37 close");
ok(e.wasClean, "test 37 closed cleanly");
var wsb = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-37b");
var wsb = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-37b");
wsb.onopen = function(e) {
// now test that a rejected close code and reason dont persist
@ -865,7 +865,7 @@ function test37() {
ok(true, "test 37b close");
ok(e.wasClean, "test 37b closed cleanly");
var wsc = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-37c");
var wsc = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-37c");
wsc.onopen = function(e) {
ok(true, "test 37c open");
@ -887,7 +887,7 @@ function test38() {
return new Promise(function(resolve, reject) {
var prots=["test-38"];
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
ws.onopen = function(e) {
ok(true, "test 38 open");
@ -908,7 +908,7 @@ function test39() {
return new Promise(function(resolve, reject) {
var prots=["test-39"];
var ws = CreateTestWS("wss://example.com/tests/dom/base/test/file_websocket", prots);
var ws = CreateTestWS("wss://example.com/tests/dom/websocket/tests/file_websocket", prots);
status_test39 = "started";
ws.onopen = function(e) {
@ -930,7 +930,7 @@ function test40() {
return new Promise(function(resolve, reject) {
var prots=["test-40"];
var ws = CreateTestWS("wss://nocert.example.com/tests/dom/base/test/file_websocket", prots);
var ws = CreateTestWS("wss://nocert.example.com/tests/dom/websocket/tests/file_websocket", prots);
status_test40 = "started";
ws.onerror = ignoreError;
@ -952,11 +952,11 @@ function test40() {
// test41: HSTS
function test41() {
return new Promise(function(resolve, reject) {
var ws = CreateTestWS("ws://example.com/tests/dom/base/test/file_websocket", "test-41a", 1);
var ws = CreateTestWS("ws://example.com/tests/dom/websocket/tests/file_websocket", "test-41a", 1);
ws.onopen = function(e) {
ok(true, "test 41a open");
is(ws.url, "ws://example.com/tests/dom/base/test/file_websocket",
is(ws.url, "ws://example.com/tests/dom/websocket/tests/file_websocket",
"test 41a initial ws should not be redirected");
ws.close();
}
@ -965,7 +965,7 @@ function test41() {
ok(true, "test 41a close");
// establish a hsts policy for example.com
var wsb = CreateTestWS("wss://example.com/tests/dom/base/test/file_websocket", "test-41b", 1);
var wsb = CreateTestWS("wss://example.com/tests/dom/websocket/tests/file_websocket", "test-41b", 1);
wsb.onopen = function(e) {
ok(true, "test 41b open");
@ -976,11 +976,11 @@ function test41() {
ok(true, "test 41b close");
// try ws:// again, it should be done over wss:// now due to hsts
var wsc = CreateTestWS("ws://example.com/tests/dom/base/test/file_websocket", "test-41c");
var wsc = CreateTestWS("ws://example.com/tests/dom/websocket/tests/file_websocket", "test-41c");
wsc.onopen = function(e) {
ok(true, "test 41c open");
is(wsc.url, "wss://example.com/tests/dom/base/test/file_websocket",
is(wsc.url, "wss://example.com/tests/dom/websocket/tests/file_websocket",
"test 41c ws should be redirected by hsts to wss");
wsc.close();
}
@ -1010,7 +1010,7 @@ function test42() {
return new Promise(function(resolve, reject) {
// test some utf-8 non-characters. They should be allowed in the
// websockets context. Test via round trip echo.
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-42");
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-42");
var data = ["U+FFFE \ufffe",
"U+FFFF \uffff",
"U+10FFFF \udbff\udfff"];
@ -1041,7 +1041,7 @@ function test43() {
return new Promise(function(resolve, reject) {
var prots=["test-43"];
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
ws.onopen = function(e) {
ok(true, "test 43 open");
@ -1069,7 +1069,7 @@ function test43() {
// test44: Test sending/receving binary ArrayBuffer
function test44() {
return new Promise(function(resolve, reject) {
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-44");
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-44");
is(ws.readyState, 0, "bad readyState in test-44!");
ws.binaryType = "arraybuffer";
@ -1103,7 +1103,7 @@ function test44() {
function test45() {
return new Promise(function(resolve, reject) {
function test45Real(blobFile) {
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-45");
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-45");
is(ws.readyState, 0, "bad readyState in test-45!");
// ws.binaryType = "blob"; // Don't need to specify: blob is the default
@ -1158,7 +1158,7 @@ function test45() {
// test46: Test that we don't dispatch incoming msgs once in CLOSING state
function test46() {
return new Promise(function(resolve, reject) {
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-46");
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-46");
is(ws.readyState, 0, "create bad readyState in test-46!");
ws.onopen = function() {
@ -1221,7 +1221,7 @@ function test48() {
const pref_close = "network.websocket.timeout.close";
SpecialPowers.setIntPref(pref_close, 1);
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-48");
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-48");
ws.onopen = function() {
ws.close();
@ -1246,7 +1246,7 @@ function test48() {
function test49()
{
return new Promise(function(resolve, reject) {
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-49");
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-49");
var gotError = 0;
ok(ws.readyState == 0, "create bad readyState in test-49!");

View File

@ -1,6 +1,6 @@
importScripts('../../../dom/base/test/websocket_helpers.js');
importScripts('../../../dom/base/test/websocket_tests.js');
importScripts('websocket_helpers.js');
importScripts('websocket_tests.js');
importScripts('websocket_worker_helpers.js');
var tests = [
test1, // client tries to connect to a http scheme location;

View File

@ -1,6 +1,6 @@
importScripts('../../../dom/base/test/websocket_helpers.js');
importScripts('../../../dom/base/test/websocket_tests.js');
importScripts('websocket_helpers.js');
importScripts('websocket_tests.js');
importScripts('websocket_worker_helpers.js');
var tests = [
test11, // a simple hello echo;

View File

@ -1,6 +1,6 @@
importScripts('../../../dom/base/test/websocket_helpers.js');
importScripts('../../../dom/base/test/websocket_tests.js');
importScripts('websocket_helpers.js');
importScripts('websocket_tests.js');
importScripts('websocket_worker_helpers.js');
var tests = [
test24, // server rejects sub-protocol string

View File

@ -1,6 +1,6 @@
importScripts('../../../dom/base/test/websocket_helpers.js');
importScripts('../../../dom/base/test/websocket_tests.js');
importScripts('websocket_helpers.js');
importScripts('websocket_tests.js');
importScripts('websocket_worker_helpers.js');
var tests = [
test31, // ctor using valid 2 element sub-protocol array with 1 element server

Some files were not shown because too many files have changed in this diff Show More