Merge mozilla-central to mozilla-inbound

This commit is contained in:
Carsten "Tomcat" Book 2016-10-04 12:01:13 +02:00
Родитель 6b75399b35 02f4754fbc
Коммит 4a4e59ee1e
144 изменённых файлов: 2644 добавлений и 1114 удалений

Просмотреть файл

@ -268,7 +268,6 @@ skip-if = (os == 'linux' && e10s) # bug 1277750
tags = mcb
[browser_bug832435.js]
[browser_bug839103.js]
[browser_bug880101.js]
[browser_bug882977.js]
[browser_bug902156.js]
tags = mcb

Просмотреть файл

@ -1,50 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
const URL = "http://example.com/browser/browser/base/content/test/general/dummy_page.html";
function test() {
let win;
let listener = {
onLocationChange: (webProgress, request, uri, flags) => {
ok(webProgress.isTopLevel, "Received onLocationChange from top frame");
is(uri.spec, URL, "Received onLocationChange for correct URL");
finish();
}
};
waitForExplicitFinish();
// Remove the listener and window when we're done.
registerCleanupFunction(() => {
win.gBrowser.removeProgressListener(listener);
win.close();
});
// Wait for the newly opened window.
whenNewWindowOpened(w => win = w);
// Open a link in a new window.
openLinkIn(URL, "window", {});
// On the next tick, but before the window has finished loading, access the
// window's gBrowser property to force the tabbrowser constructor early.
(function tryAddProgressListener() {
executeSoon(() => {
try {
win.gBrowser.addProgressListener(listener);
} catch (e) {
// win.gBrowser wasn't ready, yet. Try again in a tick.
tryAddProgressListener();
}
});
})();
}
function whenNewWindowOpened(cb) {
Services.obs.addObserver(function obs(win) {
Services.obs.removeObserver(obs, "domwindowopened");
cb(win);
}, "domwindowopened", false);
}

Просмотреть файл

@ -241,7 +241,7 @@ add_task(function* open_webchannel_reload() {
is(NewTabWebChannel.numBrowsers, 1, "One target expected");
is(target.browser, browser, "Same browser");
browser.contentWindow.location.reload();
browser.reload();
});
Cu.forceGC();

Просмотреть файл

@ -486,6 +486,10 @@ Toolbox.prototype = {
return this.browserRequire("devtools/client/shared/vendor/react-dom");
},
get ReactRedux() {
return this.browserRequire("devtools/client/shared/vendor/react-redux");
},
// Return HostType id for telemetry
_getTelemetryHostId: function () {
switch (this.hostType) {

Просмотреть файл

@ -29,6 +29,7 @@ const {ComputedViewTool} = require("devtools/client/inspector/computed/computed"
const {FontInspector} = require("devtools/client/inspector/fonts/fonts");
const {HTMLBreadcrumbs} = require("devtools/client/inspector/breadcrumbs");
const {InspectorSearch} = require("devtools/client/inspector/inspector-search");
const {LayoutViewTool} = require("devtools/client/inspector/layout/layout");
const {MarkupView} = require("devtools/client/inspector/markup/markup");
const {RuleViewTool} = require("devtools/client/inspector/rules/rules");
const {ToolSidebar} = require("devtools/client/inspector/toolsidebar");
@ -417,6 +418,10 @@ Inspector.prototype = {
return this._toolbox.ReactDOM;
},
get ReactRedux() {
return this._toolbox.ReactRedux;
},
get browserRequire() {
return this._toolbox.browserRequire;
},
@ -559,6 +564,16 @@ Inspector.prototype = {
this.ruleview = new RuleViewTool(this, this.panelWin);
this.computedview = new ComputedViewTool(this, this.panelWin);
if (Services.prefs.getBoolPref("devtools.layoutview.enabled")) {
this.sidebar.addExistingTab(
"layoutview",
INSPECTOR_L10N.getStr("inspector.sidebar.layoutViewTitle"),
defaultTab == "layoutview"
);
this.layoutview = new LayoutViewTool(this, this.panelWin);
}
if (this.target.form.animationsActor) {
this.sidebar.addFrameTab(
"animationinspector",
@ -585,6 +600,20 @@ Inspector.prototype = {
this.sidebar.show(defaultTab);
},
/**
* Register a side-panel tab. This API can be used outside of
* DevTools (e.g. from an extension) as well as by DevTools
* code base.
*
* @param {string} tab uniq id
* @param {string} title tab title
* @param {React.Component} panel component. See `InspectorPanelTab` as an example.
* @param {boolean} selected true if the panel should be selected
*/
addSidebarTab: function (id, title, panel, selected) {
this.sidebar.addTab(id, title, panel, selected);
},
setupToolbar: function () {
this.teardownToolbar();
@ -866,6 +895,10 @@ Inspector.prototype = {
this.computedview.destroy();
}
if (this.layoutview) {
this.layoutview.destroy();
}
if (this.fontInspector) {
this.fontInspector.destroy();
}

Просмотреть файл

@ -184,6 +184,11 @@
</div>
</div>
<div id="sidebar-panel-layoutview" class="devtools-monospace theme-sidebar inspector-tabpanel"
data-localization-bundle="devtools/locale/inspector.properties">
<div id="layout-root"></div>
</div>
<div id="sidebar-panel-fontinspector" class="devtools-monospace theme-sidebar inspector-tabpanel"
data-localization-bundle="devtools/locale/font-inspector.properties">
<div class="devtools-toolbar">

Просмотреть файл

@ -0,0 +1,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/. */
"use strict";

Просмотреть файл

@ -0,0 +1,5 @@
# -*- 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/.

Просмотреть файл

@ -0,0 +1,24 @@
/* 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/. */
"use strict";
const { createClass, DOM: dom } = require("devtools/client/shared/vendor/react");
const { connect } = require("devtools/client/shared/vendor/react-redux");
let App = createClass({
displayName: "App",
render() {
return dom.div(
{
id: "app",
}
);
},
});
module.exports = connect(state => state)(App);

Просмотреть файл

@ -0,0 +1,9 @@
# -*- 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/.
DevToolsModules(
'App.js',
)

Просмотреть файл

@ -0,0 +1,37 @@
/* 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/. */
"use strict";
function LayoutViewTool(inspector, window) {
this.inspector = inspector;
this.document = window.document;
this.store = null;
this.init();
}
LayoutViewTool.prototype = {
init() {
const { React, ReactDOM, ReactRedux, browserRequire } = this.inspector;
const Store = browserRequire("devtools/client/inspector/layout/store");
const App = React.createFactory(
browserRequire("devtools/client/inspector/layout/components/App"));
let store = this.store = Store();
let provider = React.createElement(ReactRedux.Provider, { store }, App());
ReactDOM.render(provider, this.document.querySelector("#layout-root"));
},
destroy() {
this.inspector = null;
this.document = null;
this.store = null;
},
};
exports.LayoutViewTool = LayoutViewTool;

Просмотреть файл

@ -0,0 +1,17 @@
# -*- 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/.
DIRS += [
'actions',
'components',
'reducers',
]
DevToolsModules(
'layout.js',
'store.js',
'types.js',
)

Просмотреть файл

@ -0,0 +1,21 @@
/* 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/. */
"use strict";
const INITIAL_GRIDS = {
};
let reducers = {
};
module.exports = function (grids = INITIAL_GRIDS, action) {
let reducer = reducers[action.type];
if (!reducer) {
return grids;
}
return reducer(grids, action);
};

Просмотреть файл

@ -0,0 +1,7 @@
/* 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/. */
"use strict";
exports.grids = require("./grids");

Просмотреть файл

@ -0,0 +1,10 @@
# -*- 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/.
DevToolsModules(
'grids.js',
'index.js',
)

Просмотреть файл

@ -0,0 +1,33 @@
/* 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/. */
"use strict";
const { combineReducers } = require("devtools/client/shared/vendor/redux");
const createStore = require("devtools/client/shared/redux/create-store");
const reducers = require("./reducers/index");
const flags = require("devtools/shared/flags");
module.exports = function () {
let shouldLog = false;
let history;
// If testing, store the action history in an array
// we'll later attach to the store
if (flags.testing) {
history = [];
shouldLog = true;
}
let store = createStore({
log: shouldLog,
history
})(combineReducers(reducers), {});
if (history) {
store.history = history;
}
return store;
};

Просмотреть файл

@ -0,0 +1,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/. */
"use strict";

Просмотреть файл

@ -6,6 +6,7 @@ DIRS += [
'components',
'computed',
'fonts',
'layout',
'markup',
'rules',
'shared'

Просмотреть файл

@ -45,6 +45,7 @@ support-files =
[browser_inspector_addNode_01.js]
[browser_inspector_addNode_02.js]
[browser_inspector_addNode_03.js]
[browser_inspector_addSidebarTab.js]
[browser_inspector_breadcrumbs.js]
[browser_inspector_breadcrumbs_highlight_hover.js]
[browser_inspector_breadcrumbs_keybinding.js]

Просмотреть файл

@ -0,0 +1,62 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const TEST_URI = "data:text/html;charset=UTF-8," +
"<h1>browser_inspector_addtabbar.js</h1>";
const CONTENT_TEXT = "Hello World!";
/**
* Verify InspectorPanel.addSidebarTab() API that can be consumed
* by DevTools extensions as well as DevTools code base.
*/
add_task(function* () {
let { inspector } = yield openInspectorForURL(TEST_URI);
const React = inspector.React;
const { div } = React.DOM;
info("Adding custom panel.");
// Define custom side-panel.
let tabPanel = React.createFactory(React.createClass({
displayName: "myTabPanel",
render: function () {
return (
div({className: "my-tab-panel"},
CONTENT_TEXT
)
);
}
}));
// Append custom panel (tab) into the Inspector panel and
// make sure it's selected by default (the last arg = true).
inspector.addSidebarTab("myPanel", "My Panel", tabPanel, true);
is(inspector.sidebar.getCurrentTabID(), "myPanel",
"My Panel is selected by default");
// Define another custom side-panel.
tabPanel = React.createFactory(React.createClass({
displayName: "myTabPanel2",
render: function () {
return (
div({className: "my-tab-panel2"},
"Another Content"
)
);
}
}));
// Append second panel, but don't select it by default.
inspector.addSidebarTab("myPanel", "My Panel", tabPanel, false);
is(inspector.sidebar.getCurrentTabID(), "myPanel",
"My Panel is selected by default");
// Check the the panel content is properly rendered.
let tabPanelNode = inspector.panelDoc.querySelector(".my-tab-panel");
is(tabPanelNode.textContent, CONTENT_TEXT,
"Side panel content has been rendered.");
});

Просмотреть файл

@ -84,6 +84,27 @@ ToolSidebar.prototype = {
this._tabbar = this.ReactDOM.render(sidebar, this._tabbox);
},
/**
* Register a side-panel tab.
*
* @param {string} tab uniq id
* @param {string} title tab title
* @param {React.Component} panel component. See `InspectorPanelTab` as an example.
* @param {boolean} selected true if the panel should be selected
*/
addTab: function (id, title, panel, selected) {
this._tabbar.addTab(id, title, selected, panel);
this.emit("new-tab-registered", id);
},
/**
* Helper API for adding side-panels that use existing DOM nodes
* (defined within inspector.xhtml) as the content.
*
* @param {string} tab uniq id
* @param {string} title tab title
* @param {boolean} selected true if the panel should be selected
*/
addExistingTab: function (id, title, selected) {
let panel = this.InspectorTabPanel({
id: id,
@ -92,17 +113,18 @@ ToolSidebar.prototype = {
title: title,
});
this._tabbar.addTab(id, title, selected, panel);
this.emit("new-tab-registered", id);
this.addTab(id, title, panel, selected);
},
/**
* Register a tab. A tab is a document.
* Helper API for adding side-panels that use existing <iframe> nodes
* (defined within inspector.xhtml) as the content.
* The document must have a title, which will be used as the name of the tab.
*
* @param {string} tab uniq id
* @param {string} title tab title
* @param {string} url
* @param {boolean} selected true if the panel should be selected
*/
addFrameTab: function (id, title, url, selected) {
let panel = this.InspectorTabPanel({
@ -114,9 +136,7 @@ ToolSidebar.prototype = {
onMount: this.onSidePanelMounted.bind(this),
});
this._tabbar.addTab(id, title, selected, panel);
this.emit("new-tab-registered", id);
this.addTab(id, title, panel, selected);
},
onSidePanelMounted: function (content, props) {

Просмотреть файл

@ -313,6 +313,11 @@ inspector.sidebar.ruleViewTitle=Rules
# used in the page.
inspector.sidebar.computedViewTitle=Computed
# LOCALIZATION NOTE (inspector.sidebar.computedViewTitle):
# This is the title shown in a tab in the side panel of the Inspector panel
# that corresponds to the tool displaying layout information defined in the page.
inspector.sidebar.layoutViewTitle=Layout
# LOCALIZATION NOTE (inspector.sidebar.animationInspectorTitle):
# This is the title shown in a tab in the side panel of the Inspector panel
# that corresponds to the tool displaying animations defined in the page.

Просмотреть файл

@ -65,6 +65,15 @@ pref("devtools.inspector.showAllAnonymousContent", false);
// Enable the MDN docs tooltip
pref("devtools.inspector.mdnDocsTooltip.enabled", true);
// Enable the Font Inspector
pref("devtools.fontinspector.enabled", true);
// Enable the Layout View
pref("devtools.layoutview.enabled", false);
// By how many times eyedropper will magnify pixels
pref("devtools.eyedropper.zoom", 6);
// Enable to collapse attributes that are too long.
pref("devtools.markup.collapseAttributes", true);
@ -232,21 +241,24 @@ sticky_pref("devtools.theme", "dark");
sticky_pref("devtools.theme", "light");
#endif
// Remember the Web Console filters
// Web console filters
pref("devtools.webconsole.filter.error", true);
pref("devtools.webconsole.filter.warn", true);
pref("devtools.webconsole.filter.info", true);
pref("devtools.webconsole.filter.log", true);
pref("devtools.webconsole.filter.debug", true);
pref("devtools.webconsole.filter.net", false);
pref("devtools.webconsole.filter.netxhr", false);
// Deprecated - old console frontend
pref("devtools.webconsole.filter.network", true);
pref("devtools.webconsole.filter.networkinfo", false);
pref("devtools.webconsole.filter.netwarn", true);
pref("devtools.webconsole.filter.netxhr", false);
pref("devtools.webconsole.filter.csserror", true);
pref("devtools.webconsole.filter.cssparser", false);
pref("devtools.webconsole.filter.csslog", false);
pref("devtools.webconsole.filter.exception", true);
pref("devtools.webconsole.filter.jswarn", true);
pref("devtools.webconsole.filter.jslog", false);
pref("devtools.webconsole.filter.error", true);
pref("devtools.webconsole.filter.warn", true);
pref("devtools.webconsole.filter.info", true);
pref("devtools.webconsole.filter.log", true);
pref("devtools.webconsole.filter.secerror", true);
pref("devtools.webconsole.filter.secwarn", true);
pref("devtools.webconsole.filter.serviceworkers", true);
@ -282,6 +294,9 @@ pref("devtools.browserconsole.filter.serverwarn", false);
pref("devtools.browserconsole.filter.serverinfo", false);
pref("devtools.browserconsole.filter.serverlog", false);
// Web console filter settings bar
pref("devtools.webconsole.ui.filterbar", false);
// Max number of inputs to store in web console history.
pref("devtools.webconsole.inputHistoryCount", 50);
@ -316,9 +331,6 @@ pref("devtools.hud.loglimit.cssparser", 1000);
pref("devtools.hud.loglimit.exception", 1000);
pref("devtools.hud.loglimit.console", 1000);
// By how many times eyedropper will magnify pixels
pref("devtools.eyedropper.zoom", 6);
// The developer tools editor configuration:
// - tabsize: how many spaces to use when a Tab character is displayed.
// - expandtab: expand Tab characters to spaces.
@ -334,9 +346,6 @@ pref("devtools.editor.detectindentation", true);
pref("devtools.editor.enableCodeFolding", true);
pref("devtools.editor.autocomplete", true);
// Enable the Font Inspector
pref("devtools.fontinspector.enabled", true);
// Pref to store the browser version at the time of a telemetry ping for an
// opened developer tool. This allows us to ping telemetry just once per browser
// version for each user.

Просмотреть файл

@ -102,7 +102,7 @@ define(function (require, exports, module) {
let type = typeof object;
if (type == "object" && object instanceof String) {
type = "string";
} else if (type == "object" && object.type === "symbol") {
} else if (object && type == "object" && object.type === "symbol") {
type = "symbol";
}

Просмотреть файл

@ -54,7 +54,11 @@ let Tabbar = createClass({
newState.activeTab = tabs.length - 1;
}
this.setState(newState);
this.setState(newState, () => {
if (this.props.onSelect && selected) {
this.props.onSelect(id);
}
});
},
toggleTab: function (tabId, isVisible) {

Просмотреть файл

@ -689,6 +689,7 @@ a.learn-more-link.webconsole-learn-more-link {
display: flex;
flex-direction: column;
height: 100%;
-moz-user-focus: normal;
}
.webconsole-filterbar-wrapper {

Просмотреть файл

@ -377,7 +377,7 @@ JSTerm.prototype = {
if (this.hud.NEW_CONSOLE_OUTPUT_ENABLED) {
this.hud.newConsoleOutput.dispatchMessageAdd(response);
callback && callback(this.hud.newConsoleOutput.getLastMessage());
callback && callback();
return;
}
let msg = new Messages.JavaScriptEvalOutput(response,

Просмотреть файл

@ -6,11 +6,15 @@
"use strict";
const { getAllFilters } = require("devtools/client/webconsole/new-console-output/selectors/filters");
const Services = require("Services");
const {
FILTER_TEXT_SET,
FILTER_TOGGLE,
FILTERS_CLEAR
} = require("../constants");
FILTERS_CLEAR,
PREFS,
} = require("devtools/client/webconsole/new-console-output/constants");
function filterTextSet(text) {
return {
@ -20,15 +24,27 @@ function filterTextSet(text) {
}
function filterToggle(filter) {
return {
type: FILTER_TOGGLE,
filter,
return (dispatch, getState) => {
dispatch({
type: FILTER_TOGGLE,
filter,
});
const filterState = getAllFilters(getState());
Services.prefs.setBoolPref(PREFS.FILTER[filter.toUpperCase()],
filterState.get(filter));
};
}
function filtersClear() {
return {
type: FILTERS_CLEAR
return (dispatch, getState) => {
dispatch({
type: FILTERS_CLEAR,
});
const filterState = getAllFilters(getState());
for (let filter in filterState) {
Services.prefs.clearUserPref(PREFS.FILTER[filter.toUpperCase()]);
}
};
}

Просмотреть файл

@ -6,13 +6,21 @@
"use strict";
const { getAllUi } = require("devtools/client/webconsole/new-console-output/selectors/ui");
const Services = require("Services");
const {
FILTER_BAR_TOGGLE,
} = require("../constants");
PREFS,
} = require("devtools/client/webconsole/new-console-output/constants");
function filterBarToggle(show) {
return {
type: FILTER_BAR_TOGGLE
return (dispatch, getState) => {
dispatch({
type: FILTER_BAR_TOGGLE
});
const uiState = getAllUi(getState());
Services.prefs.setBoolPref(PREFS.UI.FILTER_BAR, uiState.get("filterBarVisible"));
};
}

Просмотреть файл

@ -40,4 +40,4 @@ const CollapseButton = createClass({
}
});
module.exports.CollapseButton = CollapseButton;
module.exports = CollapseButton;

Просмотреть файл

@ -13,10 +13,13 @@ const ReactDOM = require("devtools/client/shared/vendor/react-dom");
const { connect } = require("devtools/client/shared/vendor/react-redux");
const { getAllMessages, getAllMessagesUiById, getAllMessagesTableDataById } = require("devtools/client/webconsole/new-console-output/selectors/messages");
const { getScrollSetting } = require("devtools/client/webconsole/new-console-output/selectors/ui");
const MessageContainer = createFactory(require("devtools/client/webconsole/new-console-output/components/message-container").MessageContainer);
const ConsoleOutput = createClass({
displayName: "ConsoleOutput",
propTypes: {
hudProxyClient: PropTypes.object.isRequired,
messages: PropTypes.object.isRequired,
@ -25,27 +28,38 @@ const ConsoleOutput = createClass({
onViewSourceInDebugger: PropTypes.func.isRequired,
openNetworkPanel: PropTypes.func.isRequired,
openLink: PropTypes.func.isRequired,
emitNewMessage: PropTypes.func.isRequired,
autoscroll: PropTypes.bool.isRequired,
},
displayName: "ConsoleOutput",
componentDidMount() {
scrollToBottom(this.outputNode);
},
componentWillUpdate() {
let node = ReactDOM.findDOMNode(this);
if (node.lastChild) {
this.shouldScrollBottom = isScrolledToBottom(node.lastChild, node);
componentWillUpdate(nextProps, nextState) {
if (!this.outputNode) {
return;
}
const outputNode = this.outputNode;
// Figure out if we are at the bottom. If so, then any new message should be scrolled
// into view.
if (this.props.autoscroll && outputNode.lastChild) {
this.shouldScrollBottom = isScrolledToBottom(outputNode.lastChild, outputNode);
}
},
componentDidUpdate() {
if (this.shouldScrollBottom) {
let node = ReactDOM.findDOMNode(this);
node.scrollTop = node.scrollHeight;
scrollToBottom(this.outputNode);
}
},
render() {
let {
dispatch,
autoscroll,
hudProxyClient,
messages,
messagesUi,
@ -54,6 +68,7 @@ const ConsoleOutput = createClass({
onViewSourceInDebugger,
openNetworkPanel,
openLink,
emitNewMessage,
} = this.props;
let messageNodes = messages.map((message) => {
@ -67,17 +82,29 @@ const ConsoleOutput = createClass({
onViewSourceInDebugger,
openNetworkPanel,
openLink,
emitNewMessage,
open: messagesUi.includes(message.id),
tableData: messagesTableData.get(message.id),
autoscroll,
})
);
});
return (
dom.div({className: "webconsole-output"}, messageNodes)
dom.div({
className: "webconsole-output",
ref: node => {
this.outputNode = node;
},
}, messageNodes
)
);
}
});
function scrollToBottom(node) {
node.scrollTop = node.scrollHeight;
}
function isScrolledToBottom(outputNode, scrollNode) {
let lastNodeHeight = outputNode.lastChild ?
outputNode.lastChild.clientHeight : 0;
@ -90,6 +117,7 @@ function mapStateToProps(state) {
messages: getAllMessages(state),
messagesUi: getAllMessagesUiById(state),
messagesTableData: getAllMessagesTableDataById(state),
autoscroll: getScrollSetting(state),
};
}

Просмотреть файл

@ -12,7 +12,7 @@ const {
const { ObjectClient } = require("devtools/shared/client/main");
const actions = require("devtools/client/webconsole/new-console-output/actions/messages");
const {l10n} = require("devtools/client/webconsole/new-console-output/utils/messages");
const GripMessageBody = createFactory(require("devtools/client/webconsole/new-console-output/components/grip-message-body").GripMessageBody);
const GripMessageBody = createFactory(require("devtools/client/webconsole/new-console-output/components/grip-message-body"));
const TABLE_ROW_MAX_ITEMS = 1000;
const TABLE_COLUMN_MAX_ITEMS = 10;
@ -197,4 +197,4 @@ function getTableItems(data = {}, type, headers = null) {
};
}
exports.ConsoleTable = ConsoleTable;
module.exports = ConsoleTable;

Просмотреть файл

@ -18,7 +18,7 @@ const uiActions = require("devtools/client/webconsole/new-console-output/actions
const {
MESSAGE_LEVEL
} = require("../constants");
const FilterButton = createFactory(require("devtools/client/webconsole/new-console-output/components/filter-button").FilterButton);
const FilterButton = createFactory(require("devtools/client/webconsole/new-console-output/components/filter-button"));
const FilterBar = createClass({
@ -73,7 +73,7 @@ const FilterBar = createClass({
if (filterBarVisible) {
children.push(
dom.div({className: "devtools-toolbar"},
dom.div({className: "devtools-toolbar webconsole-filterbar-secondary"},
FilterButton({
active: filter.error,
label: "Errors",
@ -114,9 +114,9 @@ const FilterBar = createClass({
dispatch
}),
FilterButton({
active: filter.network,
active: filter.net,
label: "Requests",
filterKey: "network",
filterKey: "net",
dispatch
})
)

Просмотреть файл

@ -26,9 +26,12 @@ const FilterButton = createClass({
},
render() {
const {label, active} = this.props;
const {active, label, filterKey} = this.props;
let classList = ["menu-filter-button"];
let classList = [
"menu-filter-button",
filterKey,
];
if (active) {
classList.push("checked");
}
@ -40,4 +43,4 @@ const FilterButton = createClass({
}
});
exports.FilterButton = FilterButton;
module.exports = FilterButton;

Просмотреть файл

@ -20,7 +20,7 @@ const {
const { createFactories } = require("devtools/client/shared/components/reps/rep-utils");
const { Rep } = createFactories(require("devtools/client/shared/components/reps/rep"));
const StringRep = createFactories(require("devtools/client/shared/components/reps/string").StringRep).rep;
const VariablesViewLink = createFactory(require("devtools/client/webconsole/new-console-output/components/variables-view-link").VariablesViewLink);
const VariablesViewLink = createFactory(require("devtools/client/webconsole/new-console-output/components/variables-view-link"));
const { Grip } = require("devtools/client/shared/components/reps/grip");
GripMessageBody.displayName = "GripMessageBody";
@ -53,4 +53,4 @@ function GripMessageBody(props) {
);
}
module.exports.GripMessageBody = GripMessageBody;
module.exports = GripMessageBody;

Просмотреть файл

@ -19,12 +19,12 @@ const {
} = require("devtools/client/webconsole/new-console-output/constants");
const componentMap = new Map([
["ConsoleApiCall", require("./message-types/console-api-call").ConsoleApiCall],
["ConsoleCommand", require("./message-types/console-command").ConsoleCommand],
["DefaultRenderer", require("./message-types/default-renderer").DefaultRenderer],
["EvaluationResult", require("./message-types/evaluation-result").EvaluationResult],
["NetworkEventMessage", require("./message-types/network-event-message").NetworkEventMessage],
["PageError", require("./message-types/page-error").PageError]
["ConsoleApiCall", require("./message-types/console-api-call")],
["ConsoleCommand", require("./message-types/console-command")],
["DefaultRenderer", require("./message-types/default-renderer")],
["EvaluationResult", require("./message-types/evaluation-result")],
["NetworkEventMessage", require("./message-types/network-event-message")],
["PageError", require("./message-types/page-error")]
]);
const MessageContainer = createClass({
@ -38,6 +38,7 @@ const MessageContainer = createClass({
openLink: PropTypes.func.isRequired,
open: PropTypes.bool.isRequired,
hudProxyClient: PropTypes.object.isRequired,
autoscroll: PropTypes.bool.isRequired,
},
getDefaultProps: function () {
@ -54,30 +55,10 @@ const MessageContainer = createClass({
},
render() {
const {
dispatch,
message,
sourceMapService,
onViewSourceInDebugger,
openNetworkPanel,
openLink,
open,
tableData,
hudProxyClient,
} = this.props;
const { message } = this.props;
let MessageComponent = createFactory(getMessageComponent(message));
return MessageComponent({
dispatch,
message,
sourceMapService,
onViewSourceInDebugger,
openNetworkPanel,
openLink,
open,
tableData,
hudProxyClient,
});
return MessageComponent(this.props);
}
});

Просмотреть файл

@ -29,4 +29,4 @@ function MessageIcon(props) {
});
}
module.exports.MessageIcon = MessageIcon;
module.exports = MessageIcon;

Просмотреть файл

@ -12,6 +12,8 @@ const {
DOM: dom,
PropTypes
} = require("devtools/client/shared/vendor/react");
const { PluralForm } = require("devtools/shared/plural-form");
const { l10n } = require("devtools/client/webconsole/new-console-output/utils/messages");
MessageRepeat.displayName = "MessageRepeat";
@ -22,7 +24,13 @@ MessageRepeat.propTypes = {
function MessageRepeat(props) {
const { repeat } = props;
const visibility = repeat > 1 ? "visible" : "hidden";
return dom.span({className: "message-repeats", style: {visibility}}, repeat);
return dom.span({
className: "message-repeats",
style: {visibility},
title: PluralForm.get(repeat, l10n.getStr("messageRepeats.tooltip2"))
.replace("#1", repeat)
}, repeat);
}
exports.MessageRepeat = MessageRepeat;
module.exports = MessageRepeat;

Просмотреть файл

@ -12,14 +12,10 @@ const {
DOM: dom,
PropTypes
} = require("devtools/client/shared/vendor/react");
const FrameView = createFactory(require("devtools/client/shared/components/frame"));
const StackTrace = createFactory(require("devtools/client/shared/components/stack-trace"));
const GripMessageBody = createFactory(require("devtools/client/webconsole/new-console-output/components/grip-message-body").GripMessageBody);
const MessageRepeat = createFactory(require("devtools/client/webconsole/new-console-output/components/message-repeat").MessageRepeat);
const MessageIcon = createFactory(require("devtools/client/webconsole/new-console-output/components/message-icon").MessageIcon);
const CollapseButton = createFactory(require("devtools/client/webconsole/new-console-output/components/collapse-button").CollapseButton);
const ConsoleTable = createFactory(require("devtools/client/webconsole/new-console-output/components/console-table").ConsoleTable);
const actions = require("devtools/client/webconsole/new-console-output/actions/index");
const GripMessageBody = createFactory(require("devtools/client/webconsole/new-console-output/components/grip-message-body"));
const ConsoleTable = createFactory(require("devtools/client/webconsole/new-console-output/components/console-table"));
const Message = createFactory(require("devtools/client/webconsole/new-console-output/components/message"));
ConsoleApiCall.displayName = "ConsoleApiCall";
@ -43,9 +39,18 @@ function ConsoleApiCall(props) {
onViewSourceInDebugger,
open,
hudProxyClient,
tableData
tableData,
emitNewMessage,
} = props;
const {source, level, stacktrace, type, frame, parameters } = message;
const {
id: messageId,
source, type,
level,
repeat,
stacktrace,
frame,
parameters
} = message;
let messageBody;
if (type === "trace") {
@ -62,41 +67,8 @@ function ConsoleApiCall(props) {
messageBody = message.messageText;
}
const icon = MessageIcon({ level });
const repeat = MessageRepeat({ repeat: message.repeat });
const shouldRenderFrame = frame && frame.source !== "debugger eval code";
const location = dom.span({ className: "message-location devtools-monospace" },
shouldRenderFrame ? FrameView({
frame,
onClick: onViewSourceInDebugger,
showEmptyPathAsHost: true,
sourceMapService
}) : null
);
let collapse = "";
let attachment = "";
if (stacktrace) {
if (open) {
attachment = dom.div({ className: "stacktrace devtools-monospace" },
StackTrace({
stacktrace: stacktrace,
onViewSourceInDebugger: onViewSourceInDebugger
})
);
}
collapse = CollapseButton({
open,
onClick: function () {
if (open) {
dispatch(actions.messageClose(message.id));
} else {
dispatch(actions.messageOpen(message.id));
}
},
});
} else if (type === "table") {
let attachment = null;
if (type === "table") {
attachment = ConsoleTable({
dispatch,
id: message.id,
@ -106,32 +78,25 @@ function ConsoleApiCall(props) {
});
}
const classes = ["message", "cm-s-mozilla"];
const topLevelClasses = ["cm-s-mozilla"];
classes.push(source);
classes.push(type);
classes.push(level);
if (open === true) {
classes.push("open");
}
return dom.div({ className: classes.join(" ") },
// @TODO add timestamp
// @TODO add indent if necessary
icon,
collapse,
dom.span({ className: "message-body-wrapper" },
dom.span({ className: "message-flex-body" },
dom.span({ className: "message-body devtools-monospace" },
messageBody
),
repeat,
location
),
attachment
)
);
return Message({
messageId,
open,
source,
type,
level,
topLevelClasses,
messageBody,
repeat,
frame,
stacktrace,
attachment,
onViewSourceInDebugger,
sourceMapService,
emitNewMessage,
dispatch,
});
}
function formatReps(parameters) {
@ -148,4 +113,4 @@ function formatReps(parameters) {
);
}
module.exports.ConsoleApiCall = ConsoleApiCall;
module.exports = ConsoleApiCall;

Просмотреть файл

@ -9,47 +9,37 @@
// React & Redux
const {
createFactory,
DOM: dom,
PropTypes
} = require("devtools/client/shared/vendor/react");
const MessageIcon = createFactory(require("devtools/client/webconsole/new-console-output/components/message-icon").MessageIcon);
const Message = createFactory(require("devtools/client/webconsole/new-console-output/components/message"));
ConsoleCommand.displayName = "ConsoleCommand";
ConsoleCommand.propTypes = {
message: PropTypes.object.isRequired,
autoscroll: PropTypes.bool.isRequired,
};
/**
* Displays input from the console.
*/
function ConsoleCommand(props) {
const { message } = props;
const {source, type, level} = message;
const {
source,
type,
level,
messageText: messageBody,
} = props.message;
const icon = MessageIcon({level});
const classes = ["message"];
classes.push(source);
classes.push(type);
classes.push(level);
return dom.div({
className: classes.join(" "),
ariaLive: "off",
},
// @TODO add timestamp
// @TODO add indent if necessary
icon,
dom.span({ className: "message-body-wrapper" },
dom.span({ className: "message-flex-body" },
dom.span({ className: "message-body devtools-monospace" },
message.messageText
)
)
)
);
const childProps = {
source,
type,
level,
topLevelClasses: [],
messageBody,
scrollToMessage: props.autoscroll,
};
return Message(childProps);
}
module.exports.ConsoleCommand = ConsoleCommand;
module.exports = ConsoleCommand;

Просмотреть файл

@ -19,4 +19,4 @@ function DefaultRenderer(props) {
);
}
module.exports.DefaultRenderer = DefaultRenderer;
module.exports = DefaultRenderer;

Просмотреть файл

@ -9,11 +9,10 @@
// React & Redux
const {
createFactory,
DOM: dom,
PropTypes
} = require("devtools/client/shared/vendor/react");
const GripMessageBody = createFactory(require("devtools/client/webconsole/new-console-output/components/grip-message-body").GripMessageBody);
const MessageIcon = createFactory(require("devtools/client/webconsole/new-console-output/components/message-icon").MessageIcon);
const Message = createFactory(require("devtools/client/webconsole/new-console-output/components/message"));
const GripMessageBody = createFactory(require("devtools/client/webconsole/new-console-output/components/grip-message-body"));
EvaluationResult.displayName = "EvaluationResult";
@ -23,8 +22,12 @@ EvaluationResult.propTypes = {
function EvaluationResult(props) {
const { message } = props;
const {source, type, level} = message;
const icon = MessageIcon({level});
const {
source,
type,
level,
emitNewMessage,
} = message;
let messageBody;
if (message.messageText) {
@ -33,27 +36,18 @@ function EvaluationResult(props) {
messageBody = GripMessageBody({grip: message.parameters});
}
const topLevelClasses = ["cm-s-mozilla"];
const classes = ["message", "cm-s-mozilla"];
classes.push(source);
classes.push(type);
classes.push(level);
return dom.div({
className: classes.join(" ")
},
// @TODO add timestamp
// @TODO add indent if needed with console.group
icon,
dom.span({ className: "message-body-wrapper" },
dom.span({ className: "message-flex-body" },
dom.span({ className: "message-body devtools-monospace" },
messageBody
)
)
)
);
const childProps = {
source,
type,
level,
topLevelClasses,
messageBody,
scrollToMessage: props.autoscroll,
emitNewMessage,
};
return Message(childProps);
}
module.exports.EvaluationResult = EvaluationResult;
module.exports = EvaluationResult;

Просмотреть файл

@ -12,64 +12,44 @@ const {
DOM: dom,
PropTypes
} = require("devtools/client/shared/vendor/react");
const MessageIcon = createFactory(require("devtools/client/webconsole/new-console-output/components/message-icon").MessageIcon);
const CollapseButton = createFactory(require("devtools/client/webconsole/new-console-output/components/collapse-button").CollapseButton);
const Message = createFactory(require("devtools/client/webconsole/new-console-output/components/message"));
const { l10n } = require("devtools/client/webconsole/new-console-output/utils/messages");
const actions = require("devtools/client/webconsole/new-console-output/actions/index");
NetworkEventMessage.displayName = "NetworkEventMessage";
NetworkEventMessage.propTypes = {
message: PropTypes.object.isRequired,
openNetworkPanel: PropTypes.func.isRequired,
// @TODO: openLink will be used for mixed-content handling
openLink: PropTypes.func.isRequired,
open: PropTypes.bool.isRequired,
};
function NetworkEventMessage(props) {
const { dispatch, message, openNetworkPanel, open } = props;
const { actor, source, type, level, request, response, isXHR, totalTime } = message;
let { method, url } = request;
let { httpVersion, status, statusText } = response;
const { message, openNetworkPanel, emitNewMessage } = props;
const { actor, source, type, level, request, isXHR } = message;
let classes = ["message", "cm-s-mozilla"];
classes.push(source);
classes.push(type);
classes.push(level);
if (open) {
classes.push("open");
}
let statusInfo = "[]";
// @TODO: Status will be enabled after NetworkUpdateEvent packet arrives
if (httpVersion && status && statusText && totalTime) {
statusInfo = `[${httpVersion} ${status} ${statusText} ${totalTime}ms]`;
}
let xhr = l10n.getStr("webConsoleXhrIndicator");
const topLevelClasses = [ "cm-s-mozilla" ];
function onUrlClick() {
openNetworkPanel(actor);
}
return dom.div({ className: classes.join(" ") },
// @TODO add timestamp
// @TODO add indent if necessary
MessageIcon({ level }),
dom.span({
className: "message-body-wrapper message-body devtools-monospace",
"aria-haspopup": "true"
},
dom.span({ className: "method" }, method),
isXHR ? dom.span({ className: "xhr" }, xhr) : null,
dom.a({ className: "url", title: url, onClick: onUrlClick },
url.replace(/\?.+/, ""))
)
);
const method = dom.span({className: "method" }, request.method);
const xhr = isXHR
? dom.span({ className: "xhr" }, l10n.getStr("webConsoleXhrIndicator"))
: null;
const url = dom.a({ className: "url", title: request.url, onClick: onUrlClick },
request.url.replace(/\?.+/, ""));
const messageBody = dom.span({}, method, xhr, url);
const childProps = {
source,
type,
level,
topLevelClasses,
messageBody,
emitNewMessage,
};
return Message(childProps);
}
module.exports.NetworkEventMessage = NetworkEventMessage;
module.exports = NetworkEventMessage;

Просмотреть файл

@ -9,16 +9,9 @@
// React & Redux
const {
createFactory,
DOM: dom,
PropTypes
} = require("devtools/client/shared/vendor/react");
const FrameView = createFactory(require("devtools/client/shared/components/frame"));
const StackTrace = createFactory(require("devtools/client/shared/components/stack-trace"));
const CollapseButton = createFactory(require("devtools/client/webconsole/new-console-output/components/collapse-button").CollapseButton);
const MessageRepeat = createFactory(require("devtools/client/webconsole/new-console-output/components/message-repeat").MessageRepeat);
const MessageIcon = createFactory(require("devtools/client/webconsole/new-console-output/components/message-icon").MessageIcon);
const actions = require("devtools/client/webconsole/new-console-output/actions/index");
const Message = createFactory(require("devtools/client/webconsole/new-console-output/components/message"));
PageError.displayName = "PageError";
@ -32,69 +25,40 @@ PageError.defaultProps = {
};
function PageError(props) {
const { dispatch, message, open, sourceMapService, onViewSourceInDebugger } = props;
const { source, type, level, stacktrace, frame } = message;
const {
message,
open,
sourceMapService,
onViewSourceInDebugger,
emitNewMessage,
} = props;
const {
id: messageId,
source,
type,
level,
messageText: messageBody,
repeat,
stacktrace,
frame
} = message;
const repeat = MessageRepeat({repeat: message.repeat});
const icon = MessageIcon({level});
const shouldRenderFrame = frame && frame.source !== "debugger eval code";
const location = dom.span({ className: "message-location devtools-monospace" },
shouldRenderFrame ? FrameView({
frame,
onClick: onViewSourceInDebugger,
showEmptyPathAsHost: true,
sourceMapService
}) : null
);
let collapse = "";
let attachment = "";
if (stacktrace) {
if (open) {
attachment = dom.div({ className: "stacktrace devtools-monospace" },
StackTrace({
stacktrace: stacktrace,
onViewSourceInDebugger: onViewSourceInDebugger
})
);
}
collapse = CollapseButton({
open,
onClick: function () {
if (open) {
dispatch(actions.messageClose(message.id));
} else {
dispatch(actions.messageOpen(message.id));
}
},
});
}
const classes = ["message"];
classes.push(source);
classes.push(type);
classes.push(level);
if (open === true) {
classes.push("open");
}
return dom.div({
className: classes.join(" ")
},
icon,
collapse,
dom.span({ className: "message-body-wrapper" },
dom.span({ className: "message-flex-body" },
dom.span({ className: "message-body devtools-monospace" },
message.messageText
),
repeat,
location
),
attachment
)
);
const childProps = {
messageId,
open,
source,
type,
level,
topLevelClasses: [],
messageBody,
repeat,
frame,
stacktrace,
onViewSourceInDebugger,
sourceMapService,
emitNewMessage,
};
return Message(childProps);
}
module.exports.PageError = PageError;
module.exports = PageError;

Просмотреть файл

@ -0,0 +1,139 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
// React & Redux
const {
createClass,
createFactory,
DOM: dom,
PropTypes
} = require("devtools/client/shared/vendor/react");
const actions = require("devtools/client/webconsole/new-console-output/actions/index");
const CollapseButton = createFactory(require("devtools/client/webconsole/new-console-output/components/collapse-button"));
const MessageIcon = createFactory(require("devtools/client/webconsole/new-console-output/components/message-icon"));
const MessageRepeat = createFactory(require("devtools/client/webconsole/new-console-output/components/message-repeat"));
const FrameView = createFactory(require("devtools/client/shared/components/frame"));
const StackTrace = createFactory(require("devtools/client/shared/components/stack-trace"));
const Message = createClass({
displayName: "Message",
propTypes: {
open: PropTypes.bool,
source: PropTypes.string.isRequired,
type: PropTypes.string.isRequired,
level: PropTypes.string.isRequired,
topLevelClasses: PropTypes.array.isRequired,
messageBody: PropTypes.any.isRequired,
repeat: PropTypes.any,
frame: PropTypes.any,
attachment: PropTypes.any,
stacktrace: PropTypes.any,
messageId: PropTypes.string,
scrollToMessage: PropTypes.bool,
onViewSourceInDebugger: PropTypes.func,
sourceMapService: PropTypes.any,
},
componentDidMount() {
if (this.messageNode && this.props.emitNewMessage) {
this.props.emitNewMessage(this.messageNode);
if (this.props.scrollToMessage) {
this.messageNode.scrollIntoView();
}
}
},
render() {
const {
messageId,
open,
source,
type,
level,
topLevelClasses,
messageBody,
frame,
stacktrace,
onViewSourceInDebugger,
sourceMapService,
dispatch,
} = this.props;
topLevelClasses.push("message", source, type, level);
if (open) {
topLevelClasses.push("open");
}
const icon = MessageIcon({level});
// Figure out if there is an expandable part to the message.
let attachment = null;
if (this.props.attachment) {
attachment = this.props.attachment;
} else if (stacktrace) {
const child = open ? StackTrace({
stacktrace: stacktrace,
onViewSourceInDebugger: onViewSourceInDebugger
}) : null;
attachment = dom.div({ className: "stacktrace devtools-monospace" }, child);
}
// If there is an expandable part, make it collapsible.
let collapse = null;
if (attachment) {
collapse = CollapseButton({
open,
onClick: function () {
if (open) {
dispatch(actions.messageClose(messageId));
} else {
dispatch(actions.messageOpen(messageId));
}
},
});
}
const repeat = this.props.repeat ? MessageRepeat({repeat: this.props.repeat}) : null;
// Configure the location.
const shouldRenderFrame = frame && frame.source !== "debugger eval code";
const location = dom.span({ className: "message-location devtools-monospace" },
shouldRenderFrame ? FrameView({
frame,
onClick: onViewSourceInDebugger,
showEmptyPathAsHost: true,
sourceMapService
}) : null
);
return dom.div({
className: topLevelClasses.join(" "),
ref: node => {
this.messageNode = node;
}
},
// @TODO add timestamp
// @TODO add indent if necessary
icon,
collapse,
dom.span({ className: "message-body-wrapper" },
dom.span({ className: "message-flex-body" },
dom.span({ className: "message-body devtools-monospace" },
messageBody
),
repeat,
location
),
attachment
)
);
}
});
module.exports = Message;

Просмотреть файл

@ -17,5 +17,6 @@ DevToolsModules(
'message-container.js',
'message-icon.js',
'message-repeat.js',
'message.js',
'variables-view-link.js'
)

Просмотреть файл

@ -31,4 +31,4 @@ function VariablesViewLink(props) {
);
}
module.exports.VariablesViewLink = VariablesViewLink;
module.exports = VariablesViewLink;

Просмотреть файл

@ -18,6 +18,23 @@ const actionTypes = {
FILTER_BAR_TOGGLE: "FILTER_BAR_TOGGLE",
};
const prefs = {
PREFS: {
FILTER: {
ERROR: "devtools.webconsole.filter.error",
WARN: "devtools.webconsole.filter.warn",
INFO: "devtools.webconsole.filter.info",
LOG: "devtools.webconsole.filter.log",
DEBUG: "devtools.webconsole.filter.debug",
NET: "devtools.webconsole.filter.net",
NETXHR: "devtools.webconsole.filter.netxhr",
},
UI: {
FILTER_BAR: "devtools.webconsole.ui.filterbar"
}
}
};
const chromeRDPEnums = {
MESSAGE_SOURCE: {
XML: "xml",
@ -61,4 +78,4 @@ const chromeRDPEnums = {
};
// Combine into a single constants object
module.exports = Object.assign({}, actionTypes, chromeRDPEnums);
module.exports = Object.assign({}, actionTypes, prefs, chromeRDPEnums);

Просмотреть файл

@ -18,7 +18,7 @@ const NewConsoleOutputWrapper = BrowserLoader({
baseURI: "resource://devtools/client/webconsole/new-console-output/",
window}).require("./new-console-output-wrapper");
this.NewConsoleOutput = function (parentNode, jsterm, toolbox, owner) {
this.NewConsoleOutput = function (parentNode, jsterm, toolbox, owner, emitNewMessage) {
console.log("Creating NewConsoleOutput", parentNode, NewConsoleOutputWrapper);
return new NewConsoleOutputWrapper(parentNode, jsterm, toolbox, owner);
return new NewConsoleOutputWrapper(parentNode, jsterm, toolbox, owner, emitNewMessage);
};

Просмотреть файл

@ -15,9 +15,10 @@ const ConsoleOutput = React.createFactory(require("devtools/client/webconsole/ne
const FilterBar = React.createFactory(require("devtools/client/webconsole/new-console-output/components/filter-bar"));
const store = configureStore();
let queuedActions = [];
let throttledDispatchTimeout = false;
function NewConsoleOutputWrapper(parentNode, jsterm, toolbox, owner) {
this.parentNode = parentNode;
this.parentNode = parentNode;
this.jsterm = jsterm;
this.toolbox = toolbox;
@ -46,6 +47,11 @@ NewConsoleOutputWrapper.prototype = {
openLink: (url) => {
this.owner.openLink(url);
},
emitNewMessage: (node) => {
this.jsterm.hud.emit("new-messages", new Set([{
node
}]));
},
});
let filterBar = FilterBar({});
let provider = React.createElement(
@ -60,7 +66,7 @@ NewConsoleOutputWrapper.prototype = {
this.body = ReactDOM.render(provider, this.parentNode);
},
dispatchMessageAdd: (message) => {
store.dispatch(actions.messageAdd(message));
batchedMessageAdd(actions.messageAdd(message));
},
dispatchMessagesAdd: (messages) => {
const batchedActions = messages.map(message => actions.messageAdd(message));
@ -69,13 +75,18 @@ NewConsoleOutputWrapper.prototype = {
dispatchMessagesClear: () => {
store.dispatch(actions.messagesClear());
},
getLastMessage: function() {
// Return the last message in the DOM as the message that was just dispatched. This may not
// always be correct in the case of filtered messages, but it's close enough for our tests.
let messageNodes = this.parentNode.querySelectorAll(".message");
return messageNodes[messageNodes.length - 1]
},
};
function batchedMessageAdd(action) {
queuedActions.push(action);
if (!throttledDispatchTimeout) {
throttledDispatchTimeout = setTimeout(() => {
store.dispatch(actions.batchActions(queuedActions));
queuedActions = [];
throttledDispatchTimeout = null;
}, 50);
}
}
// Exports from this module
module.exports = NewConsoleOutputWrapper;

Просмотреть файл

@ -13,8 +13,8 @@ const FilterState = Immutable.Record({
error: true,
info: true,
log: true,
network: true,
netxhr: true,
net: false,
netxhr: false,
text: "",
warn: true,
});

Просмотреть файл

@ -5,21 +5,35 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const constants = require("devtools/client/webconsole/new-console-output/constants");
const {
FILTER_BAR_TOGGLE,
MESSAGE_ADD,
} = require("devtools/client/webconsole/new-console-output/constants");
const Immutable = require("devtools/client/shared/vendor/immutable");
const Ui = Immutable.Record({
const UiState = Immutable.Record({
filterBarVisible: false,
filteredMessageVisible: false,
autoscroll: true,
});
function ui(state = new Ui(), action) {
function ui(state = new UiState(), action) {
// Autoscroll should be set for all action types. If the last action was not message
// add, then turn it off. This prevents us from scrolling after someone toggles a
// filter, or to the bottom of the attachement when an expandable message at the bottom
// of the list is expanded. It does depend on the MESSAGE_ADD action being the last in
// its batch, though.
state = state.set("autoscroll", action.type == MESSAGE_ADD);
switch (action.type) {
case constants.FILTER_BAR_TOGGLE:
case FILTER_BAR_TOGGLE:
return state.set("filterBarVisible", !state.filterBarVisible);
}
return state;
}
exports.ui = ui;
module.exports = {
UiState,
ui,
};

Просмотреть файл

@ -49,7 +49,7 @@ function filterNetwork(messages, filters) {
return messages.filter((message) => {
return (
message.source !== MESSAGE_SOURCE.NETWORK
|| (filters.get("network") === true && message.isXHR === false)
|| (filters.get("net") === true && message.isXHR === false)
|| (filters.get("netxhr") === true && message.isXHR === true)
|| [MESSAGE_TYPE.COMMAND, MESSAGE_TYPE.RESULT].includes(message.type)
);
@ -99,6 +99,9 @@ function search(messages, text = "") {
}
function isTextInFrame(text, frame) {
if (!frame) {
return false;
}
// @TODO Change this to Object.values once it's supported in Node's version of V8
return Object.keys(frame)
.map(key => frame[key])

Просмотреть файл

@ -3,10 +3,18 @@
/* 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/. */
"use strict";
function getAllUi(state) {
return state.ui;
}
exports.getAllUi = getAllUi;
function getScrollSetting(state) {
return getAllUi(state).autoscroll;
}
module.exports = {
getAllUi,
getScrollSetting,
};

Просмотреть файл

@ -5,6 +5,7 @@
const {FilterState} = require("devtools/client/webconsole/new-console-output/reducers/filters");
const {PrefState} = require("devtools/client/webconsole/new-console-output/reducers/prefs");
const {UiState} = require("devtools/client/webconsole/new-console-output/reducers/ui");
const {
applyMiddleware,
combineReducers,
@ -12,7 +13,10 @@ const {
createStore
} = require("devtools/client/shared/vendor/redux");
const { thunk } = require("devtools/client/shared/redux/middleware/thunk");
const constants = require("devtools/client/webconsole/new-console-output/constants");
const {
BATCH_ACTIONS,
PREFS,
} = require("devtools/client/webconsole/new-console-output/constants");
const { reducers } = require("./reducers/index");
const Services = require("Services");
@ -22,12 +26,15 @@ function configureStore() {
logLimit: Math.max(Services.prefs.getIntPref("devtools.hud.loglimit"), 1),
}),
filters: new FilterState({
error: Services.prefs.getBoolPref("devtools.webconsole.filter.error"),
warn: Services.prefs.getBoolPref("devtools.webconsole.filter.warn"),
info: Services.prefs.getBoolPref("devtools.webconsole.filter.info"),
log: Services.prefs.getBoolPref("devtools.webconsole.filter.log"),
network: Services.prefs.getBoolPref("devtools.webconsole.filter.network"),
netxhr: Services.prefs.getBoolPref("devtools.webconsole.filter.netxhr"),
error: Services.prefs.getBoolPref(PREFS.FILTER.ERROR),
warn: Services.prefs.getBoolPref(PREFS.FILTER.WARN),
info: Services.prefs.getBoolPref(PREFS.FILTER.INFO),
log: Services.prefs.getBoolPref(PREFS.FILTER.LOG),
net: Services.prefs.getBoolPref(PREFS.FILTER.NET),
netxhr: Services.prefs.getBoolPref(PREFS.FILTER.NETXHR),
}),
ui: new UiState({
filterBarVisible: Services.prefs.getBoolPref(PREFS.UI.FILTER_BAR),
})
};
@ -45,7 +52,7 @@ function enableBatching() {
return next => (reducer, initialState, enhancer) => {
function batchingReducer(state, action) {
switch (action.type) {
case constants.BATCH_ACTIONS:
case BATCH_ACTIONS:
return action.actions.reduce(batchingReducer, state);
default:
return reducer(state, action);

Просмотреть файл

@ -1,54 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const actions = require("devtools/client/webconsole/new-console-output/actions/index");
const {
FILTER_TEXT_SET,
FILTER_TOGGLE,
FILTERS_CLEAR,
MESSAGE_LEVEL
} = require("devtools/client/webconsole/new-console-output/constants");
const expect = require("expect");
describe("Filter actions:", () => {
describe("filterTextSet", () => {
it("creates expected action", () => {
const action = actions.filterTextSet("test");
const expected = {
type: FILTER_TEXT_SET,
text: "test"
};
expect(action).toEqual(expected);
});
});
describe("filterToggle", () => {
it("creates expected action", () => {
const action = actions.filterToggle(MESSAGE_LEVEL.ERROR);
const expected = {
type: FILTER_TOGGLE,
filter: "error"
};
expect(action).toEqual(expected);
});
});
describe("filterTextApply", () => {
});
describe("filtersClear", () => {
it("creates expected action", () => {
const action = actions.filtersClear();
const expected = {
type: FILTERS_CLEAR
};
expect(action).toEqual(expected);
});
});
});

Просмотреть файл

@ -1,88 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const { thunk } = require("devtools/client/shared/redux/middleware/thunk");
const configureStore = require("redux-mock-store").default;
const { getRepeatId } = require("devtools/client/webconsole/new-console-output/utils/messages");
const { stubPackets, stubPreparedMessages } = require("devtools/client/webconsole/new-console-output/test/fixtures/stubs/index");
const { setupActions } = require("devtools/client/webconsole/new-console-output/test/helpers");
const constants = require("devtools/client/webconsole/new-console-output/constants");
const mockStore = configureStore([ thunk ]);
const expect = require("expect");
let actions;
describe("Message actions:", () => {
beforeEach(()=>{
actions = setupActions();
});
describe("messageAdd", () => {
it("dispatches expected action given a packet", () => {
const packet = stubPackets.get("console.log('foobar', 'test')");
const store = mockStore({});
store.dispatch(actions.messageAdd(packet));
const actualActions = store.getActions();
expect(actualActions.length).toEqual(1);
const addAction = actualActions[0];
const {message} = addAction;
const expectedAction = {
type: constants.MESSAGE_ADD,
message: stubPreparedMessages.get("console.log('foobar', 'test')")
};
expect(message.toJS()).toEqual(expectedAction.message.toJS());
});
it("dispatches expected actions given a console.clear packet", () => {
const packet = stubPackets.get("console.clear()");
const store = mockStore({});
store.dispatch(actions.messageAdd(packet));
const actualActions = store.getActions();
expect(actualActions.length).toEqual(1);
const [clearAction, addAction] = actualActions[0].actions;
expect(clearAction.type).toEqual(constants.MESSAGES_CLEAR);
const {message} = addAction;
const expectedAction = {
type: constants.MESSAGE_ADD,
message: stubPreparedMessages.get("console.clear()")
};
expect(addAction.type).toEqual(constants.MESSAGE_ADD);
expect(message.toJS()).toEqual(expectedAction.message.toJS());
});
it("dispatches expected action given a console.table packet", () => {
const packet = stubPackets.get("console.table(['a', 'b', 'c'])");
const store = mockStore({});
store.dispatch(actions.messageAdd(packet));
const expectedActions = store.getActions();
expect(expectedActions.length).toEqual(1);
const addAction = expectedActions[0];
const {message} = addAction;
const expected = {
type: constants.MESSAGE_ADD,
message: stubPreparedMessages.get("console.table(['a', 'b', 'c'])")
};
expect(message.toJS()).toEqual(expected.message.toJS());
});
});
describe("messagesClear", () => {
it("creates expected action", () => {
const action = actions.messagesClear();
const expected = {
type: constants.MESSAGES_CLEAR,
};
expect(action).toEqual(expected);
});
});
});

Просмотреть файл

@ -1,23 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const actions = require("devtools/client/webconsole/new-console-output/actions/index");
const {
FILTER_BAR_TOGGLE
} = require("devtools/client/webconsole/new-console-output/constants");
const expect = require("expect");
describe("UI actions:", () => {
describe("filterBarToggle", () => {
it("creates expected action", () => {
const action = actions.filterBarToggle();
const expected = {
type: FILTER_BAR_TOGGLE
};
expect(action).toEqual(expected);
});
});
});

Просмотреть файл

@ -4,4 +4,4 @@ support-files =
head.js
[test_render_perf.html]
skip-if = debug
skip-if = true # Bug 1306783

Просмотреть файл

@ -10,7 +10,7 @@ const { render } = require("enzyme");
const { createFactory } = require("devtools/client/shared/vendor/react");
// Components under test.
const ConsoleApiCall = createFactory(require("devtools/client/webconsole/new-console-output/components/message-types/console-api-call").ConsoleApiCall);
const ConsoleApiCall = createFactory(require("devtools/client/webconsole/new-console-output/components/message-types/console-api-call"));
// Test fakes.
const { stubPreparedMessages } = require("devtools/client/webconsole/new-console-output/test/fixtures/stubs/index");
@ -27,6 +27,11 @@ describe("ConsoleAPICall component:", () => {
expect(wrapper.find(".message-body").text()).toBe("foobar test");
expect(wrapper.find(".objectBox-string").length).toBe(2);
expect(wrapper.find("div.message.cm-s-mozilla span span.message-flex-body span.message-body.devtools-monospace").length).toBe(1);
// There should be the location
const locationLink = wrapper.find(`.message-location`);
expect(locationLink.length).toBe(1);
expect(locationLink.text()).toBe("test-tempfile.js:1:27");
});
it("renders repeat node", () => {
@ -36,6 +41,7 @@ describe("ConsoleAPICall component:", () => {
const wrapper = render(ConsoleApiCall({ message, onViewSourceInDebugger }));
expect(wrapper.find(".message-repeats").text()).toBe("107");
expect(wrapper.find(".message-repeats").prop("title")).toBe("107 repeats");
expect(wrapper.find("span > span.message-flex-body > span.message-body.devtools-monospace + span.message-repeats").length).toBe(1);
});

Просмотреть файл

@ -10,7 +10,7 @@ const { render } = require("enzyme");
const { createFactory } = require("devtools/client/shared/vendor/react");
// Components under test.
const EvaluationResult = createFactory(require("devtools/client/webconsole/new-console-output/components/message-types/evaluation-result").EvaluationResult);
const EvaluationResult = createFactory(require("devtools/client/webconsole/new-console-output/components/message-types/evaluation-result"));
// Test fakes.
const { stubPreparedMessages } = require("devtools/client/webconsole/new-console-output/test/fixtures/stubs/index");

Просмотреть файл

@ -9,7 +9,7 @@ const { render, mount } = require("enzyme");
const { createFactory } = require("devtools/client/shared/vendor/react");
const Provider = createFactory(require("react-redux").Provider);
const FilterButton = createFactory(require("devtools/client/webconsole/new-console-output/components/filter-button").FilterButton);
const FilterButton = createFactory(require("devtools/client/webconsole/new-console-output/components/filter-button"));
const FilterBar = createFactory(require("devtools/client/webconsole/new-console-output/components/filter-bar"));
const { getAllUi } = require("devtools/client/webconsole/new-console-output/selectors/ui");
const {

Просмотреть файл

@ -3,29 +3,24 @@
"use strict";
const expect = require("expect");
const sinon = require("sinon");
const { render, shallow } = require("enzyme");
const { render } = require("enzyme");
const { createFactory } = require("devtools/client/shared/vendor/react");
const FilterButton = createFactory(require("devtools/client/webconsole/new-console-output/components/filter-button").FilterButton);
const {
FILTER_TOGGLE,
MESSAGE_LEVEL
} = require("devtools/client/webconsole/new-console-output/constants");
const FilterButton = createFactory(require("devtools/client/webconsole/new-console-output/components/filter-button"));
const { MESSAGE_LEVEL } = require("devtools/client/webconsole/new-console-output/constants");
describe("FilterButton component:", () => {
const props = {
active: true,
label: "Error",
filterKey: MESSAGE_LEVEL.ERROR,
dispatch: sinon.spy()
};
it("displays as active when turned on", () => {
const wrapper = render(FilterButton(props));
expect(wrapper.html()).toBe(
"<button class=\"menu-filter-button checked\">Error</button>"
"<button class=\"menu-filter-button error checked\">Error</button>"
);
});
@ -33,17 +28,7 @@ describe("FilterButton component:", () => {
const inactiveProps = Object.assign({}, props, { active: false });
const wrapper = render(FilterButton(inactiveProps));
expect(wrapper.html()).toBe(
"<button class=\"menu-filter-button\">Error</button>"
"<button class=\"menu-filter-button error\">Error</button>"
);
});
it("fires FILTER_TOGGLE action when clicked", () => {
const wrapper = shallow(FilterButton(props));
wrapper.find("button").simulate("click");
const call = props.dispatch.getCall(0);
expect(call.args[0]).toEqual({
type: FILTER_TOGGLE,
filter: MESSAGE_LEVEL.ERROR
});
});
});

Просмотреть файл

@ -11,9 +11,9 @@ const {
// Components under test.
const { MessageContainer } = require("devtools/client/webconsole/new-console-output/components/message-container");
const { ConsoleApiCall } = require("devtools/client/webconsole/new-console-output/components/message-types/console-api-call");
const { EvaluationResult } = require("devtools/client/webconsole/new-console-output/components/message-types/evaluation-result");
const { PageError } = require("devtools/client/webconsole/new-console-output/components/message-types/page-error");
const ConsoleApiCall = require("devtools/client/webconsole/new-console-output/components/message-types/console-api-call");
const EvaluationResult = require("devtools/client/webconsole/new-console-output/components/message-types/evaluation-result");
const PageError = require("devtools/client/webconsole/new-console-output/components/message-types/page-error");
// Test fakes.
const { stubPreparedMessages } = require("devtools/client/webconsole/new-console-output/test/fixtures/stubs/index");

Просмотреть файл

@ -5,7 +5,7 @@
const {
MESSAGE_LEVEL,
} = require("devtools/client/webconsole/new-console-output/constants");
const { MessageIcon } = require("devtools/client/webconsole/new-console-output/components/message-icon");
const MessageIcon = require("devtools/client/webconsole/new-console-output/components/message-icon");
const expect = require("expect");

Просмотреть файл

@ -2,7 +2,7 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const { MessageRepeat } = require("devtools/client/webconsole/new-console-output/components/message-repeat");
const MessageRepeat = require("devtools/client/webconsole/new-console-output/components/message-repeat");
const expect = require("expect");

Просмотреть файл

@ -10,7 +10,7 @@ const { render } = require("enzyme");
const { createFactory } = require("devtools/client/shared/vendor/react");
// Components under test.
const NetworkEventMessage = createFactory(require("devtools/client/webconsole/new-console-output/components/message-types/network-event-message").NetworkEventMessage);
const NetworkEventMessage = createFactory(require("devtools/client/webconsole/new-console-output/components/message-types/network-event-message"));
// Test fakes.
const { stubPreparedMessages } = require("devtools/client/webconsole/new-console-output/test/fixtures/stubs/index");

Просмотреть файл

@ -7,7 +7,7 @@ const expect = require("expect");
const { render } = require("enzyme");
// Components under test.
const { PageError } = require("devtools/client/webconsole/new-console-output/components/message-types/page-error");
const PageError = require("devtools/client/webconsole/new-console-output/components/message-types/page-error");
// Test fakes.
const { stubPreparedMessages } = require("devtools/client/webconsole/new-console-output/test/fixtures/stubs/index");

Просмотреть файл

@ -0,0 +1,18 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
module.exports = {
PluralForm: {
get: function (occurence, str) {
// @TODO Remove when loading the actual strings from webconsole.properties
// is done in the L10n fixture.
if (str === "messageRepeats.tooltip2") {
return `${occurence} repeats`;
}
return str;
}
}
};

Просмотреть файл

@ -3,6 +3,8 @@
"use strict";
const { PREFS } = require("devtools/client/webconsole/new-console-output/constants");
module.exports = {
prefs: {
getIntPref: pref => {
@ -12,10 +14,14 @@ module.exports = {
}
},
getBoolPref: pref => {
switch (pref) {
default:
return true;
}
}
const falsey = [
PREFS.FILTER.NET,
PREFS.FILTER.NETXHR,
PREFS.UI.FILTER_BAR,
];
return !falsey.includes(pref);
},
setBoolPref: () => {},
clearUserPref: () => {},
}
};

Просмотреть файл

@ -6,8 +6,10 @@ support-files =
!/devtools/client/framework/test/shared-head.js
test-console-table.html
test-console.html
test-console-filters.html
[browser_webconsole_console_table.js]
[browser_webconsole_filters.js]
[browser_webconsole_init.js]
[browser_webconsole_input_focus.js]
[browser_webconsole_observer_notifications.js]

Просмотреть файл

@ -0,0 +1,72 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests filters.
"use strict";
const { MESSAGE_LEVEL } = require("devtools/client/webconsole/new-console-output/constants");
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/new-console-output/test/mochitest/test-console-filters.html";
add_task(function* () {
let hud = yield openNewTabAndConsole(TEST_URI);
const outputNode = hud.ui.experimentalOutputNode;
const toolbar = yield waitFor(() => {
return outputNode.querySelector(".webconsole-filterbar-primary");
});
ok(toolbar, "Toolbar found");
// Show the filter bar
toolbar.querySelector(".devtools-filter-icon").click();
const filterBar = yield waitFor(() => {
return outputNode.querySelector(".webconsole-filterbar-secondary");
});
ok(filterBar, "Filter bar is shown when filter icon is clicked.");
// Check defaults.
Object.values(MESSAGE_LEVEL).forEach(level => {
ok(filterIsEnabled(filterBar.querySelector(`.${level}`)),
`Filter button for ${level} is on by default`);
});
["net", "netxhr"].forEach(category => {
ok(!filterIsEnabled(filterBar.querySelector(`.${category}`)),
`Filter button for ${category} is off by default`);
});
// Check that messages are shown as expected. This depends on cached messages being
// shown.
ok(findMessages(hud, "").length == 5,
"Messages of all levels shown when filters are on.");
// Check that messages are not shown when their filter is turned off.
filterBar.querySelector(".error").click();
yield waitFor(() => findMessages(hud, "").length == 4);
ok(true, "When a filter is turned off, its messages are not shown.");
// Check that the ui settings were persisted.
yield closeTabAndToolbox();
yield testFilterPersistence();
});
function filterIsEnabled(button) {
return button.classList.contains("checked");
}
function* testFilterPersistence() {
let hud = yield openNewTabAndConsole(TEST_URI);
const outputNode = hud.ui.experimentalOutputNode;
const filterBar = yield waitFor(() => {
return outputNode.querySelector(".webconsole-filterbar-secondary");
});
ok(filterBar, "Filter bar ui setting is persisted.");
// Check that the filter settings were persisted.
ok(!filterIsEnabled(filterBar.querySelector(".error")),
"Filter button setting is persisted");
ok(findMessages(hud, "").length == 4,
"Messages of all levels shown when filters are on.");
}

Просмотреть файл

@ -109,9 +109,25 @@ function* waitFor(condition, message = "waitFor", interval = 100, maxTries = 50)
* The selector to use in finding the message.
*/
function findMessage(hud, text, selector = ".message") {
const elements = findMessages(hud, text, selector);
return elements.pop();
}
/**
* Find multiple messages in the output.
*
* @param object hud
* The web console.
* @param string text
* A substring that can be found in the message.
* @param selector [optional]
* The selector to use in finding the message.
*/
function findMessages(hud, text, selector = ".message") {
const messages = hud.ui.experimentalOutputNode.querySelectorAll(selector);
const elements = Array.prototype.filter.call(
hud.ui.experimentalOutputNode.querySelectorAll(selector),
messages,
(el) => el.textContent.includes(text)
);
return elements.length > 0 ? elements.pop() : false;
return elements;
}

Просмотреть файл

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Webconsole filters test page</title>
</head>
<body>
<p>Webconsole filters test page</p>
<script>
console.log("console log");
console.warn("console warn");
console.error("console error");
console.info("console info");
console.count("console debug");
</script>
</body>
</html>

Просмотреть файл

@ -27,6 +27,8 @@ requireHacker.global_hook("default", path => {
return `module.exports = require("devtools/client/webconsole/new-console-output/test/fixtures/WebConsoleUtils")`;
case "devtools/shared/l10n":
return `module.exports = require("devtools/client/webconsole/new-console-output/test/fixtures/LocalizationHelper")`;
case "devtools/shared/plural-form":
return `module.exports = require("devtools/client/webconsole/new-console-output/test/fixtures/PluralForm")`;
case "Services":
case "Services.default":
return `module.exports = require("devtools/client/webconsole/new-console-output/test/fixtures/Services")`;

Просмотреть файл

@ -65,11 +65,11 @@ describe("Filtering", () => {
store.dispatch(messageAdd(message));
let messages = getAllMessages(store.getState());
expect(messages.size).toEqual(numMessages + 1);
expect(messages.size).toEqual(numMessages);
store.dispatch(actions.filterToggle("netxhr"));
messages = getAllMessages(store.getState());
expect(messages.size).toEqual(numMessages);
expect(messages.size).toEqual(numMessages + 1);
});
it("filters network messages", () => {
@ -77,11 +77,11 @@ describe("Filtering", () => {
store.dispatch(messageAdd(message));
let messages = getAllMessages(store.getState());
expect(messages.size).toEqual(numMessages + 1);
store.dispatch(actions.filterToggle("network"));
messages = getAllMessages(store.getState());
expect(messages.size).toEqual(numMessages);
store.dispatch(actions.filterToggle("net"));
messages = getAllMessages(store.getState());
expect(messages.size).toEqual(numMessages + 1);
});
});
@ -171,8 +171,8 @@ describe("Clear filters", () => {
"error": false,
"info": true,
"log": true,
"network": true,
"netxhr": false,
"net": false,
"netxhr": true,
"warn": true,
"text": "foobar"
});
@ -185,8 +185,8 @@ describe("Clear filters", () => {
"error": true,
"info": true,
"log": true,
"network": true,
"netxhr": true,
"net": false,
"netxhr": false,
"warn": true,
"text": ""
});

Просмотреть файл

@ -10,7 +10,6 @@
"jsdom": "^9.4.1",
"jsdom-global": "^2.0.0",
"mocha": "^2.5.3",
"redux-mock-store": "^1.1.4",
"require-hacker": "^2.1.4",
"sinon": "^1.17.5"
},

Просмотреть файл

@ -13,6 +13,11 @@ const TEST_HTTPS_URI = "https://example.com/browser/devtools/client/" +
const LEARN_MORE_URI = "https://developer.mozilla.org/docs/Web/Security/" +
"Mixed_content";
registerCleanupFunction(function*() {
Services.prefs.clearUserPref("security.mixed_content.block_display_content");
Services.prefs.clearUserPref("security.mixed_content.block_active_content");
});
add_task(function* () {
Services.prefs.setBoolPref("security.mixed_content.block_display_content",
false);
@ -24,9 +29,6 @@ add_task(function* () {
let hud = yield openConsole();
yield testMixedContent(hud);
Services.prefs.clearUserPref("security.mixed_content.block_display_content");
Services.prefs.clearUserPref("security.mixed_content.block_active_content");
});
var testMixedContent = Task.async(function* (hud) {

Просмотреть файл

@ -591,6 +591,7 @@ WebConsoleFrame.prototype = {
this.outputNode.parentNode.appendChild(this.experimentalOutputNode);
// @TODO Once the toolbox has been converted to React, see if passing
// in JSTerm is still necessary.
this.newConsoleOutput = new this.window.NewConsoleOutput(
this.experimentalOutputNode, this.jsterm, toolbox, this.owner);
console.log("Created newConsoleOutput", this.newConsoleOutput);
@ -3266,10 +3267,6 @@ WebConsoleConnectionProxy.prototype = {
*/
dispatchMessageAdd: function(packet) {
this.webConsoleFrame.newConsoleOutput.dispatchMessageAdd(packet);
this.webConsoleFrame.emit("new-messages", new Set([{
response: packet,
node: this.webConsoleFrame.newConsoleOutput.getLastMessage(),
}]));
},
/**

Просмотреть файл

@ -11691,9 +11691,12 @@ nsDocShell::OnNewURI(nsIURI* aURI, nsIChannel* aChannel,
AddURIVisit(aURI, referrer, previousURI, previousFlags, responseStatus);
}
// If this was a history load or a refresh,
// update the index in SH.
if (rootSH && (mLoadType & (LOAD_CMD_HISTORY | LOAD_CMD_RELOAD))) {
// If this was a history load or a refresh, or it was a history load but
// later changed to LOAD_NORMAL_REPLACE due to redirection, update the index
// in session history.
if (rootSH &&
((mLoadType & (LOAD_CMD_HISTORY | LOAD_CMD_RELOAD)) ||
mLoadType == LOAD_NORMAL_REPLACE)) {
nsCOMPtr<nsISHistoryInternal> shInternal(do_QueryInterface(rootSH));
if (shInternal) {
rootSH->GetIndex(&mPreviousTransIndex);
@ -12329,9 +12332,14 @@ nsDocShell::AddToSessionHistory(nsIURI* aURI, nsIChannel* aChannel,
// This is the root docshell
bool addToSHistory = !LOAD_TYPE_HAS_FLAGS(mLoadType, LOAD_FLAGS_REPLACE_HISTORY);
if (!addToSHistory) {
// Replace current entry in session history.
// Replace current entry in session history; If the requested index is
// valid, it indicates the loading was triggered by a history load, and
// we should replace the entry at requested index instead.
int32_t index = 0;
mSessionHistory->GetIndex(&index);
mSessionHistory->GetRequestedIndex(&index);
if (index == -1) {
mSessionHistory->GetIndex(&index);
}
nsCOMPtr<nsISHistoryInternal> shPrivate =
do_QueryInterface(mSessionHistory);
// Replace the current entry with the new entry

Просмотреть файл

@ -8,26 +8,23 @@
* SHEntry.
**/
function test() {
add_task(function* test() {
waitForExplicitFinish();
let tab = gBrowser.addTab('http://example.com');
let tabBrowser = tab.linkedBrowser;
yield BrowserTestUtils.withNewTab({ gBrowser, url: "http://example.com" },
function* (browser) {
yield ContentTask.spawn(browser, null, function* () {
let cw = content;
let oldTitle = cw.document.title;
ok(oldTitle, 'Content window should initially have a title.');
cw.history.pushState('', '', 'new_page');
BrowserTestUtils.browserLoaded(tab.linkedBrowser).then(() => {
let cw = tabBrowser.contentWindow;
let oldTitle = cw.document.title;
ok(oldTitle, 'Content window should initially have a title.');
cw.history.pushState('', '', 'new_page');
let shistory = cw.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.sessionHistory;
let shistory = cw.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.sessionHistory;
is(shistory.getEntryAtIndex(shistory.index, false).title,
oldTitle, 'SHEntry title after pushstate.');
gBrowser.removeTab(tab);
finish();
});
}
is(shistory.getEntryAtIndex(shistory.index, false).title,
oldTitle, 'SHEntry title after pushstate.');
});
});
});

Просмотреть файл

@ -5,46 +5,28 @@
// Test that the docShell has the right profile timeline API
var test = Task.async(function*() {
waitForExplicitFinish();
const URL = "data:text/html;charset=utf-8,Test page";
yield openUrl("data:text/html;charset=utf-8,Test page");
add_task(function* () {
yield BrowserTestUtils.withNewTab({ gBrowser, url: URL },
function* (browser) {
yield ContentTask.spawn(browser, null, function() {
ok("recordProfileTimelineMarkers" in docShell,
"The recordProfileTimelineMarkers attribute exists");
ok("popProfileTimelineMarkers" in docShell,
"The popProfileTimelineMarkers function exists");
ok(docShell.recordProfileTimelineMarkers === false,
"recordProfileTimelineMarkers is false by default");
ok(docShell.popProfileTimelineMarkers().length === 0,
"There are no markers by default");
let docShell = content.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
docShell.recordProfileTimelineMarkers = true;
ok(docShell.recordProfileTimelineMarkers === true,
"recordProfileTimelineMarkers can be set to true");
ok("recordProfileTimelineMarkers" in docShell,
"The recordProfileTimelineMarkers attribute exists");
ok("popProfileTimelineMarkers" in docShell,
"The popProfileTimelineMarkers function exists");
ok(docShell.recordProfileTimelineMarkers === false,
"recordProfileTimelineMarkers is false by default");
ok(docShell.popProfileTimelineMarkers().length === 0,
"There are no markers by default");
docShell.recordProfileTimelineMarkers = true;
ok(docShell.recordProfileTimelineMarkers === true,
"recordProfileTimelineMarkers can be set to true");
docShell.recordProfileTimelineMarkers = false;
ok(docShell.recordProfileTimelineMarkers === false,
"recordProfileTimelineMarkers can be set to false");
gBrowser.removeCurrentTab();
finish();
docShell.recordProfileTimelineMarkers = false;
ok(docShell.recordProfileTimelineMarkers === false,
"recordProfileTimelineMarkers can be set to false");
});
});
});
function openUrl(url) {
return new Promise(function(resolve, reject) {
window.focus();
let tab = window.gBrowser.selectedTab = window.gBrowser.addTab(url);
let linkedBrowser = tab.linkedBrowser;
linkedBrowser.addEventListener("load", function onload() {
linkedBrowser.removeEventListener("load", onload, true);
resolve(tab);
}, true);
});
}

Просмотреть файл

@ -3,13 +3,11 @@
"use strict";
// Test that the docShell UA emulation works
add_task(function*() {
yield openUrl("data:text/html;charset=utf-8,<iframe id='test-iframe'></iframe>");
const URL = "data:text/html;charset=utf-8,<iframe id='test-iframe'></iframe>";
let docshell = content.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
// Test that the docShell UA emulation works
function* contentTask() {
let docshell = docShell;
is(docshell.customUserAgent, "", "There should initially be no customUserAgent");
docshell.customUserAgent = "foo";
@ -25,28 +23,14 @@ add_task(function*() {
is(newFrameWin.navigator.userAgent, "foo", "Newly created frames should use the new UA");
newFrameWin.location.reload();
yield waitForEvent(newFrameWin, "load");
yield ContentTaskUtils.waitForEvent(newFrameWin, "load");
is(newFrameWin.navigator.userAgent, "foo", "New UA should persist across reloads");
gBrowser.removeCurrentTab();
}
add_task(function* () {
yield BrowserTestUtils.withNewTab({ gBrowser, url: URL },
function* (browser) {
yield ContentTask.spawn(browser, null, contentTask);
});
});
function waitForEvent(target, event) {
return new Promise(function(resolve) {
target.addEventListener(event, resolve);
});
}
function openUrl(url) {
return new Promise(function(resolve, reject) {
window.focus();
let tab = window.gBrowser.selectedTab = window.gBrowser.addTab(url);
let linkedBrowser = tab.linkedBrowser;
linkedBrowser.addEventListener("load", function onload() {
linkedBrowser.removeEventListener("load", onload, true);
resolve(tab);
}, true);
});
}

Просмотреть файл

@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Bug 1300461</title>
</head>
<body onload="test();">
<script>
/**
* Bug 1300461 identifies that if a history entry was not bfcached, and
* a http redirection happens when navigating to that entry, the history
* index would mess up.
*
* The test case emulates the circumstance by the following steps
* 1) Navigate to file_bug1300461_back.html which is not bf-cachable.
* 2) In file_bug1300461_back.html, replace its own history state to
* file_bug1300461_redirect.html.
* 3) Back, and then forward. Since the document is not in bfcache, it
* tries to load file_bug1300461_redirect.html directly.
* 4) file_bug1300461_redirect.html redirects UA to
* file_bug1300461_back.html through HTTP 301 header.
*
* We verify the history index, canGoBack, canGoForward, etc. keep correct
* in this process.
*/
let Ci = SpecialPowers.Ci;
let webNav = SpecialPowers.wrap(window)
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation);
let shistory = webNav.sessionHistory;
let testSteps = [
function() {
opener.is(shistory.count, 1, 'check history length');
opener.is(shistory.index, 0, 'check history index');
opener.ok(!webNav.canGoForward, 'check canGoForward');
setTimeout(() => window.location = 'file_bug1300461_back.html', 0);
},
function() {
opener.is(shistory.count, 2, 'check history length');
opener.is(shistory.index, 0, 'check history index');
opener.ok(webNav.canGoForward, 'check canGoForward');
window.history.forward();
opener.is(shistory.requestedIndex, 1, 'check requestedIndex');
},
function() {
opener.is(shistory.count, 2, 'check history length');
opener.is(shistory.index, 0, 'check history index');
opener.ok(webNav.canGoForward, 'check canGoForward');
opener.info('file_bug1300461.html tests finished');
opener.nextTest();
window.close();
}
];
function test() {
if (opener) {
opener.info('file_bug1300461.html test ' + opener.testCount);
testSteps[opener.testCount++]();
}
}
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Bug 1300461</title>
</head>
<!-- The empty unload handler is to prevent bfcache. -->
<body onload="test();" onunload="">
<script>
let Ci = SpecialPowers.Ci;
let webNav = SpecialPowers.wrap(window)
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation);
let shistory = webNav.sessionHistory;
function test() {
if (opener) {
opener.info("file_bug1300461_back.html");
opener.is(shistory.count, 2, 'check history length');
opener.is(shistory.index, 1, 'check history index');
opener.is(shistory.requestedIndex, -1, 'check requestedIndex');
opener.ok(webNav.canGoBack, 'check canGoBack');
if (opener.testCount == 1) {
opener.info('replaceState to redirect.html');
window.history.replaceState({}, '', 'file_bug1300461_redirect.html');
}
window.history.back();
}
}
</script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Bug 1300461</title>
</head>
<body>
Redirect to file_bug1300461_back.html.
</body>
</html>

Просмотреть файл

@ -0,0 +1,2 @@
HTTP 301 Moved Permanently
Location: file_bug1300461_back.html

Просмотреть файл

@ -32,7 +32,11 @@ support-files =
file_triggeringprincipal_iframe_iframe_window_open_frame_a.html
file_triggeringprincipal_iframe_iframe_window_open_frame_b.html
file_triggeringprincipal_iframe_iframe_window_open_frame_a_nav.html
file_bug1300461.html
file_bug1300461_redirect.html
file_bug1300461_redirect.html^headers^
file_bug1300461_back.html
[test_bug13871.html]
skip-if = buildapp == 'b2g' || buildapp == 'mulet' || toolkit == 'android' #RANDOM # Bug 1136180 disabled on B2G Desktop and Mulet for intermittent failures
[test_bug270414.html]

Просмотреть файл

@ -30,7 +30,8 @@ var testFiles =
"file_fragment_handling_during_load.html",
"file_nested_frames.html",
"file_shiftReload_and_pushState.html",
"file_scrollRestoration.html"
"file_scrollRestoration.html",
"file_bug1300461.html"
];
var testCount = 0; // Used by the test files.
@ -42,7 +43,7 @@ function nextTest_() {
if (testFiles.length) {
testCount = 0;
testWindow = window.open(testFiles.shift(), "", "width=300,height=300");
testWindow.onunload = function () { } //XXX
testWindow.onunload = function () { } // to prevent bfcache
} else {
SimpleTest.finish();
}

Просмотреть файл

@ -589,8 +589,8 @@ TextTrackManager::TimeMarchesOn()
WEBVTT_LOG("TimeMarchesOn");
mTimeMarchesOnDispatched = false;
// Early return if we don't have any TextTracks.
if (!mTextTracks || mTextTracks->Length() == 0) {
// Early return if we don't have any TextTracks or shutting down.
if (!mTextTracks || mTextTracks->Length() == 0 || mShutdown) {
return;
}

Просмотреть файл

@ -150,9 +150,12 @@ TextTrack::AddCue(TextTrackCue& aCue)
void
TextTrack::RemoveCue(TextTrackCue& aCue, ErrorResult& aRv)
{
aCue.SetActive(false);
// Bug1304948, check the aCue belongs to the TextTrack.
mCueList->RemoveCue(aCue, aRv);
if (aRv.Failed()) {
return;
}
aCue.SetActive(false);
aCue.SetTrack(nullptr);
if (mTextTrackList) {
HTMLMediaElement* mediaElement = mTextTrackList->GetMediaElement();

Просмотреть файл

@ -132,36 +132,48 @@ CopyArrayBufferViewOrArrayBufferData(const dom::ArrayBufferViewOrArrayBuffer& aB
aOutData.AppendElements(data.mData, data.mLength);
}
nsString
KeySystemToGMPName(const nsAString& aKeySystem)
{
if (!CompareUTF8toUTF16(kEMEKeySystemPrimetime, aKeySystem)) {
return NS_LITERAL_STRING("gmp-eme-adobe");
}
if (!CompareUTF8toUTF16(kEMEKeySystemClearkey, aKeySystem)) {
return NS_LITERAL_STRING("gmp-clearkey");
}
if (!CompareUTF8toUTF16(kEMEKeySystemWidevine, aKeySystem)) {
return NS_LITERAL_STRING("gmp-widevinecdm");
}
MOZ_ASSERT(false, "We should only call this for known GMPs");
return EmptyString();
}
bool
IsClearkeyKeySystem(const nsAString& aKeySystem)
{
return !CompareUTF8toUTF16(kEMEKeySystemClearkey, aKeySystem);
}
bool
IsPrimetimeKeySystem(const nsAString& aKeySystem)
{
return !CompareUTF8toUTF16(kEMEKeySystemPrimetime, aKeySystem);
}
bool
IsWidevineKeySystem(const nsAString& aKeySystem)
{
return !CompareUTF8toUTF16(kEMEKeySystemWidevine, aKeySystem);
}
nsString
KeySystemToGMPName(const nsAString& aKeySystem)
{
if (IsPrimetimeKeySystem(aKeySystem)) {
return NS_LITERAL_STRING("gmp-eme-adobe");
}
if (IsClearkeyKeySystem(aKeySystem)) {
return NS_LITERAL_STRING("gmp-clearkey");
}
if (IsWidevineKeySystem(aKeySystem)) {
return NS_LITERAL_STRING("gmp-widevinecdm");
}
MOZ_ASSERT(false, "We should only call this for known GMPs");
return EmptyString();
}
CDMType
ToCDMTypeTelemetryEnum(const nsString& aKeySystem)
{
if (!CompareUTF8toUTF16(kEMEKeySystemWidevine, aKeySystem)) {
if (IsWidevineKeySystem(aKeySystem)) {
return CDMType::eWidevine;
} else if (!CompareUTF8toUTF16(kEMEKeySystemClearkey, aKeySystem)) {
} else if (IsClearkeyKeySystem(aKeySystem)) {
return CDMType::eClearKey;
} else if (!CompareUTF8toUTF16(kEMEKeySystemPrimetime, aKeySystem)) {
} else if (IsPrimetimeKeySystem(aKeySystem)) {
return CDMType::ePrimetime;
}
return CDMType::eUnknown;

Просмотреть файл

@ -106,6 +106,12 @@ KeySystemToGMPName(const nsAString& aKeySystem);
bool
IsClearkeyKeySystem(const nsAString& aKeySystem);
bool
IsPrimetimeKeySystem(const nsAString& aKeySystem);
bool
IsWidevineKeySystem(const nsAString& aKeySystem);
enum CDMType {
eClearKey = 0,
ePrimetime = 1,

Просмотреть файл

@ -191,7 +191,7 @@ MediaKeySystemAccess::IsGMPPresentOnDisk(const nsAString& aKeySystem,
bool isPresent = true;
#if XP_WIN
if (!CompareUTF8toUTF16(kEMEKeySystemPrimetime, aKeySystem)) {
if (IsPrimetimeKeySystem(aKeySystem)) {
if (!AdobePluginDLLExists(aVersion)) {
NS_WARNING("Adobe EME plugin disappeared from disk!");
aOutMessage = NS_LITERAL_CSTRING("Adobe DLL was expected to be on disk but was not");
@ -276,12 +276,12 @@ MediaKeySystemAccess::GetKeySystemStatus(const nsAString& aKeySystem,
return MediaKeySystemStatus::Error;
}
if (!CompareUTF8toUTF16(kEMEKeySystemClearkey, aKeySystem)) {
if (IsClearkeyKeySystem(aKeySystem)) {
return EnsureMinCDMVersion(mps, aKeySystem, aMinCdmVersion, aOutMessage, aOutCdmVersion);
}
if (Preferences::GetBool("media.gmp-eme-adobe.visible", false)) {
if (!CompareUTF8toUTF16(kEMEKeySystemPrimetime, aKeySystem)) {
if (IsPrimetimeKeySystem(aKeySystem)) {
if (!Preferences::GetBool("media.gmp-eme-adobe.enabled", false)) {
aOutMessage = NS_LITERAL_CSTRING("Adobe EME disabled");
return MediaKeySystemStatus::Cdm_disabled;
@ -298,7 +298,7 @@ MediaKeySystemAccess::GetKeySystemStatus(const nsAString& aKeySystem,
}
if (Preferences::GetBool("media.gmp-widevinecdm.visible", false)) {
if (!CompareUTF8toUTF16(kEMEKeySystemWidevine, aKeySystem)) {
if (IsWidevineKeySystem(aKeySystem)) {
#ifdef XP_WIN
// Win Vista and later only.
if (!IsVistaOrLater()) {
@ -563,7 +563,7 @@ CanDecryptAndDecode(mozIGeckoMediaPluginService* aGMPService,
// the Adobe GMP's unencrypted AAC decoding path being used to
// decode content decrypted by the Widevine CDM.
if (codec == GMP_CODEC_AAC &&
!CompareUTF8toUTF16(kEMEKeySystemWidevine, aKeySystem) &&
IsWidevineKeySystem(aKeySystem) &&
!WMFDecoderModule::HasAAC()) {
if (aDiagnostics) {
aDiagnostics->SetKeySystemIssue(
@ -1130,7 +1130,7 @@ GetSupportedConfig(mozIGeckoMediaPluginService* aGMPService,
#if defined(XP_WIN)
// Widevine CDM doesn't include an AAC decoder. So if WMF can't decode AAC,
// and a codec wasn't specified, be conservative and reject the MediaKeys request.
if (!CompareUTF8toUTF16(kEMEKeySystemWidevine, aKeySystem.mKeySystem) &&
if (IsWidevineKeySystem(aKeySystem.mKeySystem) &&
(aCandidate.mAudioCapabilities.IsEmpty() ||
aCandidate.mVideoCapabilities.IsEmpty()) &&
!WMFDecoderModule::HasAAC()) {

Просмотреть файл

@ -142,8 +142,7 @@ MediaKeySystemAccessManager::Request(DetailedPromise* aPromise,
if ((status == MediaKeySystemStatus::Cdm_not_installed ||
status == MediaKeySystemStatus::Cdm_insufficient_version) &&
(!CompareUTF8toUTF16(kEMEKeySystemPrimetime, keySystem) ||
!CompareUTF8toUTF16(kEMEKeySystemWidevine, keySystem))) {
(IsPrimetimeKeySystem(keySystem) || IsWidevineKeySystem(keySystem))) {
// These are cases which could be resolved by downloading a new(er) CDM.
// When we send the status to chrome, chrome's GMPProvider will attempt to
// download or update the CDM. In AwaitInstall() we add listeners to wait
@ -154,7 +153,7 @@ MediaKeySystemAccessManager::Request(DetailedPromise* aPromise,
if (aType == RequestType::Initial &&
AwaitInstall(aPromise, aKeySystem, aConfigs)) {
// Notify chrome that we're going to wait for the CDM to download/update.
// Note: If we're re-trying, we don't re-send the notificaiton,
// Note: If we're re-trying, we don't re-send the notification,
// as chrome is already displaying the "we can't play, updating"
// notification.
MediaKeySystemAccess::NotifyObservers(mWindow, keySystem, status);

Просмотреть файл

@ -203,7 +203,9 @@ HRESULT
MFStartup()
{
HRESULT hr = LoadDLLs();
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
if (FAILED(hr)) {
return hr;
}
const int MF_VISTA_VERSION = (0x0001 << 16 | MF_API_VERSION);
const int MF_WIN7_VERSION = (0x0002 << 16 | MF_API_VERSION);

Просмотреть файл

@ -0,0 +1,33 @@
<html class="reftest-wait">
<head>
<title> Bug 1304948 : Crash if a texttrack remove a cue not belongs to it. </title>
</head>
<meta charset="utf-8">
<script type="text/javascript">
window.onload = function() {
var a = document.createElementNS('http://www.w3.org/1999/xhtml', 'video');
a.src = "";
document.body.appendChild(a);
var b = a.addTextTrack('chapters', "AAAAAAAAAAAAAAAA", "de");
var c = new VTTCue(0.6, 0.3, "AA");
b.addCue(c);
var d = document.createElementNS('http://www.w3.org/1999/xhtml', 'video');
var e = d.addTextTrack('chapters', "AAAA", "en-US");
a.currentTime = 2;
a.play();
try {
// This will queue a TimeMarchesOn task on mainthread, so use
// timer to wait the TimeMarchesOn crash.
e.removeCue(c);
} catch (e) {
if (e.name == "NotFoundError") {
setTimeout(function() {
document.documentElement.removeAttribute("class");}, 0);
}
}
};
</script>
</body>
</html>

Просмотреть файл

@ -82,6 +82,7 @@ skip-if(!B2G) load 1158427.html
load 1185176.html
load 1185192.html
load 1228484.html
load 1304948.html
load analyser-channels-1.html
load audiocontext-double-suspend.html
load buffer-source-duration-1.html

Просмотреть файл

@ -1,7 +1,7 @@
[DEFAULT]
tags = msg webrtc
subsuite = media
skip-if = (buildapp == 'mulet') || (toolkit == 'gonk' && debug) # b2g(Either bug 1171118 or bug 1169838, take your pick)
skip-if = (buildapp == 'mulet') || (toolkit == 'gonk') # b2g (bug 1306391)
support-files =
head.js
dataChannel.js
@ -25,55 +25,47 @@ support-files =
[test_a_noOp.html]
[test_dataChannel_basicAudio.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' && debug) # Bug 962984 for debug, bug 963244 for opt
skip-if = (android_version == '18' && debug) # Bug 962984 for debug, bug 963244 for opt
[test_dataChannel_basicAudioVideo.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_dataChannel_basicAudioVideoNoBundle.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' # b2g(Bug 960442, video support for WebRTC is disabled on b2g) FAILS WHEN RUN MANUALLY ON AWS, android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_dataChannel_basicAudioVideoCombined.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_dataChannel_basicDataOnly.html]
[test_dataChannel_basicVideo.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_dataChannel_bug1013809.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' # b2g emulator seems to be too slow (Bug 1016498 and 1008080)
[test_dataChannel_noOffer.html]
[test_enumerateDevices.html]
skip-if = buildapp == 'mulet'
[test_ondevicechange.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || os == 'win' || os == 'android'
skip-if = os == 'win' || os == 'android'
[test_getUserMedia_audioCapture.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' # b2g emulator seems to be too slow (Bug 1016498 and 1008080), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_getUserMedia_addTrackRemoveTrack.html]
skip-if = (toolkit == 'gonk' || buildapp == 'mulet' && debug) # debug-only failure
[test_getUserMedia_addtrack_removetrack_events.html]
[test_getUserMedia_basicAudio.html]
skip-if = (toolkit == 'gonk' || buildapp == 'mulet' && debug) # debug-only failure
[test_getUserMedia_basicVideo.html]
skip-if = (toolkit == 'gonk' || buildapp == 'mulet' && debug) # debug-only failure
[test_getUserMedia_basicVideo_playAfterLoadedmetadata.html]
skip-if = (toolkit == 'gonk' || buildapp == 'mulet' && debug) # debug-only failure
[test_getUserMedia_basicScreenshare.html]
skip-if = buildapp == 'b2g' || toolkit == 'android' # no screenshare on b2g/android # Bug 1141029 Mulet parity with B2G Desktop for TC
skip-if = toolkit == 'android' # no screenshare on android
[test_getUserMedia_basicTabshare.html]
skip-if = buildapp == 'b2g' || toolkit == 'android' # no windowshare on b2g/android # Bug 1141029 Mulet parity with B2G Desktop for TC
skip-if = toolkit == 'android' # no windowshare on android
[test_getUserMedia_basicWindowshare.html]
skip-if = buildapp == 'b2g' || toolkit == 'android' # no windowshare on b2g/android # Bug 1141029 Mulet parity with B2G Desktop for TC
skip-if = toolkit == 'android' # no windowshare on android
[test_getUserMedia_basicVideoAudio.html]
skip-if = (toolkit == 'gonk' || buildapp == 'mulet' && debug) # debug-only failure, turned an intermittent (bug 962579) into a permanant orange
[test_getUserMedia_bug1223696.html]
[test_getUserMedia_constraints.html]
[test_getUserMedia_callbacks.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' # Bug 1063290, intermittent timeout # TC: Bug 1144079 - Re-enable Mulet mochitests and reftests taskcluster-specific disables.
[test_getUserMedia_getTrackById.html]
[test_getUserMedia_gumWithinGum.html]
[test_getUserMedia_loadedmetadata.html]
[test_getUserMedia_mediaElementCapture_audio.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' # b2g emulator seems to be too slow (Bug 1016498 and 1008080), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_getUserMedia_mediaElementCapture_tracks.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' # b2g emulator seems to be too slow (Bug 1016498 and 1008080), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_getUserMedia_mediaElementCapture_video.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' # b2g emulator seems to be too slow (Bug 1016498 and 1008080), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_getUserMedia_mediaStreamClone.html]
[test_getUserMedia_mediaStreamConstructors.html]
[test_getUserMedia_mediaStreamTrackClone.html]
@ -81,7 +73,6 @@ skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' #
[test_getUserMedia_playVideoAudioTwice.html]
[test_getUserMedia_playVideoTwice.html]
[test_getUserMedia_spinEventLoop.html]
skip-if = (toolkit == 'gonk' || buildapp == 'mulet' && debug) # copied from basicAudio
[test_getUserMedia_stopAudioStream.html]
[test_getUserMedia_stopAudioStreamWithFollowupAudio.html]
[test_getUserMedia_stopVideoAudioStream.html]
@ -90,206 +81,173 @@ skip-if = (toolkit == 'gonk' || buildapp == 'mulet' && debug) # copied from basi
[test_getUserMedia_stopVideoStreamWithFollowupVideo.html]
[test_getUserMedia_trackEnded.html]
[test_getUserMedia_peerIdentity.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' # b2g(Bug 1021776, too --ing slow on b2g)
[test_peerConnection_addIceCandidate.html]
[test_peerConnection_addtrack_removetrack_events.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_basicAudio.html]
skip-if = toolkit == 'gonk' # B2G emulator is too slow to handle a two-way audio call reliably
[test_peerConnection_basicAudioNATSrflx.html]
skip-if = toolkit == 'gonk' || toolkit == 'android' # B2G emulator is too slow to handle a two-way audio call reliably, websockets don't work on android (bug 1266217)
skip-if = toolkit == 'android' # websockets don't work on android (bug 1266217)
[test_peerConnection_basicAudioNATRelay.html]
skip-if = toolkit == 'gonk' || toolkit == 'android' # B2G emulator is too slow to handle a two-way audio call reliably, websockets don't work on android (bug 1266217)
skip-if = toolkit == 'android' # websockets don't work on android (bug 1266217)
[test_peerConnection_basicAudioNATRelayTCP.html]
skip-if = toolkit == 'gonk' || toolkit == 'android' # B2G emulator is too slow to handle a two-way audio call reliably, websockets don't work on android (bug 1266217)
skip-if = toolkit == 'android' # websockets don't work on android (bug 1266217)
[test_peerConnection_basicAudioRequireEOC.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' # b2g (Bug 1059867)
[test_peerConnection_basicAudioPcmaPcmuOnly.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' # b2g (Bug 1059867)
skip-if = android_version == '18' # b2g (Bug 1059867)
[test_peerConnection_basicAudioDynamicPtMissingRtpmap.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' # b2g (Bug 1059867)
[test_peerConnection_basicAudioVideo.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' && debug) # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_basicAudioVideoCombined.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' && debug) # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_basicAudioVideoNoBundle.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' && debug) # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_basicAudioVideoNoBundleNoRtcpMux.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_basicAudioVideoNoRtcpMux.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_basicVideo.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' && debug) # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_basicScreenshare.html]
# no screenshare on b2g/android
# frequent timeouts/crashes on e10s (bug 1048455)
skip-if = buildapp == 'b2g' || buildapp == 'mulet' || toolkit == 'android' # Bug 1141029 Mulet parity with B2G Desktop for TC
skip-if = toolkit == 'android' # no screenshare on android
[test_peerConnection_basicWindowshare.html]
# no screenshare on b2g/android
# frequent timeouts/crashes on e10s (bug 1048455)
skip-if = buildapp == 'b2g' || buildapp == 'mulet' || toolkit == 'android' # Bug 1141029 Mulet parity with B2G Desktop for TC
skip-if = toolkit == 'android' # no screenshare on android
[test_peerConnection_basicH264Video.html]
skip-if = buildapp == 'b2g' || buildapp == 'mulet' || os == 'android' # bug 1043403 # Bug 1141029 Mulet parity with B2G Desktop for TC
skip-if = os == 'android' # bug 1043403
[test_peerConnection_bug822674.html]
[test_peerConnection_bug825703.html]
[test_peerConnection_bug827843.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' # b2g(Bug 960442, video support for WebRTC is disabled on b2g)
[test_peerConnection_bug834153.html]
[test_peerConnection_bug1013809.html]
skip-if = toolkit == 'gonk' # B2G emulator is too slow to handle a two-way audio call reliably
[test_peerConnection_bug1042791.html]
skip-if = buildapp == 'b2g' || buildapp == 'mulet' || os == 'android' # bug 1043403 # Bug 1141029 Mulet parity with B2G Desktop for TC
skip-if = os == 'android' # bug 1043403
[test_peerConnection_bug1064223.html]
[test_peerConnection_capturedVideo.html]
tags=capturestream
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_captureStream_canvas_2d.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' && debug) # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_multiple_captureStream_canvas_2d.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' && debug) # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_captureStream_canvas_webgl.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' # b2g(Bug 960442, video support for WebRTC is disabled on b2g)
# [test_peerConnection_certificates.html] # bug 1180968
# skip-if = toolkit == 'gonk' || buildapp == 'mulet' # b2g (Bug 1059867)
[test_peerConnection_close.html]
[test_peerConnection_closeDuringIce.html]
[test_peerConnection_constructedStream.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_errorCallbacks.html]
[test_peerConnection_iceFailure.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || os == 'linux' || os == 'mac' || os == 'win' || android_version == '18' # Disabling because of test failures on B2G emulator (Bug 1180388 for win, mac and linux), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = os == 'linux' || os == 'mac' || os == 'win' || android_version == '18' # (Bug 1180388 for win, mac and linux), android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_forwarding_basicAudioVideoCombined.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_noTrickleAnswer.html]
skip-if = toolkit == 'gonk' # B2G emulator is too slow to handle a two-way audio call reliably
[test_peerConnection_noTrickleOffer.html]
skip-if = toolkit == 'gonk' # B2G emulator is too slow to handle a two-way audio call reliably
[test_peerConnection_noTrickleOfferAnswer.html]
skip-if = toolkit == 'gonk' # B2G emulator is too slow to handle a two-way audio call reliably
[test_peerConnection_offerRequiresReceiveAudio.html]
[test_peerConnection_offerRequiresReceiveVideo.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' # b2g(Bug 960442, video support for WebRTC is disabled on b2g)
[test_peerConnection_offerRequiresReceiveVideoAudio.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' && debug) # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_promiseSendOnly.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' && debug) # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_renderAfterRenegotiation.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' && debug) # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_restartIce.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version # b2g (Bug 1059867)
skip-if = android_version
[test_peerConnection_restartIceNoBundle.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version # b2g (Bug 1059867)
skip-if = android_version
[test_peerConnection_restartIceNoBundleNoRtcpMux.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version # b2g (Bug 1059867)
skip-if = android_version
[test_peerConnection_restartIceNoRtcpMux.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version # b2g (Bug 1059867)
skip-if = android_version
[test_peerConnection_restartIceLocalRollback.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version # b2g (Bug 1059867)
skip-if = android_version
[test_peerConnection_restartIceLocalAndRemoteRollback.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version # b2g (Bug 1059867)
skip-if = android_version
[test_peerConnection_scaleResolution.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18') # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_simulcastOffer.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version # b2g(Bug 960442, video support for WebRTC is disabled on b2g), no simulcast support on android
skip-if = android_version # no simulcast support on android
#[test_peerConnection_relayOnly.html]
#skip-if = toolkit == 'gonk' || buildapp == 'mulet' # b2g(Bug 960442, video support for WebRTC is disabled on b2g)
[test_peerConnection_callbacks.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' && debug) # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_replaceTrack.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_syncSetDescription.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_setLocalAnswerInHaveLocalOffer.html]
[test_peerConnection_setLocalAnswerInStable.html]
[test_peerConnection_setLocalOfferInHaveRemoteOffer.html]
[test_peerConnection_setParameters.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18') # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = (android_version == '18') # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_setRemoteAnswerInHaveRemoteOffer.html]
[test_peerConnection_setRemoteAnswerInStable.html]
[test_peerConnection_setRemoteOfferInHaveLocalOffer.html]
[test_peerConnection_throwInCallbacks.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' # b2g(Bug 960442, video support for WebRTC is disabled on b2g)
[test_peerConnection_toJSON.html]
[test_peerConnection_trackDisabling_clones.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_trackDisabling.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_twoAudioStreams.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' && debug) # b2g (Bug 1059867), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_twoAudioTracksInOneStream.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' && debug) # b2g (Bug 1059867), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_twoAudioVideoStreams.html]
# b2g(Bug 960442, video support for WebRTC is disabled on b2g), Bug 1171255 for Linux debug e10s, android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (os == 'linux' && debug && e10s) || android_version == '18'
skip-if = (os == 'linux' && debug && e10s) || android_version == '18' # Bug 1171255 for Linux debug e10s, android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_twoAudioVideoStreamsCombined.html]
# b2g(Bug 960442, video support for WebRTC is disabled on b2g), Bug 1127828 for Linux debug e10s, android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (os == 'linux' && debug && e10s) || android_version == '18'
skip-if = (os == 'linux' && debug && e10s) || android_version == '18' # Bug 1127828 for Linux debug e10s, android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_twoVideoStreams.html]
# b2g(Bug 960442, video support for WebRTC is disabled on b2g), Bug 1180000 for Linux debug e10s, android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18'
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_twoVideoTracksInOneStream.html]
# b2g(Bug 960442, video support for WebRTC is disabled on b2g), Bug 1180000 for Linux debug e10s, android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || os == "android"
skip-if = os == "android" # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_addAudioTrackToExistingVideoStream.html]
# B2G emulator is too slow to finish a renegotiation test in under 5 minutes, android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = toolkit == 'gonk' || (android_version == '18' && debug)
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_addSecondAudioStream.html]
skip-if = toolkit == 'gonk' || (android_version == '18' && debug) # emulator is too slow to finish a renegotiation test in under 5 minutes
skip-if = (android_version == '18' && debug) # emulator is too slow to finish a renegotiation test in under 5 minutes
[test_peerConnection_answererAddSecondAudioStream.html]
skip-if = toolkit == 'gonk' || (android_version == '18' && debug) # emulator is too slow to finish a renegotiation test in under 5 minutes
skip-if = (android_version == '18' && debug) # emulator is too slow to finish a renegotiation test in under 5 minutes
[test_peerConnection_removeAudioTrack.html]
skip-if = toolkit == 'gonk' || (android_version == '18' && debug) # emulator is too slow to finish a renegotiation test in under 5 minutes, android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_removeThenAddAudioTrack.html]
skip-if = toolkit == 'gonk' || (android_version == '18' && debug) # emulator is too slow to finish a renegotiation test in under 5 minutes, android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_addSecondVideoStream.html]
# B2G emulator is too slow to finish a renegotiation test in under 5 minutes, Bug 1180000 for Linux debug e10s, android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = toolkit == 'gonk' || android_version == '18'
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_removeVideoTrack.html]
# B2G emulator is too slow to finish a renegotiation test in under 5 minutes, Bug 1180000 for Linux debug e10s, android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = toolkit == 'gonk' || (android_version == '18' && debug)
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_removeThenAddVideoTrack.html]
# B2G emulator is too slow to finish a renegotiation test in under 5 minutes, Bug 1180000 for Linux debug e10s, android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = toolkit == 'gonk' || (android_version == '18' && debug)
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_replaceVideoThenRenegotiate.html]
# B2G emulator is too slow to finish a renegotiation test in under 5 minutes, Bug 1180000 for Linux debug e10s, android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = toolkit == 'gonk' || (android_version == '18' && debug)
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_addSecondAudioStreamNoBundle.html]
skip-if = toolkit == 'gonk' || (android_version == '18' && debug) # B2G emulator is too slow to finish a renegotiation test in under 5 minutes, android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_removeThenAddAudioTrackNoBundle.html]
skip-if = toolkit == 'gonk' || (android_version == '18' && debug) # B2G emulator is too slow to finish a renegotiation test in under 5 minutes, android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_addSecondVideoStreamNoBundle.html]
# B2G emulator is too slow to finish a renegotiation test in under 5 minutes, Bug 1180000 for Linux debug e10s, android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = toolkit == 'gonk' || android_version == '18'
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_removeThenAddVideoTrackNoBundle.html]
# B2G emulator is too slow to finish a renegotiation test in under 5 minutes, Bug 1180000 for Linux debug e10s, android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = toolkit == 'gonk' || android_version == '18'
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_addDataChannel.html]
skip-if = toolkit == 'gonk' || (android_version == '18' && debug) # emulator seems to be so slow that DTLS cannot establish properly, android(bug 1240256, intermittent ICE failures starting w/bug 1232082, possibly from timeout)
skip-if = (android_version == '18' && debug) # android(bug 1240256, intermittent ICE failures starting w/bug 1232082, possibly from timeout)
[test_peerConnection_addDataChannelNoBundle.html]
# b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = toolkit == 'gonk' || (android_version == '18' && debug) # b2g(emulator seems to be so slow that DTLS cannot establish properly), android(bug 1240256, intermittent ICE failures starting w/bug 1232082, possibly from timeout)
skip-if = (android_version == '18' && debug) # android(bug 1240256, intermittent ICE failures starting w/bug 1232082, possibly from timeout) android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_verifyAudioAfterRenegotiation.html]
skip-if = toolkit == 'gonk' || android_version == '18' # B2G emulator is too slow to finish a renegotiation test in under 5 minutes, android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_verifyVideoAfterRenegotiation.html]
# B2G emulator is too slow to finish a renegotiation test in under 5 minutes, Bug 1180000 for Linux debug e10s, android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = toolkit == 'gonk' || android_version == '18'
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_audioRenegotiationInactiveAnswer.html]
# B2G emulator is too slow to finish a renegotiation test in under 5 minutes, Bug 1180000 for Linux debug e10s, android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = toolkit == 'gonk' || android_version == '18'
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_videoRenegotiationInactiveAnswer.html]
# B2G emulator is too slow to finish a renegotiation test in under 5 minutes, Bug 1180000 for Linux debug e10s, android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = toolkit == 'gonk' || android_version == '18'
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_webAudio.html]
tags = webaudio webrtc
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' # b2g (Bug 1059867), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_localRollback.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' # b2g (Bug 1059867)
[test_peerConnection_localReofferRollback.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' # b2g (Bug 1059867)
[test_peerConnection_remoteRollback.html]
skip-if = toolkit == 'gonk' || (android_version == '18' && debug) # b2g (Bug 1059867), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_remoteReofferRollback.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' && debug) # b2g (Bug 1059867), android(Bug 1189784, timeouts on 4.3 emulator)
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_selftest.html]
# Bug 1227781: Crash with bogus TURN server.
[test_peerConnection_bug1227781.html]

Просмотреть файл

@ -12,10 +12,7 @@ function tearDown()
add_task(function*()
{
// Don't cache removed tabs, so "clear console cache on tab close" triggers.
Services.prefs.setIntPref("browser.tabs.max_tabs_undo", 0);
registerCleanupFunction(function() {
Services.prefs.clearUserPref("browser.tabs.max_tabs_undo");
});
yield SpecialPowers.pushPrefEnv({ set: [[ "browser.tabs.max_tabs_undo", 0 ]] });
registerCleanupFunction(tearDown);
@ -28,12 +25,12 @@ add_task(function*()
gBrowser.selectedTab = tab;
var browser = gBrowser.selectedBrowser;
let observerPromise = ContentTask.spawn(browser, null, function(opt) {
let observerPromise = ContentTask.spawn(browser, null, function* (opt) {
const TEST_URI = "http://example.com/browser/dom/tests/browser/test-console-api.html";
let ConsoleAPIStorage = Cc["@mozilla.org/consoleAPI-storage;1"]
.getService(Ci.nsIConsoleAPIStorage);
return new Promise(resolve => {
let observerPromise = new Promise(resolve => {
let apiCallCount = 0;
let ConsoleObserver = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
@ -46,9 +43,9 @@ add_task(function*()
.getInterface(Ci.nsIDOMWindowUtils).currentInnerWindowID;
Services.obs.removeObserver(this, "console-storage-cache-event");
Assert.ok(ConsoleAPIStorage.getEvents(windowId).length >= 4, "Some messages found in the storage service");
ok(ConsoleAPIStorage.getEvents(windowId).length >= 4, "Some messages found in the storage service");
ConsoleAPIStorage.clearEvents();
Assert.equal(ConsoleAPIStorage.getEvents(windowId).length, 0, "Cleared Storage");
is(ConsoleAPIStorage.getEvents(windowId).length, 0, "Cleared Storage");
resolve(windowId);
}
@ -61,24 +58,23 @@ add_task(function*()
// Redirect the browser to the test URI
content.window.location = TEST_URI;
});
yield ContentTaskUtils.waitForEvent(this, "DOMContentLoaded");
content.console.log("this", "is", "a", "log message");
content.console.info("this", "is", "a", "info message");
content.console.warn("this", "is", "a", "warn message");
content.console.error("this", "is", "a", "error message");
return observerPromise;
});
let win;
browser.addEventListener("DOMContentLoaded", function onLoad(event) {
browser.removeEventListener("DOMContentLoaded", onLoad, false);
executeSoon(function test_executeSoon() {
win = browser.contentWindow;
win.console.log("this", "is", "a", "log message");
win.console.info("this", "is", "a", "info message");
win.console.warn("this", "is", "a", "warn message");
win.console.error("this", "is", "a", "error message");
});
}, false);
let windowId = yield observerPromise;
// make sure a closed window's events are in fact removed from
// the storage cache
win.console.log("adding a new event");
yield ContentTask.spawn(browser, null, function() {
// make sure a closed window's events are in fact removed from
// the storage cache
content.console.log("adding a new event");
});
// Close the window.
gBrowser.removeTab(tab, {animate: false});
@ -89,16 +85,14 @@ add_task(function*()
gBrowser.selectedTab = keepaliveTab;
browser = gBrowser.selectedBrowser;
// Ensure the "inner-window-destroyed" event is processed,
// so the storage cache is cleared. We do this in the content
// process because that is where the event will be processed.
yield ContentTask.spawn(browser, null, function() {
yield new Promise(resolve => setTimeout(resolve, 0));
// Spin the event loop to make sure everything is cleared.
yield ContentTask.spawn(browser, null, function () {
return Promise.resolve();
});
yield ContentTask.spawn(browser, windowId, function(windowId) {
var ConsoleAPIStorage = Cc["@mozilla.org/consoleAPI-storage;1"]
.getService(Ci.nsIConsoleAPIStorage);
Assert.equal(ConsoleAPIStorage.getEvents(windowId).length, 0, "tab close is clearing the cache");
is(ConsoleAPIStorage.getEvents(windowId).length, 0, "tab close is clearing the cache");
});
});

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше