Merge m-c to inbound. a=merge
|
@ -7786,5 +7786,10 @@ let AboutPrivateBrowsingListener = {
|
||||||
msg => {
|
msg => {
|
||||||
OpenBrowserWindow({private: true});
|
OpenBrowserWindow({private: true});
|
||||||
});
|
});
|
||||||
|
window.messageManager.addMessageListener(
|
||||||
|
"AboutPrivateBrowsing:EnableTrackingProtection",
|
||||||
|
msg => {
|
||||||
|
Services.prefs.setBoolPref("privacy.trackingprotection.pbmode.enabled", true);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -268,6 +268,8 @@ let AboutPrivateBrowsingListener = {
|
||||||
init(chromeGlobal) {
|
init(chromeGlobal) {
|
||||||
chromeGlobal.addEventListener("AboutPrivateBrowsingOpenWindow", this,
|
chromeGlobal.addEventListener("AboutPrivateBrowsingOpenWindow", this,
|
||||||
false, true);
|
false, true);
|
||||||
|
chromeGlobal.addEventListener("AboutPrivateBrowsingEnableTrackingProtection", this,
|
||||||
|
false, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
get isAboutPrivateBrowsing() {
|
get isAboutPrivateBrowsing() {
|
||||||
|
@ -282,6 +284,9 @@ let AboutPrivateBrowsingListener = {
|
||||||
case "AboutPrivateBrowsingOpenWindow":
|
case "AboutPrivateBrowsingOpenWindow":
|
||||||
sendAsyncMessage("AboutPrivateBrowsing:OpenPrivateWindow");
|
sendAsyncMessage("AboutPrivateBrowsing:OpenPrivateWindow");
|
||||||
break;
|
break;
|
||||||
|
case "AboutPrivateBrowsingEnableTrackingProtection":
|
||||||
|
sendAsyncMessage("AboutPrivateBrowsing:EnableTrackingProtection");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,8 +7,7 @@
|
||||||
hidden="true"
|
hidden="true"
|
||||||
onpopupshown="gIdentityHandler.onPopupShown(event);"
|
onpopupshown="gIdentityHandler.onPopupShown(event);"
|
||||||
onpopuphidden="gIdentityHandler.onPopupHidden(event);"
|
onpopuphidden="gIdentityHandler.onPopupHidden(event);"
|
||||||
orient="vertical"
|
orient="vertical">
|
||||||
level="top">
|
|
||||||
|
|
||||||
<broadcasterset>
|
<broadcasterset>
|
||||||
<broadcaster id="identity-popup-content-host" value=""/>
|
<broadcaster id="identity-popup-content-host" value=""/>
|
||||||
|
@ -60,7 +59,7 @@
|
||||||
<button id="tracking-action-unblock-private"
|
<button id="tracking-action-unblock-private"
|
||||||
label="&trackingProtection.unblockPrivate.label;"
|
label="&trackingProtection.unblockPrivate.label;"
|
||||||
class="identity-popup-button"
|
class="identity-popup-button"
|
||||||
accesskey="&trackingProtection.unblock.accesskey;"
|
accesskey="&trackingProtection.unblockPrivate.accesskey;"
|
||||||
oncommand="TrackingProtection.disableForCurrentPage();" />
|
oncommand="TrackingProtection.disableForCurrentPage();" />
|
||||||
<button id="tracking-action-block"
|
<button id="tracking-action-block"
|
||||||
label="&trackingProtection.block2.label;"
|
label="&trackingProtection.block2.label;"
|
||||||
|
|
|
@ -77,12 +77,15 @@
|
||||||
"react/prop-types": 2,
|
"react/prop-types": 2,
|
||||||
"react/self-closing-comp": 2,
|
"react/self-closing-comp": 2,
|
||||||
"react/wrap-multilines": 2,
|
"react/wrap-multilines": 2,
|
||||||
|
// We would probably want to go with a variant of never.
|
||||||
|
"react/jsx-curly-spacing": 0,
|
||||||
// Not worth it: React is defined globally
|
// Not worth it: React is defined globally
|
||||||
"react/jsx-uses-react": 0,
|
"react/jsx-uses-react": 0,
|
||||||
"react/react-in-jsx-scope": 0,
|
"react/react-in-jsx-scope": 0,
|
||||||
// These ones we don't want to ever enable
|
// These ones we don't want to ever enable
|
||||||
"react/display-name": 0,
|
"react/display-name": 0,
|
||||||
"react/jsx-boolean-value": 0,
|
"react/jsx-boolean-value": 0,
|
||||||
|
"react/no-danger": 0,
|
||||||
"react/no-multi-comp": 0
|
"react/no-multi-comp": 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -787,7 +787,6 @@ loop.roomViews = (function(mozL10n) {
|
||||||
),
|
),
|
||||||
React.createElement(sharedViews.chat.TextChatView, {
|
React.createElement(sharedViews.chat.TextChatView, {
|
||||||
dispatcher: this.props.dispatcher,
|
dispatcher: this.props.dispatcher,
|
||||||
showAlways: false,
|
|
||||||
showRoomName: false,
|
showRoomName: false,
|
||||||
useDesktopPaths: true})
|
useDesktopPaths: true})
|
||||||
)
|
)
|
||||||
|
|
|
@ -787,7 +787,6 @@ loop.roomViews = (function(mozL10n) {
|
||||||
</div>
|
</div>
|
||||||
<sharedViews.chat.TextChatView
|
<sharedViews.chat.TextChatView
|
||||||
dispatcher={this.props.dispatcher}
|
dispatcher={this.props.dispatcher}
|
||||||
showAlways={false}
|
|
||||||
showRoomName={false}
|
showRoomName={false}
|
||||||
useDesktopPaths={true} />
|
useDesktopPaths={true} />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1451,6 +1451,10 @@ html[dir="rtl"] .standalone .room-conversation-wrapper .room-inner-info-area {
|
||||||
min-height: 60px;
|
min-height: 60px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fx-embedded .text-chat-view > .text-chat-entries-empty {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.text-chat-box {
|
.text-chat-box {
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
max-height: 40px;
|
max-height: 40px;
|
||||||
|
|
|
@ -149,12 +149,13 @@ loop.shared.views.chat = (function(mozL10n) {
|
||||||
/* Keep track of the last printed timestamp. */
|
/* Keep track of the last printed timestamp. */
|
||||||
var lastTimestamp = 0;
|
var lastTimestamp = 0;
|
||||||
|
|
||||||
if (!this.props.messageList.length) {
|
var entriesClasses = React.addons.classSet({
|
||||||
return null;
|
"text-chat-entries": true,
|
||||||
}
|
"text-chat-entries-empty": !this.props.messageList.length
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
React.createElement("div", {className: "text-chat-entries"},
|
React.createElement("div", {className: entriesClasses},
|
||||||
React.createElement("div", {className: "text-chat-scroller"},
|
React.createElement("div", {className: "text-chat-scroller"},
|
||||||
|
|
||||||
this.props.messageList.map(function(entry, i) {
|
this.props.messageList.map(function(entry, i) {
|
||||||
|
@ -379,10 +380,6 @@ loop.shared.views.chat = (function(mozL10n) {
|
||||||
hasNonSpecialMessages = !!messageList.length;
|
hasNonSpecialMessages = !!messageList.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.state.textChatEnabled && !messageList.length) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
var textChatViewClasses = React.addons.classSet({
|
var textChatViewClasses = React.addons.classSet({
|
||||||
"text-chat-view": true,
|
"text-chat-view": true,
|
||||||
"text-chat-disabled": !this.state.textChatEnabled
|
"text-chat-disabled": !this.state.textChatEnabled
|
||||||
|
|
|
@ -149,12 +149,13 @@ loop.shared.views.chat = (function(mozL10n) {
|
||||||
/* Keep track of the last printed timestamp. */
|
/* Keep track of the last printed timestamp. */
|
||||||
var lastTimestamp = 0;
|
var lastTimestamp = 0;
|
||||||
|
|
||||||
if (!this.props.messageList.length) {
|
var entriesClasses = React.addons.classSet({
|
||||||
return null;
|
"text-chat-entries": true,
|
||||||
}
|
"text-chat-entries-empty": !this.props.messageList.length
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="text-chat-entries">
|
<div className={entriesClasses}>
|
||||||
<div className="text-chat-scroller">
|
<div className="text-chat-scroller">
|
||||||
{
|
{
|
||||||
this.props.messageList.map(function(entry, i) {
|
this.props.messageList.map(function(entry, i) {
|
||||||
|
@ -379,10 +380,6 @@ loop.shared.views.chat = (function(mozL10n) {
|
||||||
hasNonSpecialMessages = !!messageList.length;
|
hasNonSpecialMessages = !!messageList.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.state.textChatEnabled && !messageList.length) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
var textChatViewClasses = React.addons.classSet({
|
var textChatViewClasses = React.addons.classSet({
|
||||||
"text-chat-view": true,
|
"text-chat-view": true,
|
||||||
"text-chat-disabled": !this.state.textChatEnabled
|
"text-chat-disabled": !this.state.textChatEnabled
|
||||||
|
|
|
@ -29,8 +29,10 @@
|
||||||
|
|
||||||
// window.navigator.doNotTrack "yes" is for old versions of FF
|
// window.navigator.doNotTrack "yes" is for old versions of FF
|
||||||
// window.navigator.doNotTrack "1" is for current versions of FF + Chrome + Opera
|
// window.navigator.doNotTrack "1" is for current versions of FF + Chrome + Opera
|
||||||
// window.doNotTrack is safari
|
// window.doNotTrack is Safari + IE11
|
||||||
// window.navigator.msDoNotTrack
|
// window.navigator.msDoNotTrack for IE9 and IE10
|
||||||
|
// See also
|
||||||
|
// https://developer.mozilla.org/en-US/docs/Web/API/Navigator/doNotTrack#Browser_compatibility
|
||||||
if (window.navigator.doNotTrack !== "yes" &&
|
if (window.navigator.doNotTrack !== "yes" &&
|
||||||
window.navigator.doNotTrack !== "1" &&
|
window.navigator.doNotTrack !== "1" &&
|
||||||
window.doNotTrack !== "1" &&
|
window.doNotTrack !== "1" &&
|
||||||
|
|
|
@ -507,7 +507,6 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||||
),
|
),
|
||||||
React.createElement(sharedViews.chat.TextChatView, {
|
React.createElement(sharedViews.chat.TextChatView, {
|
||||||
dispatcher: this.props.dispatcher,
|
dispatcher: this.props.dispatcher,
|
||||||
showAlways: true,
|
|
||||||
showRoomName: true,
|
showRoomName: true,
|
||||||
useDesktopPaths: false}),
|
useDesktopPaths: false}),
|
||||||
React.createElement("div", {className: "local"},
|
React.createElement("div", {className: "local"},
|
||||||
|
|
|
@ -507,7 +507,6 @@ loop.standaloneRoomViews = (function(mozL10n) {
|
||||||
</div>
|
</div>
|
||||||
<sharedViews.chat.TextChatView
|
<sharedViews.chat.TextChatView
|
||||||
dispatcher={this.props.dispatcher}
|
dispatcher={this.props.dispatcher}
|
||||||
showAlways={true}
|
|
||||||
showRoomName={true}
|
showRoomName={true}
|
||||||
useDesktopPaths={false} />
|
useDesktopPaths={false} />
|
||||||
<div className="local">
|
<div className="local">
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "0.24.x",
|
"eslint": "0.24.x",
|
||||||
"eslint-plugin-react": "2.6.x",
|
"eslint-plugin-react": "2.7.x",
|
||||||
"express": "4.x"
|
"express": "4.x"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
@ -7,7 +7,7 @@ const HAWK_TOKEN_LENGTH = 64;
|
||||||
const {
|
const {
|
||||||
LOOP_SESSION_TYPE,
|
LOOP_SESSION_TYPE,
|
||||||
MozLoopServiceInternal,
|
MozLoopServiceInternal,
|
||||||
MozLoopService,
|
MozLoopService
|
||||||
} = Cu.import("resource:///modules/loop/MozLoopService.jsm", {});
|
} = Cu.import("resource:///modules/loop/MozLoopService.jsm", {});
|
||||||
const {LoopCalls} = Cu.import("resource:///modules/loop/LoopCalls.jsm", {});
|
const {LoopCalls} = Cu.import("resource:///modules/loop/LoopCalls.jsm", {});
|
||||||
const {LoopRooms} = Cu.import("resource:///modules/loop/LoopRooms.jsm", {});
|
const {LoopRooms} = Cu.import("resource:///modules/loop/LoopRooms.jsm", {});
|
||||||
|
|
|
@ -38,7 +38,7 @@ describe("loop.shared.views.TextChatView", function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("TextChatEntriesView", function() {
|
describe("TextChatEntriesView", function() {
|
||||||
var view;
|
var view, node;
|
||||||
|
|
||||||
function mountTestComponent(extraProps) {
|
function mountTestComponent(extraProps) {
|
||||||
var basicProps = {
|
var basicProps = {
|
||||||
|
@ -52,6 +52,31 @@ describe("loop.shared.views.TextChatView", function () {
|
||||||
_.extend(basicProps, extraProps)));
|
_.extend(basicProps, extraProps)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
beforeEach(function() {
|
||||||
|
store.setStoreState({ textChatEnabled: true });
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should add an empty class when the list is empty", function() {
|
||||||
|
view = mountTestComponent({
|
||||||
|
messageList: []
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(view.getDOMNode().classList.contains("text-chat-entries-empty")).eql(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should not add an empty class when the list is has items", function() {
|
||||||
|
view = mountTestComponent({
|
||||||
|
messageList: [{
|
||||||
|
type: CHAT_MESSAGE_TYPES.RECEIVED,
|
||||||
|
contentType: CHAT_CONTENT_TYPES.TEXT,
|
||||||
|
message: "Hello!",
|
||||||
|
receivedTimestamp: "2015-06-25T17:53:55.357Z"
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(view.getDOMNode().classList.contains("text-chat-entries-empty")).eql(false);
|
||||||
|
});
|
||||||
|
|
||||||
it("should render message entries when message were sent/ received", function() {
|
it("should render message entries when message were sent/ received", function() {
|
||||||
view = mountTestComponent({
|
view = mountTestComponent({
|
||||||
messageList: [{
|
messageList: [{
|
||||||
|
@ -67,7 +92,7 @@ describe("loop.shared.views.TextChatView", function () {
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
|
|
||||||
var node = view.getDOMNode();
|
node = view.getDOMNode();
|
||||||
expect(node).to.not.eql(null);
|
expect(node).to.not.eql(null);
|
||||||
|
|
||||||
var entries = node.querySelectorAll(".text-chat-entry");
|
var entries = node.querySelectorAll(".text-chat-entry");
|
||||||
|
@ -124,66 +149,6 @@ describe("loop.shared.views.TextChatView", function () {
|
||||||
|
|
||||||
sinon.assert.notCalled(view.play);
|
sinon.assert.notCalled(view.play);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
describe("TextChatEntry", function() {
|
|
||||||
var view;
|
|
||||||
|
|
||||||
function mountTestComponent(extraProps) {
|
|
||||||
var props = _.extend({
|
|
||||||
contentType: CHAT_CONTENT_TYPES.TEXT,
|
|
||||||
dispatcher: dispatcher,
|
|
||||||
message: "test",
|
|
||||||
type: CHAT_MESSAGE_TYPES.RECEIVED,
|
|
||||||
timestamp: "2015-06-23T22:48:39.738Z"
|
|
||||||
}, extraProps);
|
|
||||||
return TestUtils.renderIntoDocument(
|
|
||||||
React.createElement(loop.shared.views.chat.TextChatEntry, props));
|
|
||||||
}
|
|
||||||
|
|
||||||
it("should not render a timestamp", function() {
|
|
||||||
view = mountTestComponent({
|
|
||||||
showTimestamp: false,
|
|
||||||
timestamp: "2015-06-23T22:48:39.738Z",
|
|
||||||
type: CHAT_MESSAGE_TYPES.RECEIVED,
|
|
||||||
contentType: CHAT_CONTENT_TYPES.TEXT,
|
|
||||||
message: "foo"
|
|
||||||
});
|
|
||||||
var node = view.getDOMNode();
|
|
||||||
|
|
||||||
expect(node.querySelector(".text-chat-entry-timestamp")).to.eql(null);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should render a timestamp", function() {
|
|
||||||
view = mountTestComponent({
|
|
||||||
showTimestamp: true,
|
|
||||||
timestamp: "2015-06-23T22:48:39.738Z",
|
|
||||||
type: CHAT_MESSAGE_TYPES.RECEIVED,
|
|
||||||
contentType: CHAT_CONTENT_TYPES.TEXT,
|
|
||||||
message: "foo"
|
|
||||||
});
|
|
||||||
var node = view.getDOMNode();
|
|
||||||
|
|
||||||
expect(node.querySelector(".text-chat-entry-timestamp")).to.not.eql(null);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("TextChatEntriesView", function() {
|
|
||||||
var view, node;
|
|
||||||
|
|
||||||
function mountTestComponent(extraProps) {
|
|
||||||
var props = _.extend({
|
|
||||||
dispatcher: dispatcher,
|
|
||||||
messageList: [],
|
|
||||||
useDesktopPaths: false
|
|
||||||
}, extraProps);
|
|
||||||
return TestUtils.renderIntoDocument(
|
|
||||||
React.createElement(loop.shared.views.chat.TextChatEntriesView, props));
|
|
||||||
}
|
|
||||||
|
|
||||||
beforeEach(function() {
|
|
||||||
store.setStoreState({ textChatEnabled: true });
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should show timestamps if there are different senders", function() {
|
it("should show timestamps if there are different senders", function() {
|
||||||
view = mountTestComponent({
|
view = mountTestComponent({
|
||||||
|
@ -266,6 +231,48 @@ describe("loop.shared.views.TextChatView", function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("TextChatEntry", function() {
|
||||||
|
var view;
|
||||||
|
|
||||||
|
function mountTestComponent(extraProps) {
|
||||||
|
var props = _.extend({
|
||||||
|
contentType: CHAT_CONTENT_TYPES.TEXT,
|
||||||
|
dispatcher: dispatcher,
|
||||||
|
message: "test",
|
||||||
|
type: CHAT_MESSAGE_TYPES.RECEIVED,
|
||||||
|
timestamp: "2015-06-23T22:48:39.738Z"
|
||||||
|
}, extraProps);
|
||||||
|
return TestUtils.renderIntoDocument(
|
||||||
|
React.createElement(loop.shared.views.chat.TextChatEntry, props));
|
||||||
|
}
|
||||||
|
|
||||||
|
it("should not render a timestamp", function() {
|
||||||
|
view = mountTestComponent({
|
||||||
|
showTimestamp: false,
|
||||||
|
timestamp: "2015-06-23T22:48:39.738Z",
|
||||||
|
type: CHAT_MESSAGE_TYPES.RECEIVED,
|
||||||
|
contentType: CHAT_CONTENT_TYPES.TEXT,
|
||||||
|
message: "foo"
|
||||||
|
});
|
||||||
|
var node = view.getDOMNode();
|
||||||
|
|
||||||
|
expect(node.querySelector(".text-chat-entry-timestamp")).to.eql(null);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should render a timestamp", function() {
|
||||||
|
view = mountTestComponent({
|
||||||
|
showTimestamp: true,
|
||||||
|
timestamp: "2015-06-23T22:48:39.738Z",
|
||||||
|
type: CHAT_MESSAGE_TYPES.RECEIVED,
|
||||||
|
contentType: CHAT_CONTENT_TYPES.TEXT,
|
||||||
|
message: "foo"
|
||||||
|
});
|
||||||
|
var node = view.getDOMNode();
|
||||||
|
|
||||||
|
expect(node.querySelector(".text-chat-entry-timestamp")).to.not.eql(null);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("TextChatView", function() {
|
describe("TextChatView", function() {
|
||||||
var view, fakeServer;
|
var view, fakeServer;
|
||||||
|
|
||||||
|
@ -319,29 +326,12 @@ describe("loop.shared.views.TextChatView", function () {
|
||||||
.to.eql(2);
|
.to.eql(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should not display the view if no messages and text chat not enabled", function() {
|
|
||||||
store.setStoreState({ textChatEnabled: false });
|
|
||||||
|
|
||||||
view = mountTestComponent();
|
|
||||||
|
|
||||||
expect(view.getDOMNode()).eql(null);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should display the view if no messages and text chat is enabled", function() {
|
it("should display the view if no messages and text chat is enabled", function() {
|
||||||
view = mountTestComponent();
|
view = mountTestComponent();
|
||||||
|
|
||||||
expect(view.getDOMNode()).not.eql(null);
|
expect(view.getDOMNode()).not.eql(null);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should display only the text chat box if entry is enabled but there are no messages", function() {
|
|
||||||
view = mountTestComponent();
|
|
||||||
|
|
||||||
var node = view.getDOMNode();
|
|
||||||
|
|
||||||
expect(node.querySelector(".text-chat-box")).not.eql(null);
|
|
||||||
expect(node.querySelector(".text-chat-entries")).eql(null);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should render message entries when message were sent/ received", function() {
|
it("should render message entries when message were sent/ received", function() {
|
||||||
view = mountTestComponent();
|
view = mountTestComponent();
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,9 @@ body.tour {
|
||||||
body.normal .showPrivate,
|
body.normal .showPrivate,
|
||||||
body.private .showNormal,
|
body.private .showNormal,
|
||||||
body.tour #pageContainer,
|
body.tour #pageContainer,
|
||||||
body:not(.tour) .showTour {
|
body:not(.tour) .showTour,
|
||||||
|
body[tpEnabled] .showTpDisabled,
|
||||||
|
body:not([tpEnabled]) .showTpEnabled {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +66,7 @@ a {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
button {
|
#startPrivateBrowsing {
|
||||||
margin-top: 1.2em;
|
margin-top: 1.2em;
|
||||||
-moz-margin-start: 0;
|
-moz-margin-start: 0;
|
||||||
}
|
}
|
||||||
|
@ -126,6 +128,14 @@ button {
|
||||||
background-color: var(--in-content-primary-button-background-hover);
|
background-color: var(--in-content-primary-button-background-hover);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#tourTpDisabled {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#enableTrackingProtection {
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
#tourFooter {
|
#tourFooter {
|
||||||
margin: 16px auto;
|
margin: 16px auto;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
|
||||||
|
|
||||||
Cu.import("resource://gre/modules/Services.jsm");
|
Cu.import("resource://gre/modules/Services.jsm");
|
||||||
Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
|
Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
|
||||||
|
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||||
|
|
||||||
let stringBundle = Services.strings.createBundle(
|
let stringBundle = Services.strings.createBundle(
|
||||||
"chrome://browser/locale/aboutPrivateBrowsing.properties");
|
"chrome://browser/locale/aboutPrivateBrowsing.properties");
|
||||||
|
@ -25,6 +26,20 @@ if (!PrivateBrowsingUtils.isContentWindowPrivate(window)) {
|
||||||
setFavIcon("chrome://browser/skin/Privacy-16.png");
|
setFavIcon("chrome://browser/skin/Privacy-16.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let prefBranch = Services.prefs.getBranch("privacy.trackingprotection.pbmode.");
|
||||||
|
let prefObserver = {
|
||||||
|
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
|
||||||
|
Ci.nsISupportsWeakReference]),
|
||||||
|
observe: function () {
|
||||||
|
if (prefBranch.getBoolPref("enabled")) {
|
||||||
|
document.body.setAttribute("tpEnabled", "true");
|
||||||
|
} else {
|
||||||
|
document.body.removeAttribute("tpEnabled");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
prefBranch.addObserver("enabled", prefObserver, true);
|
||||||
|
|
||||||
function setFavIcon(url) {
|
function setFavIcon(url) {
|
||||||
let icon = document.createElement("link");
|
let icon = document.createElement("link");
|
||||||
icon.setAttribute("rel", "icon");
|
icon.setAttribute("rel", "icon");
|
||||||
|
@ -51,12 +66,15 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||||
let tourURL = formatURLPref("privacy.trackingprotection.introURL");
|
let tourURL = formatURLPref("privacy.trackingprotection.introURL");
|
||||||
document.getElementById("startTour").setAttribute("href", tourURL);
|
document.getElementById("startTour").setAttribute("href", tourURL);
|
||||||
document.getElementById("tourLearnMore").setAttribute("href", learnMoreURL);
|
document.getElementById("tourLearnMore").setAttribute("href", learnMoreURL);
|
||||||
|
// Update state that depends on preferences.
|
||||||
|
prefObserver.observe();
|
||||||
}
|
}
|
||||||
|
|
||||||
let startPrivateBrowsing = document.getElementById("startPrivateBrowsing");
|
document.getElementById("startPrivateBrowsing")
|
||||||
if (startPrivateBrowsing) {
|
.addEventListener("command", openPrivateWindow);
|
||||||
startPrivateBrowsing.addEventListener("command", openPrivateWindow);
|
|
||||||
}
|
document.getElementById("enableTrackingProtection")
|
||||||
|
.addEventListener("command", enableTrackingProtection);
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
function openPrivateWindow() {
|
function openPrivateWindow() {
|
||||||
|
@ -64,3 +82,10 @@ function openPrivateWindow() {
|
||||||
document.dispatchEvent(
|
document.dispatchEvent(
|
||||||
new CustomEvent("AboutPrivateBrowsingOpenWindow", {bubbles:true}));
|
new CustomEvent("AboutPrivateBrowsingOpenWindow", {bubbles:true}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function enableTrackingProtection() {
|
||||||
|
// Ask chrome to enable tracking protection
|
||||||
|
document.dispatchEvent(
|
||||||
|
new CustomEvent("AboutPrivateBrowsingEnableTrackingProtection",
|
||||||
|
{bubbles:true}));
|
||||||
|
}
|
||||||
|
|
|
@ -51,9 +51,15 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="tourBottom" class="showTour">
|
<div id="tourBottom" class="showTour">
|
||||||
<p id="tourDescription">&trackingProtection.description;</p>
|
<p id="tourDescription">&trackingProtection.description;</p>
|
||||||
<p><a id="startTour">&trackingProtection.startTour;</a></p>
|
<p class="showTpEnabled"><a id="startTour">&trackingProtection.startTour;</a></p>
|
||||||
<p><a id="showPreferences" href="about:preferences#privacy"
|
<p class="showTpEnabled"><a id="showPreferences" href="about:preferences#privacy"
|
||||||
target="_blank">&trackingProtection.showPreferences;</a></p>
|
target="_blank">&trackingProtection.showPreferences;</a></p>
|
||||||
|
<p id="tourTpDisabled" class="showTpDisabled"><span>&trackingProtection.disabled;</span></p>
|
||||||
|
<button xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||||
|
id="enableTrackingProtection"
|
||||||
|
class="primary showTpDisabled"
|
||||||
|
label="&trackingProtection.enable.label;"
|
||||||
|
accesskey="&trackingProtection.enable.accesskey;"/>
|
||||||
</div>
|
</div>
|
||||||
<p id="tourFooter" class="showTour">
|
<p id="tourFooter" class="showTour">
|
||||||
<span id="tourFooterText">&aboutPrivateBrowsing.shortdescription;</span>
|
<span id="tourFooterText">&aboutPrivateBrowsing.shortdescription;</span>
|
||||||
|
|
|
@ -97,3 +97,43 @@ add_task(function* test_tourActions() {
|
||||||
|
|
||||||
yield BrowserTestUtils.closeWindow(win);
|
yield BrowserTestUtils.closeWindow(win);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests the action to re-enable Tracking Protection in "about:privatebrowsing"
|
||||||
|
* when it has been disabled from the preferences.
|
||||||
|
*/
|
||||||
|
add_task(function* test_enableTrackingProtection() {
|
||||||
|
// Use tour version but disable Tracking Protection.
|
||||||
|
Services.prefs.setBoolPref("privacy.trackingprotection.ui.enabled", true);
|
||||||
|
Services.prefs.setBoolPref("privacy.trackingprotection.pbmode.enabled",
|
||||||
|
false);
|
||||||
|
registerCleanupFunction(function () {
|
||||||
|
Services.prefs.clearUserPref("privacy.trackingprotection.pbmode.enabled");
|
||||||
|
Services.prefs.clearUserPref("privacy.trackingprotection.ui.enabled");
|
||||||
|
});
|
||||||
|
|
||||||
|
let { win, tab } = yield openAboutPrivateBrowsing();
|
||||||
|
|
||||||
|
// Set up the observer for the preference change before triggering the action.
|
||||||
|
let prefBranch =
|
||||||
|
Services.prefs.getBranch("privacy.trackingprotection.pbmode.");
|
||||||
|
let promisePrefChanged = new Promise(resolve => {
|
||||||
|
let prefObserver = {
|
||||||
|
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
|
||||||
|
observe: function () {
|
||||||
|
prefBranch.removeObserver("enabled", prefObserver);
|
||||||
|
resolve();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
prefBranch.addObserver("enabled", prefObserver, false);
|
||||||
|
});
|
||||||
|
|
||||||
|
yield ContentTask.spawn(tab, {}, function* () {
|
||||||
|
content.document.getElementById("enableTrackingProtection").click();
|
||||||
|
});
|
||||||
|
|
||||||
|
yield promisePrefChanged;
|
||||||
|
ok(prefBranch.getBoolPref("enabled"), "Tracking Protection is enabled.");
|
||||||
|
|
||||||
|
yield BrowserTestUtils.closeWindow(win);
|
||||||
|
});
|
||||||
|
|
|
@ -28,6 +28,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "BrowserUITelemetry",
|
||||||
"resource:///modules/BrowserUITelemetry.jsm");
|
"resource:///modules/BrowserUITelemetry.jsm");
|
||||||
XPCOMUtils.defineLazyModuleGetter(this, "Metrics",
|
XPCOMUtils.defineLazyModuleGetter(this, "Metrics",
|
||||||
"resource://gre/modules/Metrics.jsm");
|
"resource://gre/modules/Metrics.jsm");
|
||||||
|
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
|
||||||
|
"resource://gre/modules/PrivateBrowsingUtils.jsm");
|
||||||
XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode",
|
XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode",
|
||||||
"resource://gre/modules/ReaderMode.jsm");
|
"resource://gre/modules/ReaderMode.jsm");
|
||||||
XPCOMUtils.defineLazyModuleGetter(this, "ReaderParent",
|
XPCOMUtils.defineLazyModuleGetter(this, "ReaderParent",
|
||||||
|
@ -120,6 +122,20 @@ this.UITour = {
|
||||||
widgetName: "urlbar-container",
|
widgetName: "urlbar-container",
|
||||||
}],
|
}],
|
||||||
["bookmarks", {query: "#bookmarks-menu-button"}],
|
["bookmarks", {query: "#bookmarks-menu-button"}],
|
||||||
|
["controlCenter-trackingUnblock", {
|
||||||
|
infoPanelPosition: "rightcenter topleft",
|
||||||
|
query(aDocument) {
|
||||||
|
let popup = aDocument.defaultView.gIdentityHandler._identityPopup;
|
||||||
|
if (popup.state != "open") {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
let buttonId =
|
||||||
|
PrivateBrowsingUtils.isWindowPrivate(aDocument.defaultView) ?
|
||||||
|
"tracking-action-unblock-private" : "tracking-action-unblock";
|
||||||
|
let element = aDocument.getElementById(buttonId);
|
||||||
|
return UITour.isElementVisible(element) ? element : null;
|
||||||
|
},
|
||||||
|
}],
|
||||||
["customize", {
|
["customize", {
|
||||||
query: (aDocument) => {
|
query: (aDocument) => {
|
||||||
let customizeButton = aDocument.getElementById("PanelUI-customize");
|
let customizeButton = aDocument.getElementById("PanelUI-customize");
|
||||||
|
@ -1725,7 +1741,7 @@ this.UITour = {
|
||||||
onPanelHidden: function(aEvent) {
|
onPanelHidden: function(aEvent) {
|
||||||
aEvent.target.removeAttribute("noautohide");
|
aEvent.target.removeAttribute("noautohide");
|
||||||
UITour.recreatePopup(aEvent.target);
|
UITour.recreatePopup(aEvent.target);
|
||||||
this.availableTargetsCache.clear();
|
UITour.availableTargetsCache.clear();
|
||||||
},
|
},
|
||||||
|
|
||||||
recreatePopup: function(aPanel) {
|
recreatePopup: function(aPanel) {
|
||||||
|
|
|
@ -15,6 +15,9 @@ skip-if = true # Bug 1113038 - Intermittent "Popup was opened"
|
||||||
[browser_trackingProtection.js]
|
[browser_trackingProtection.js]
|
||||||
skip-if = os == "linux" # Intermittent NS_ERROR_NOT_AVAILABLE [nsIUrlClassifierDBService.beginUpdate]
|
skip-if = os == "linux" # Intermittent NS_ERROR_NOT_AVAILABLE [nsIUrlClassifierDBService.beginUpdate]
|
||||||
tag = trackingprotection
|
tag = trackingprotection
|
||||||
|
[browser_trackingProtection_tour.js]
|
||||||
|
skip-if = e10s # Bug 1073247 - UITour tests not e10s friendly
|
||||||
|
tag = trackingprotection
|
||||||
[browser_showMenu_controlCenter.js]
|
[browser_showMenu_controlCenter.js]
|
||||||
skip-if = e10s # Bug 1073247 - UITour tests not e10s friendly
|
skip-if = e10s # Bug 1073247 - UITour tests not e10s friendly
|
||||||
tag = trackingprotection
|
tag = trackingprotection
|
||||||
|
|
|
@ -28,7 +28,7 @@ let tests = [
|
||||||
function test_testing_host(done) {
|
function test_testing_host(done) {
|
||||||
// Add two testing origins intentionally surrounded by whitespace to be ignored.
|
// Add two testing origins intentionally surrounded by whitespace to be ignored.
|
||||||
Services.prefs.setCharPref("browser.uitour.testingOrigins",
|
Services.prefs.setCharPref("browser.uitour.testingOrigins",
|
||||||
"https://test1.example.com, https://test2.example.com:443 ");
|
"https://test1.example.org, https://test2.example.org:443 ");
|
||||||
|
|
||||||
registerCleanupFunction(() => {
|
registerCleanupFunction(() => {
|
||||||
Services.prefs.clearUserPref("browser.uitour.testingOrigins");
|
Services.prefs.clearUserPref("browser.uitour.testingOrigins");
|
||||||
|
@ -40,7 +40,7 @@ let tests = [
|
||||||
|
|
||||||
loadUITourTestPage(function() {
|
loadUITourTestPage(function() {
|
||||||
gContentAPI.getConfiguration("appinfo", callback);
|
gContentAPI.getConfiguration("appinfo", callback);
|
||||||
}, "https://test2.example.com/");
|
}, "https://test2.example.org/");
|
||||||
},
|
},
|
||||||
function test_unsecure_host(done) {
|
function test_unsecure_host(done) {
|
||||||
loadUITourTestPage(function() {
|
loadUITourTestPage(function() {
|
||||||
|
@ -51,7 +51,7 @@ let tests = [
|
||||||
is(bookmarksMenu.open, false, "Bookmark menu should not open on a unsecure host");
|
is(bookmarksMenu.open, false, "Bookmark menu should not open on a unsecure host");
|
||||||
|
|
||||||
done();
|
done();
|
||||||
}, "http://example.com/");
|
}, "http://example.org/");
|
||||||
},
|
},
|
||||||
function test_unsecure_host_override(done) {
|
function test_unsecure_host_override(done) {
|
||||||
Services.prefs.setBoolPref("browser.uitour.requireSecure", false);
|
Services.prefs.setBoolPref("browser.uitour.requireSecure", false);
|
||||||
|
@ -63,7 +63,7 @@ let tests = [
|
||||||
waitForElementToBeVisible(highlight, done, "Highlight should be shown on a unsecure host when override pref is set");
|
waitForElementToBeVisible(highlight, done, "Highlight should be shown on a unsecure host when override pref is set");
|
||||||
|
|
||||||
Services.prefs.setBoolPref("browser.uitour.requireSecure", true);
|
Services.prefs.setBoolPref("browser.uitour.requireSecure", true);
|
||||||
}, "http://example.com/");
|
}, "http://example.org/");
|
||||||
},
|
},
|
||||||
function test_disabled(done) {
|
function test_disabled(done) {
|
||||||
Services.prefs.setBoolPref("browser.uitour.enabled", false);
|
Services.prefs.setBoolPref("browser.uitour.enabled", false);
|
||||||
|
|
|
@ -31,7 +31,7 @@ let tests = [
|
||||||
is(desc.textContent, "some text", "Popup should have correct description text");
|
is(desc.textContent, "some text", "Popup should have correct description text");
|
||||||
|
|
||||||
let imageURL = getRootDirectory(gTestPath) + "image.png";
|
let imageURL = getRootDirectory(gTestPath) + "image.png";
|
||||||
imageURL = imageURL.replace("chrome://mochitests/content/", "https://example.com/");
|
imageURL = imageURL.replace("chrome://mochitests/content/", "https://example.org/");
|
||||||
is(icon.src, imageURL, "Popup should have correct icon shown");
|
is(icon.src, imageURL, "Popup should have correct icon shown");
|
||||||
|
|
||||||
is(buttons.hasChildNodes(), false, "Popup should have no buttons");
|
is(buttons.hasChildNodes(), false, "Popup should have no buttons");
|
||||||
|
@ -51,7 +51,7 @@ let tests = [
|
||||||
is(desc.textContent, "moar text", "Popup should have correct description text");
|
is(desc.textContent, "moar text", "Popup should have correct description text");
|
||||||
|
|
||||||
let imageURL = getRootDirectory(gTestPath) + "image.png";
|
let imageURL = getRootDirectory(gTestPath) + "image.png";
|
||||||
imageURL = imageURL.replace("chrome://mochitests/content/", "https://example.com/");
|
imageURL = imageURL.replace("chrome://mochitests/content/", "https://example.org/");
|
||||||
is(icon.src, imageURL, "Popup should have correct icon shown");
|
is(icon.src, imageURL, "Popup should have correct icon shown");
|
||||||
|
|
||||||
buttons = document.getElementById("UITourTooltipButtons");
|
buttons = document.getElementById("UITourTooltipButtons");
|
||||||
|
@ -101,7 +101,7 @@ let tests = [
|
||||||
is(desc.textContent, "moar text", "Popup should have correct description text");
|
is(desc.textContent, "moar text", "Popup should have correct description text");
|
||||||
|
|
||||||
let imageURL = getRootDirectory(gTestPath) + "image.png";
|
let imageURL = getRootDirectory(gTestPath) + "image.png";
|
||||||
imageURL = imageURL.replace("chrome://mochitests/content/", "https://example.com/");
|
imageURL = imageURL.replace("chrome://mochitests/content/", "https://example.org/");
|
||||||
is(icon.src, imageURL, "Popup should have correct icon shown");
|
is(icon.src, imageURL, "Popup should have correct icon shown");
|
||||||
|
|
||||||
buttons = document.getElementById("UITourTooltipButtons");
|
buttons = document.getElementById("UITourTooltipButtons");
|
||||||
|
|
|
@ -0,0 +1,68 @@
|
||||||
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
let gTestTab;
|
||||||
|
let gContentAPI;
|
||||||
|
let gContentWindow;
|
||||||
|
|
||||||
|
const { UrlClassifierTestUtils } = Cu.import("resource://testing-common/UrlClassifierTestUtils.jsm", {});
|
||||||
|
|
||||||
|
const TP_ENABLED_PREF = "privacy.trackingprotection.enabled";
|
||||||
|
|
||||||
|
function test() {
|
||||||
|
UITourTest();
|
||||||
|
}
|
||||||
|
|
||||||
|
let tests = [
|
||||||
|
taskify(function* test_setup() {
|
||||||
|
Services.prefs.setBoolPref("privacy.trackingprotection.enabled", true);
|
||||||
|
yield UrlClassifierTestUtils.addTestTrackers();
|
||||||
|
|
||||||
|
registerCleanupFunction(function() {
|
||||||
|
UrlClassifierTestUtils.cleanupTestTrackers();
|
||||||
|
Services.prefs.clearUserPref("privacy.trackingprotection.enabled");
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
taskify(function* test_unblock_target() {
|
||||||
|
let popup = document.getElementById("UITourTooltip");
|
||||||
|
|
||||||
|
yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function () {
|
||||||
|
let doc = content.document;
|
||||||
|
let iframe = doc.createElement("iframe");
|
||||||
|
iframe.setAttribute("id", "tracking-element");
|
||||||
|
iframe.setAttribute("src", "https://tracking.example.com/");
|
||||||
|
doc.body.insertBefore(iframe, doc.body.firstChild);
|
||||||
|
});
|
||||||
|
|
||||||
|
let currentTarget = "controlCenter-trackingUnblock";
|
||||||
|
|
||||||
|
let testTargetAvailability = function* (expectedAvailable) {
|
||||||
|
let data = yield getConfigurationPromise("availableTargets");
|
||||||
|
let available = (data.targets.indexOf(currentTarget) != -1);
|
||||||
|
is(available, expectedAvailable, "Target has expected availability.");
|
||||||
|
}
|
||||||
|
yield testTargetAvailability(false);
|
||||||
|
|
||||||
|
yield showMenuPromise("controlCenter");
|
||||||
|
yield testTargetAvailability(true);
|
||||||
|
|
||||||
|
yield showInfoPromise(currentTarget, "This is " + currentTarget,
|
||||||
|
"My arrow should be on the side");
|
||||||
|
is(popup.popupBoxObject.alignmentPosition, "end_before",
|
||||||
|
"Check " + currentTarget + " position");
|
||||||
|
|
||||||
|
let hideMenuPromise =
|
||||||
|
promisePanelElementHidden(window, gIdentityHandler._identityPopup);
|
||||||
|
gContentAPI.hideMenu("controlCenter");
|
||||||
|
yield hideMenuPromise;
|
||||||
|
|
||||||
|
ok(!is_visible(popup), "The tooltip should now be hidden.");
|
||||||
|
yield testTargetAvailability(false);
|
||||||
|
|
||||||
|
yield ContentTask.spawn(gBrowser.selectedBrowser, {}, function () {
|
||||||
|
content.document.getElementById("tracking-element").remove();
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
];
|
|
@ -121,6 +121,12 @@ function waitForPopupAtAnchor(popup, anchorNode, nextTest, msg) {
|
||||||
"Timeout waiting for popup at anchor: " + msg);
|
"Timeout waiting for popup at anchor: " + msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getConfigurationPromise(configName) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
gContentAPI.getConfiguration(configName, data => resolve(data));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function hideInfoPromise(...args) {
|
function hideInfoPromise(...args) {
|
||||||
let popup = document.getElementById("UITourTooltip");
|
let popup = document.getElementById("UITourTooltip");
|
||||||
gContentAPI.hideInfo.apply(gContentAPI, args);
|
gContentAPI.hideInfo.apply(gContentAPI, args);
|
||||||
|
@ -153,12 +159,13 @@ function promisePanelShown(win) {
|
||||||
function promisePanelElementEvent(win, aPanel, aEvent) {
|
function promisePanelElementEvent(win, aPanel, aEvent) {
|
||||||
let deferred = Promise.defer();
|
let deferred = Promise.defer();
|
||||||
let timeoutId = win.setTimeout(() => {
|
let timeoutId = win.setTimeout(() => {
|
||||||
deferred.reject("Panel did not show within 5 seconds.");
|
deferred.reject("Event did not happen within 5 seconds.");
|
||||||
}, 5000);
|
}, 5000);
|
||||||
aPanel.addEventListener(aEvent, function onPanelEvent(e) {
|
aPanel.addEventListener(aEvent, function onPanelEvent(e) {
|
||||||
aPanel.removeEventListener(aEvent, onPanelEvent);
|
aPanel.removeEventListener(aEvent, onPanelEvent);
|
||||||
win.clearTimeout(timeoutId);
|
win.clearTimeout(timeoutId);
|
||||||
deferred.resolve();
|
// Wait one tick to let UITour.jsm process the event as well.
|
||||||
|
executeSoon(deferred.resolve);
|
||||||
});
|
});
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
}
|
}
|
||||||
|
@ -176,7 +183,7 @@ function is_element_hidden(element, msg) {
|
||||||
ok(is_hidden(element), msg);
|
ok(is_hidden(element), msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadUITourTestPage(callback, host = "https://example.com/") {
|
function loadUITourTestPage(callback, host = "https://example.org/") {
|
||||||
if (gTestTab)
|
if (gTestTab)
|
||||||
gBrowser.removeTab(gTestTab);
|
gBrowser.removeTab(gTestTab);
|
||||||
|
|
||||||
|
@ -198,8 +205,8 @@ function loadUITourTestPage(callback, host = "https://example.com/") {
|
||||||
|
|
||||||
function UITourTest() {
|
function UITourTest() {
|
||||||
Services.prefs.setBoolPref("browser.uitour.enabled", true);
|
Services.prefs.setBoolPref("browser.uitour.enabled", true);
|
||||||
let testHttpsUri = Services.io.newURI("https://example.com", null, null);
|
let testHttpsUri = Services.io.newURI("https://example.org", null, null);
|
||||||
let testHttpUri = Services.io.newURI("http://example.com", null, null);
|
let testHttpUri = Services.io.newURI("http://example.org", null, null);
|
||||||
Services.perms.add(testHttpsUri, "uitour", Services.perms.ALLOW_ACTION);
|
Services.perms.add(testHttpsUri, "uitour", Services.perms.ALLOW_ACTION);
|
||||||
Services.perms.add(testHttpUri, "uitour", Services.perms.ALLOW_ACTION);
|
Services.perms.add(testHttpUri, "uitour", Services.perms.ALLOW_ACTION);
|
||||||
|
|
||||||
|
|
|
@ -148,7 +148,7 @@ var HarAutomation = Class({
|
||||||
"defaultFileName");
|
"defaultFileName");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.executeExport(data);
|
return this.executeExport(data);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -77,5 +77,10 @@ function register(toolbox) {
|
||||||
overlays.set(toolbox, overlay);
|
overlays.set(toolbox, overlay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get(toolbox) {
|
||||||
|
return overlays.get(toolbox);
|
||||||
|
}
|
||||||
|
|
||||||
// Exports from this module
|
// Exports from this module
|
||||||
exports.register = register;
|
exports.register = register;
|
||||||
|
exports.get = get;
|
||||||
|
|
|
@ -9,7 +9,8 @@ const TEST_URI = "https://example.com/browser/browser/devtools/webconsole/" +
|
||||||
"test/test-bug-846918-hsts-invalid-headers.html";
|
"test/test-bug-846918-hsts-invalid-headers.html";
|
||||||
const HSTS_INVALID_HEADER_MSG = "The site specified an invalid " +
|
const HSTS_INVALID_HEADER_MSG = "The site specified an invalid " +
|
||||||
"Strict-Transport-Security header.";
|
"Strict-Transport-Security header.";
|
||||||
const LEARN_MORE_URI = "https://developer.mozilla.org/docs/Security/HTTP_Strict_Transport_Security";
|
const LEARN_MORE_URI = "https://developer.mozilla.org/docs/Security/" +
|
||||||
|
"HTTP_Strict_Transport_Security";
|
||||||
|
|
||||||
let test = asyncTest(function* () {
|
let test = asyncTest(function* () {
|
||||||
yield loadTab(TEST_URI);
|
yield loadTab(TEST_URI);
|
||||||
|
|
|
@ -4,8 +4,12 @@
|
||||||
|
|
||||||
// Tests that the Web Console shows weak crypto warnings (SHA-1 Certificate, SSLv3, and RC4)
|
// Tests that the Web Console shows weak crypto warnings (SHA-1 Certificate, SSLv3, and RC4)
|
||||||
|
|
||||||
const TEST_URI = "data:text/html;charset=utf8,Web Console weak crypto warnings test";
|
"use strict";
|
||||||
const TEST_URI_PATH = "/browser/browser/devtools/webconsole/test/test-certificate-messages.html";
|
|
||||||
|
const TEST_URI = "data:text/html;charset=utf8,Web Console weak crypto " +
|
||||||
|
"warnings test";
|
||||||
|
const TEST_URI_PATH = "/browser/browser/devtools/webconsole/test/" +
|
||||||
|
"test-certificate-messages.html";
|
||||||
|
|
||||||
let gWebconsoleTests = [
|
let gWebconsoleTests = [
|
||||||
{url: "https://sha1ee.example.com" + TEST_URI_PATH,
|
{url: "https://sha1ee.example.com" + TEST_URI_PATH,
|
||||||
|
@ -60,9 +64,8 @@ function runTestLoop(theHud) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onLoad(aEvent) {
|
function onLoad() {
|
||||||
gContentBrowser.removeEventListener("load", onLoad, true);
|
gContentBrowser.removeEventListener("load", onLoad, true);
|
||||||
let aOutputNode = gHud.outputNode;
|
|
||||||
|
|
||||||
waitForSuccess({
|
waitForSuccess({
|
||||||
name: gCurrentTest.name,
|
name: gCurrentTest.name,
|
||||||
|
|
|
@ -22,18 +22,23 @@ let test = asyncTest(function*() {
|
||||||
outputNode.focus();
|
outputNode.focus();
|
||||||
|
|
||||||
EventUtils.synthesizeKey("-", { accelKey: true }, hud.iframeWindow);
|
EventUtils.synthesizeKey("-", { accelKey: true }, hud.iframeWindow);
|
||||||
is(inputNode.style.fontSize, "10px", "input font stays at same size with ctrl+-");
|
is(inputNode.style.fontSize, "10px",
|
||||||
is(outputNode.style.fontSize, inputNode.style.fontSize, "output font stays at same size with ctrl+-");
|
"input font stays at same size with ctrl+-");
|
||||||
|
is(outputNode.style.fontSize, inputNode.style.fontSize,
|
||||||
|
"output font stays at same size with ctrl+-");
|
||||||
|
|
||||||
EventUtils.synthesizeKey("=", { accelKey: true }, hud.iframeWindow);
|
EventUtils.synthesizeKey("=", { accelKey: true }, hud.iframeWindow);
|
||||||
is(inputNode.style.fontSize, "11px", "input font increased with ctrl+=");
|
is(inputNode.style.fontSize, "11px", "input font increased with ctrl+=");
|
||||||
is(outputNode.style.fontSize, inputNode.style.fontSize, "output font stays at same size with ctrl+=");
|
is(outputNode.style.fontSize, inputNode.style.fontSize,
|
||||||
|
"output font stays at same size with ctrl+=");
|
||||||
|
|
||||||
EventUtils.synthesizeKey("-", { accelKey: true }, hud.iframeWindow);
|
EventUtils.synthesizeKey("-", { accelKey: true }, hud.iframeWindow);
|
||||||
is(inputNode.style.fontSize, "10px", "font decreased with ctrl+-");
|
is(inputNode.style.fontSize, "10px", "font decreased with ctrl+-");
|
||||||
is(outputNode.style.fontSize, inputNode.style.fontSize, "output font stays at same size with ctrl+-");
|
is(outputNode.style.fontSize, inputNode.style.fontSize,
|
||||||
|
"output font stays at same size with ctrl+-");
|
||||||
|
|
||||||
EventUtils.synthesizeKey("0", { accelKey: true }, hud.iframeWindow);
|
EventUtils.synthesizeKey("0", { accelKey: true }, hud.iframeWindow);
|
||||||
is(inputNode.style.fontSize, "", "font reset with ctrl+0");
|
is(inputNode.style.fontSize, "", "font reset with ctrl+0");
|
||||||
is(outputNode.style.fontSize, inputNode.style.fontSize, "output font stays at same size with ctrl+0");
|
is(outputNode.style.fontSize, inputNode.style.fontSize,
|
||||||
|
"output font stays at same size with ctrl+0");
|
||||||
});
|
});
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// When strings containing URLs are entered into the webconsole,
|
// When strings containing URLs are entered into the webconsole, check
|
||||||
// check its output and ensure that the output can be clicked to open those URLs.
|
// its output and ensure that the output can be clicked to open those URLs.
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
|
|
@ -6,32 +6,43 @@
|
||||||
// Check that inspecting a closure in the variables view sidebar works when
|
// Check that inspecting a closure in the variables view sidebar works when
|
||||||
// execution is paused.
|
// execution is paused.
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-closures.html";
|
"use strict";
|
||||||
|
|
||||||
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-closures.html";
|
||||||
|
|
||||||
let gWebConsole, gJSTerm, gVariablesView;
|
let gWebConsole, gJSTerm, gVariablesView;
|
||||||
|
|
||||||
function test()
|
function test() {
|
||||||
{
|
|
||||||
registerCleanupFunction(() => {
|
registerCleanupFunction(() => {
|
||||||
gWebConsole = gJSTerm = gVariablesView = null;
|
gWebConsole = gJSTerm = gVariablesView = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function resumeDebugger(toolbox, panelWin, deferred) {
|
||||||
|
panelWin.gThreadClient.addOneTimeListener("resumed", () => {
|
||||||
|
ok(true, "Debugger resumed");
|
||||||
|
deferred.resolve({ toolbox: toolbox, panelWin: panelWin });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function fetchScopes(hud, toolbox, panelWin, deferred) {
|
||||||
|
panelWin.once(panelWin.EVENTS.FETCHED_SCOPES, () => {
|
||||||
|
ok(true, "Scopes were fetched");
|
||||||
|
toolbox.selectTool("webconsole").then(() => consoleOpened(hud));
|
||||||
|
deferred.resolve();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
loadTab(TEST_URI).then(() => {
|
loadTab(TEST_URI).then(() => {
|
||||||
openConsole().then((hud) => {
|
openConsole().then((hud) => {
|
||||||
openDebugger().then(({ toolbox, panelWin }) => {
|
openDebugger().then(({ toolbox, panelWin }) => {
|
||||||
let deferred = promise.defer();
|
let deferred = promise.defer();
|
||||||
panelWin.gThreadClient.addOneTimeListener("resumed", (aEvent, aPacket) => {
|
resumeDebugger(toolbox, panelWin, deferred);
|
||||||
ok(true, "Debugger resumed");
|
|
||||||
deferred.resolve({ toolbox: toolbox, panelWin: panelWin });
|
|
||||||
});
|
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
}).then(({ toolbox, panelWin }) => {
|
}).then(({ toolbox, panelWin }) => {
|
||||||
let deferred = promise.defer();
|
let deferred = promise.defer();
|
||||||
panelWin.once(panelWin.EVENTS.FETCHED_SCOPES, (aEvent, aPacket) => {
|
fetchScopes(hud, toolbox, panelWin, deferred);
|
||||||
ok(true, "Scopes were fetched");
|
|
||||||
toolbox.selectTool("webconsole").then(() => consoleOpened(hud));
|
|
||||||
deferred.resolve();
|
|
||||||
});
|
|
||||||
|
|
||||||
let button = content.document.querySelector("button");
|
let button = content.document.querySelector("button");
|
||||||
ok(button, "button element found");
|
ok(button, "button element found");
|
||||||
|
@ -43,8 +54,7 @@ function test()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function consoleOpened(hud)
|
function consoleOpened(hud) {
|
||||||
{
|
|
||||||
gWebConsole = hud;
|
gWebConsole = hud;
|
||||||
gJSTerm = hud.jsterm;
|
gJSTerm = hud.jsterm;
|
||||||
gJSTerm.execute("window.george.getName");
|
gJSTerm.execute("window.george.getName");
|
||||||
|
@ -59,9 +69,8 @@ function consoleOpened(hud)
|
||||||
}).then(onExecuteGetName);
|
}).then(onExecuteGetName);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onExecuteGetName(aResults)
|
function onExecuteGetName(results) {
|
||||||
{
|
let clickable = results[0].clickableElements[0];
|
||||||
let clickable = aResults[0].clickableElements[0];
|
|
||||||
ok(clickable, "clickable object found");
|
ok(clickable, "clickable object found");
|
||||||
|
|
||||||
gJSTerm.once("variablesview-fetched", onGetNameFetch);
|
gJSTerm.once("variablesview-fetched", onGetNameFetch);
|
||||||
|
@ -76,19 +85,17 @@ function onExecuteGetName(aResults)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onGetNameFetch(aEvent, aVar)
|
function onGetNameFetch(evt, view) {
|
||||||
{
|
gVariablesView = view._variablesView;
|
||||||
gVariablesView = aVar._variablesView;
|
|
||||||
ok(gVariablesView, "variables view object");
|
ok(gVariablesView, "variables view object");
|
||||||
|
|
||||||
findVariableViewProperties(aVar, [
|
findVariableViewProperties(view, [
|
||||||
{ name: /_pfactory/, value: "" },
|
{ name: /_pfactory/, value: "" },
|
||||||
], { webconsole: gWebConsole }).then(onExpandClosure);
|
], { webconsole: gWebConsole }).then(onExpandClosure);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onExpandClosure(aResults)
|
function onExpandClosure(results) {
|
||||||
{
|
let prop = results[0].matchedProp;
|
||||||
let prop = aResults[0].matchedProp;
|
|
||||||
ok(prop, "matched the name property in the variables view");
|
ok(prop, "matched the name property in the variables view");
|
||||||
|
|
||||||
gVariablesView.window.focus();
|
gVariablesView.window.focus();
|
||||||
|
|
|
@ -5,7 +5,10 @@
|
||||||
|
|
||||||
// Check if console provides the right column number alongside line number
|
// Check if console provides the right column number alongside line number
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console-column.html";
|
"use strict";
|
||||||
|
|
||||||
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console-column.html";
|
||||||
|
|
||||||
let hud;
|
let hud;
|
||||||
|
|
||||||
|
@ -21,7 +24,7 @@ function consoleOpened(aHud) {
|
||||||
waitForMessages({
|
waitForMessages({
|
||||||
webconsole: hud,
|
webconsole: hud,
|
||||||
messages: [{
|
messages: [{
|
||||||
text: 'Error Message',
|
text: "Error Message",
|
||||||
category: CATEGORY_WEBDEV,
|
category: CATEGORY_WEBDEV,
|
||||||
severity: SEVERITY_ERROR
|
severity: SEVERITY_ERROR
|
||||||
}]
|
}]
|
||||||
|
@ -30,12 +33,13 @@ function consoleOpened(aHud) {
|
||||||
|
|
||||||
function testLocationColumn() {
|
function testLocationColumn() {
|
||||||
let messages = hud.outputNode.children;
|
let messages = hud.outputNode.children;
|
||||||
let expected = ['10:7', '10:39', '11:9', '12:11', '13:9', '14:7'];
|
let expected = ["10:7", "10:39", "11:9", "12:11", "13:9", "14:7"];
|
||||||
|
|
||||||
for (let i = 0, len = messages.length; i < len; i++) {
|
for (let i = 0, len = messages.length; i < len; i++) {
|
||||||
let msg = messages[i].textContent;
|
let msg = messages[i].textContent;
|
||||||
|
|
||||||
is(msg.includes(expected[i]), true, 'Found expected line:column of ' + expected[i]);
|
is(msg.includes(expected[i]), true, "Found expected line:column of " +
|
||||||
|
expected[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
finishTest();
|
finishTest();
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
// Tests that code completion works properly.
|
// Tests that code completion works properly.
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
const TEST_URI = "data:text/html;charset=utf8,<p>test code completion";
|
const TEST_URI = "data:text/html;charset=utf8,<p>test code completion";
|
||||||
|
|
||||||
let jsterm;
|
let jsterm;
|
||||||
|
@ -49,19 +51,22 @@ let test = asyncTest(function* () {
|
||||||
yield complete(jsterm.COMPLETE_FORWARD);
|
yield complete(jsterm.COMPLETE_FORWARD);
|
||||||
|
|
||||||
is(input.value, "document.getElem", "'document.getElem' completion");
|
is(input.value, "document.getElem", "'document.getElem' completion");
|
||||||
is(jsterm.completeNode.value, " entsByTagNameNS", "'document.getElem' completion");
|
is(jsterm.completeNode.value, " entsByTagNameNS",
|
||||||
|
"'document.getElem' completion");
|
||||||
|
|
||||||
// Test pressing tab another time.
|
// Test pressing tab another time.
|
||||||
yield jsterm.complete(jsterm.COMPLETE_FORWARD);
|
yield jsterm.complete(jsterm.COMPLETE_FORWARD);
|
||||||
|
|
||||||
is(input.value, "document.getElem", "'document.getElem' completion");
|
is(input.value, "document.getElem", "'document.getElem' completion");
|
||||||
is(jsterm.completeNode.value, " entsByTagName", "'document.getElem' another tab completion");
|
is(jsterm.completeNode.value, " entsByTagName",
|
||||||
|
"'document.getElem' another tab completion");
|
||||||
|
|
||||||
// Test pressing shift_tab.
|
// Test pressing shift_tab.
|
||||||
complete(jsterm.COMPLETE_BACKWARD);
|
complete(jsterm.COMPLETE_BACKWARD);
|
||||||
|
|
||||||
is(input.value, "document.getElem", "'document.getElem' untab completion");
|
is(input.value, "document.getElem", "'document.getElem' untab completion");
|
||||||
is(jsterm.completeNode.value, " entsByTagNameNS", "'document.getElem' completion");
|
is(jsterm.completeNode.value, " entsByTagNameNS",
|
||||||
|
"'document.getElem' completion");
|
||||||
|
|
||||||
jsterm.clearOutput();
|
jsterm.clearOutput();
|
||||||
|
|
||||||
|
@ -76,7 +81,8 @@ let test = asyncTest(function* () {
|
||||||
input.value = "console.log('one');\nconsol";
|
input.value = "console.log('one');\nconsol";
|
||||||
yield complete(jsterm.COMPLETE_HINT_ONLY);
|
yield complete(jsterm.COMPLETE_HINT_ONLY);
|
||||||
|
|
||||||
is(jsterm.completeNode.value, " \n e", "multi-line completion");
|
is(jsterm.completeNode.value, " \n e",
|
||||||
|
"multi-line completion");
|
||||||
|
|
||||||
// Test non-object autocompletion.
|
// Test non-object autocompletion.
|
||||||
input.value = "Object.name.sl";
|
input.value = "Object.name.sl";
|
||||||
|
@ -93,7 +99,6 @@ let test = asyncTest(function* () {
|
||||||
jsterm = null;
|
jsterm = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function complete(type) {
|
function complete(type) {
|
||||||
let updated = jsterm.once("autocomplete-updated");
|
let updated = jsterm.once("autocomplete-updated");
|
||||||
jsterm.complete(type);
|
jsterm.complete(type);
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
function test() {
|
function test() {
|
||||||
let hud;
|
let hud;
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console-api-stackframe.html";
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console-api-stackframe.html";
|
||||||
const TEST_FILE = TEST_URI.substr(TEST_URI.lastIndexOf("/"));
|
const TEST_FILE = TEST_URI.substr(TEST_URI.lastIndexOf("/"));
|
||||||
|
|
||||||
Task.spawn(runner).then(finishTest);
|
Task.spawn(runner).then(finishTest);
|
||||||
|
@ -21,7 +22,8 @@ function test() {
|
||||||
const stack = [{
|
const stack = [{
|
||||||
file: TEST_FILE,
|
file: TEST_FILE,
|
||||||
fn: "thirdCall",
|
fn: "thirdCall",
|
||||||
line: /\b2[123]\b/, // 21,22,23
|
// 21,22,23
|
||||||
|
line: /\b2[123]\b/,
|
||||||
}, {
|
}, {
|
||||||
file: TEST_FILE,
|
file: TEST_FILE,
|
||||||
fn: "secondCall",
|
fn: "secondCall",
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
// output anything in the web console and they do not throw any exceptions.
|
// output anything in the web console and they do not throw any exceptions.
|
||||||
// See bug 614350.
|
// See bug 614350.
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console-extras.html";
|
"use strict";
|
||||||
|
|
||||||
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console-extras.html";
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
loadTab(TEST_URI).then(() => {
|
loadTab(TEST_URI).then(() => {
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console.html";
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console.html";
|
||||||
|
|
||||||
let test = asyncTest(function*() {
|
let test = asyncTest(function*() {
|
||||||
yield loadTab(TEST_URI);
|
yield loadTab(TEST_URI);
|
||||||
|
@ -22,16 +23,16 @@ let test = asyncTest(function*() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function* testMethod(aMethod, aHud, aOutputNode) {
|
function* testMethod(method, hud, outputNode) {
|
||||||
let console = content.console;
|
let console = content.console;
|
||||||
|
|
||||||
aHud.jsterm.clearOutput();
|
hud.jsterm.clearOutput();
|
||||||
|
|
||||||
console[aMethod]("foo-bar-baz");
|
console[method]("foo-bar-baz");
|
||||||
console[aMethod]("baar-baz");
|
console[method]("baar-baz");
|
||||||
|
|
||||||
yield waitForMessages({
|
yield waitForMessages({
|
||||||
webconsole: aHud,
|
webconsole: hud,
|
||||||
messages: [{
|
messages: [{
|
||||||
text: "foo-bar-baz",
|
text: "foo-bar-baz",
|
||||||
}, {
|
}, {
|
||||||
|
@ -39,27 +40,27 @@ function* testMethod(aMethod, aHud, aOutputNode) {
|
||||||
}],
|
}],
|
||||||
});
|
});
|
||||||
|
|
||||||
setStringFilter("foo", aHud);
|
setStringFilter("foo", hud);
|
||||||
|
|
||||||
is(aOutputNode.querySelectorAll(".filtered-by-string").length, 1,
|
is(outputNode.querySelectorAll(".filtered-by-string").length, 1,
|
||||||
"1 hidden " + aMethod + " node via string filtering")
|
"1 hidden " + method + " node via string filtering");
|
||||||
|
|
||||||
aHud.jsterm.clearOutput();
|
hud.jsterm.clearOutput();
|
||||||
|
|
||||||
// now toggle the current method off - make sure no visible message
|
// now toggle the current method off - make sure no visible message
|
||||||
// TODO: move all filtering tests into a separate test file: see bug 608135
|
// TODO: move all filtering tests into a separate test file: see bug 608135
|
||||||
|
|
||||||
console[aMethod]("foo-bar-baz");
|
console[method]("foo-bar-baz");
|
||||||
yield waitForMessages({
|
yield waitForMessages({
|
||||||
webconsole: aHud,
|
webconsole: hud,
|
||||||
messages: [{
|
messages: [{
|
||||||
text: "foo-bar-baz",
|
text: "foo-bar-baz",
|
||||||
}],
|
}],
|
||||||
});
|
});
|
||||||
|
|
||||||
setStringFilter("", aHud);
|
setStringFilter("", hud);
|
||||||
let filter;
|
let filter;
|
||||||
switch(aMethod) {
|
switch (method) {
|
||||||
case "debug":
|
case "debug":
|
||||||
filter = "log";
|
filter = "log";
|
||||||
break;
|
break;
|
||||||
|
@ -67,35 +68,35 @@ function* testMethod(aMethod, aHud, aOutputNode) {
|
||||||
filter = "error";
|
filter = "error";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
filter = aMethod;
|
filter = method;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
aHud.setFilterState(filter, false);
|
hud.setFilterState(filter, false);
|
||||||
|
|
||||||
is(aOutputNode.querySelectorAll(".filtered-by-type").length, 1,
|
is(outputNode.querySelectorAll(".filtered-by-type").length, 1,
|
||||||
"1 message hidden for " + aMethod + " (logging turned off)")
|
"1 message hidden for " + method + " (logging turned off)");
|
||||||
|
|
||||||
aHud.setFilterState(filter, true);
|
hud.setFilterState(filter, true);
|
||||||
|
|
||||||
is(aOutputNode.querySelectorAll(".message:not(.filtered-by-type)").length, 1,
|
is(outputNode.querySelectorAll(".message:not(.filtered-by-type)").length, 1,
|
||||||
"1 message shown for " + aMethod + " (logging turned on)")
|
"1 message shown for " + method + " (logging turned on)");
|
||||||
|
|
||||||
aHud.jsterm.clearOutput();
|
hud.jsterm.clearOutput();
|
||||||
|
|
||||||
// test for multiple arguments.
|
// test for multiple arguments.
|
||||||
console[aMethod]("foo", "bar");
|
console[method]("foo", "bar");
|
||||||
|
|
||||||
yield waitForMessages({
|
yield waitForMessages({
|
||||||
webconsole: aHud,
|
webconsole: hud,
|
||||||
messages: [{
|
messages: [{
|
||||||
text: 'foo bar',
|
text: "foo bar",
|
||||||
category: CATEGORY_WEBDEV,
|
category: CATEGORY_WEBDEV,
|
||||||
}],
|
}],
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function setStringFilter(aValue, aHud) {
|
function setStringFilter(value, hud) {
|
||||||
aHud.ui.filterBox.value = aValue;
|
hud.ui.filterBox.value = value;
|
||||||
aHud.ui.adjustVisibilityOnSearchStringChange();
|
hud.ui.adjustVisibilityOnSearchStringChange();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,19 @@
|
||||||
/* Any copyright is dedicated to the Public Domain.
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
|
||||||
// Tests that the basic console.log()-style APIs and filtering work for sharedWorkers
|
// Tests that the basic console.log()-style APIs and filtering work for
|
||||||
|
// sharedWorkers
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console-workers.html";
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console-workers.html";
|
||||||
|
|
||||||
function pushPrefEnv()
|
function pushPrefEnv() {
|
||||||
{
|
|
||||||
let deferred = promise.defer();
|
let deferred = promise.defer();
|
||||||
let options = {'set': [["dom.workers.sharedWorkers.enabled", true]]};
|
let options = {
|
||||||
|
set: [["dom.workers.sharedWorkers.enabled", true]]
|
||||||
|
};
|
||||||
SpecialPowers.pushPrefEnv(options, deferred.resolve);
|
SpecialPowers.pushPrefEnv(options, deferred.resolve);
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
}
|
}
|
||||||
|
@ -28,17 +31,17 @@ let test = asyncTest(function*() {
|
||||||
}],
|
}],
|
||||||
});
|
});
|
||||||
|
|
||||||
hud.setFilterState('sharedworkers', false);
|
hud.setFilterState("sharedworkers", false);
|
||||||
|
|
||||||
is(hud.outputNode.querySelectorAll(".filtered-by-type").length, 1,
|
is(hud.outputNode.querySelectorAll(".filtered-by-type").length, 1,
|
||||||
"1 message hidden for sharedworkers (logging turned off)")
|
"1 message hidden for sharedworkers (logging turned off)");
|
||||||
|
|
||||||
hud.setFilterState('sharedworkers', true);
|
hud.setFilterState("sharedworkers", true);
|
||||||
|
|
||||||
is(hud.outputNode.querySelectorAll(".filtered-by-type").length, 0,
|
is(hud.outputNode.querySelectorAll(".filtered-by-type").length, 0,
|
||||||
"1 message shown for sharedworkers (logging turned on)")
|
"1 message shown for sharedworkers (logging turned on)");
|
||||||
|
|
||||||
hud.setFilterState('sharedworkers', false);
|
hud.setFilterState("sharedworkers", false);
|
||||||
|
|
||||||
hud.jsterm.clearOutput(true);
|
hud.jsterm.clearOutput(true);
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,8 +2,11 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-bug_939783_console_trace_duplicates.html";
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-bug_939783_console_trace_duplicates.html";
|
||||||
|
|
||||||
Task.spawn(runner).then(finishTest);
|
Task.spawn(runner).then(finishTest);
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,8 @@ let test = asyncTest(function*() {
|
||||||
let [msgWithText, msgWithObj] = [...result.matched];
|
let [msgWithText, msgWithObj] = [...result.matched];
|
||||||
ok(msgWithText && msgWithObj, "Two messages should have appeared");
|
ok(msgWithText && msgWithObj, "Two messages should have appeared");
|
||||||
|
|
||||||
let contextMenu = hud.iframeWindow.
|
let contextMenu = hud.iframeWindow.document
|
||||||
document.getElementById("output-contextmenu");
|
.getElementById("output-contextmenu");
|
||||||
let openInVarViewItem = contextMenu.querySelector("#menu_openInVarView");
|
let openInVarViewItem = contextMenu.querySelector("#menu_openInVarView");
|
||||||
let obj = msgWithObj.querySelector(".cm-variable");
|
let obj = msgWithObj.querySelector(".cm-variable");
|
||||||
let text = msgWithText.querySelector(".console-string");
|
let text = msgWithText.querySelector(".console-string");
|
||||||
|
|
|
@ -4,7 +4,10 @@
|
||||||
|
|
||||||
// Test that console.count() counts as expected. See bug 922208.
|
// Test that console.count() counts as expected. See bug 922208.
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console-count.html";
|
"use strict";
|
||||||
|
|
||||||
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console-count.html";
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
Task.spawn(runner).then(finishTest);
|
Task.spawn(runner).then(finishTest);
|
||||||
|
|
|
@ -8,15 +8,19 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
let originalNetPref = Services.prefs.getBoolPref("devtools.webconsole.filter.networkinfo");
|
let originalNetPref = Services.prefs
|
||||||
|
.getBoolPref("devtools.webconsole.filter.networkinfo");
|
||||||
registerCleanupFunction(() => {
|
registerCleanupFunction(() => {
|
||||||
Services.prefs.setBoolPref("devtools.webconsole.filter.networkinfo", originalNetPref);
|
Services.prefs.setBoolPref("devtools.webconsole.filter.networkinfo",
|
||||||
|
originalNetPref);
|
||||||
});
|
});
|
||||||
Services.prefs.setBoolPref("devtools.webconsole.filter.networkinfo", true);
|
Services.prefs.setBoolPref("devtools.webconsole.filter.networkinfo", true);
|
||||||
Task.spawn(runner).then(finishTest);
|
Task.spawn(runner).then(finishTest);
|
||||||
|
|
||||||
function* runner() {
|
function* runner() {
|
||||||
const TEST_PAGE_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console.html" + "?_uniq=" + Date.now();
|
const TEST_PAGE_URI = "http://example.com/browser/browser/devtools/" +
|
||||||
|
"webconsole/test/test-console.html" + "?_uniq=" +
|
||||||
|
Date.now();
|
||||||
|
|
||||||
const {tab} = yield loadTab("data:text/html;charset=utf8,<p>hello</p>");
|
const {tab} = yield loadTab("data:text/html;charset=utf8,<p>hello</p>");
|
||||||
const hud = yield openConsole(tab);
|
const hud = yield openConsole(tab);
|
||||||
|
@ -43,7 +47,8 @@ function test() {
|
||||||
deferred.resolve();
|
deferred.resolve();
|
||||||
});
|
});
|
||||||
|
|
||||||
EventUtils.synthesizeMouseAtCenter(urlNode, {clickCount: 2}, hud.iframeWindow);
|
EventUtils.synthesizeMouseAtCenter(urlNode, {clickCount: 2},
|
||||||
|
hud.iframeWindow);
|
||||||
|
|
||||||
yield deferred.promise;
|
yield deferred.promise;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console.html";
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console.html";
|
||||||
|
|
||||||
let test = asyncTest(function*() {
|
let test = asyncTest(function*() {
|
||||||
yield loadTab(TEST_URI);
|
yield loadTab(TEST_URI);
|
||||||
|
@ -29,6 +30,8 @@ let test = asyncTest(function*() {
|
||||||
|
|
||||||
let inputNode = [...input.matched][0];
|
let inputNode = [...input.matched][0];
|
||||||
let outputNode = [...output.matched][0];
|
let outputNode = [...output.matched][0];
|
||||||
is(inputNode.getAttribute("category"), "input", "input node category is correct");
|
is(inputNode.getAttribute("category"), "input",
|
||||||
is(outputNode.getAttribute("category"), "output", "output node category is correct");
|
"input node category is correct");
|
||||||
|
is(outputNode.getAttribute("category"), "output",
|
||||||
|
"output node category is correct");
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,8 +4,10 @@
|
||||||
// Test for the message timestamps option: check if the preference toggles the
|
// Test for the message timestamps option: check if the preference toggles the
|
||||||
// display of messages in the console output. See bug 722267.
|
// display of messages in the console output. See bug 722267.
|
||||||
|
|
||||||
const TEST_URI = "data:text/html;charset=utf-8,Web Console test for bug 722267 - " +
|
"use strict";
|
||||||
"preference for toggling timestamps in messages";
|
|
||||||
|
const TEST_URI = "data:text/html;charset=utf-8,Web Console test for " +
|
||||||
|
"bug 722267 - preference for toggling timestamps in messages";
|
||||||
const PREF_MESSAGE_TIMESTAMP = "devtools.webconsole.timestampMessages";
|
const PREF_MESSAGE_TIMESTAMP = "devtools.webconsole.timestampMessages";
|
||||||
let hud;
|
let hud;
|
||||||
|
|
||||||
|
@ -22,8 +24,7 @@ let test = asyncTest(function* () {
|
||||||
hud = null;
|
hud = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
function consoleOpened()
|
function consoleOpened() {
|
||||||
{
|
|
||||||
info("console opened");
|
info("console opened");
|
||||||
let prefValue = Services.prefs.getBoolPref(PREF_MESSAGE_TIMESTAMP);
|
let prefValue = Services.prefs.getBoolPref(PREF_MESSAGE_TIMESTAMP);
|
||||||
ok(!prefValue, "messages have no timestamp by default (pref check)");
|
ok(!prefValue, "messages have no timestamp by default (pref check)");
|
||||||
|
@ -34,8 +35,7 @@ function consoleOpened()
|
||||||
return toolbox.selectTool("options");
|
return toolbox.selectTool("options");
|
||||||
}
|
}
|
||||||
|
|
||||||
function onOptionsPanelSelected(panel)
|
function onOptionsPanelSelected(panel) {
|
||||||
{
|
|
||||||
info("options panel opened");
|
info("options panel opened");
|
||||||
|
|
||||||
let prefChanged = gDevTools.once("pref-changed", onPrefChanged);
|
let prefChanged = gDevTools.once("pref-changed", onPrefChanged);
|
||||||
|
@ -46,8 +46,7 @@ function onOptionsPanelSelected(panel)
|
||||||
return prefChanged;
|
return prefChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onPrefChanged()
|
function onPrefChanged() {
|
||||||
{
|
|
||||||
info("pref changed");
|
info("pref changed");
|
||||||
let prefValue = Services.prefs.getBoolPref(PREF_MESSAGE_TIMESTAMP);
|
let prefValue = Services.prefs.getBoolPref(PREF_MESSAGE_TIMESTAMP);
|
||||||
ok(prefValue, "messages have timestamps (pref check)");
|
ok(prefValue, "messages have timestamps (pref check)");
|
||||||
|
|
|
@ -3,12 +3,14 @@
|
||||||
|
|
||||||
// Tests that the filter button context menu logic works correctly.
|
// Tests that the filter button context menu logic works correctly.
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/";
|
const TEST_URI = "http://example.com/";
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
loadTab(TEST_URI).then(() => {
|
loadTab(TEST_URI).then(() => {
|
||||||
openConsole().then(testFilterButtons);
|
openConsole().then(testFilterButtons);
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function testFilterButtons(aHud) {
|
function testFilterButtons(aHud) {
|
||||||
|
@ -32,21 +34,21 @@ function testRightClick(aCategory, hudBox, aHud) {
|
||||||
|
|
||||||
function verifyContextMenuIsClosed() {
|
function verifyContextMenuIsClosed() {
|
||||||
info("verify the context menu is closed");
|
info("verify the context menu is closed");
|
||||||
is(button.getAttribute("open"), false, "The context menu for the \"" + aCategory +
|
is(button.getAttribute("open"), false, "The context menu for the \"" +
|
||||||
"\" button is closed");
|
aCategory + "\" button is closed");
|
||||||
}
|
}
|
||||||
|
|
||||||
function verifyOriginalCheckedState() {
|
function verifyOriginalCheckedState() {
|
||||||
info("verify the button has the original checked state");
|
info("verify the button has the original checked state");
|
||||||
is(button.getAttribute("aria-pressed"), origCheckedState,
|
is(button.getAttribute("aria-pressed"), origCheckedState,
|
||||||
"The button state should not have changed");
|
"The button state should not have changed");
|
||||||
};
|
}
|
||||||
|
|
||||||
function verifyNewCheckedState() {
|
function verifyNewCheckedState() {
|
||||||
info("verify the button's checked state has changed");
|
info("verify the button's checked state has changed");
|
||||||
isnot(button.getAttribute("aria-pressed"), origCheckedState,
|
isnot(button.getAttribute("aria-pressed"), origCheckedState,
|
||||||
"The button state should have changed");
|
"The button state should have changed");
|
||||||
};
|
}
|
||||||
|
|
||||||
function leftClickToClose() {
|
function leftClickToClose() {
|
||||||
info("left click the button to close the contextMenu");
|
info("left click the button to close the contextMenu");
|
||||||
|
|
|
@ -3,7 +3,10 @@
|
||||||
|
|
||||||
// A for-of loop in Web Console code can loop over a content NodeList.
|
// A for-of loop in Web Console code can loop over a content NodeList.
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-for-of.html";
|
"use strict";
|
||||||
|
|
||||||
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-for-of.html";
|
||||||
|
|
||||||
let test = asyncTest(function* () {
|
let test = asyncTest(function* () {
|
||||||
yield loadTab(TEST_URI);
|
yield loadTab(TEST_URI);
|
||||||
|
@ -15,8 +18,9 @@ let test = asyncTest(function* () {
|
||||||
function testForOf(hud) {
|
function testForOf(hud) {
|
||||||
let deferred = promise.defer();
|
let deferred = promise.defer();
|
||||||
|
|
||||||
var jsterm = hud.jsterm;
|
let jsterm = hud.jsterm;
|
||||||
jsterm.execute("{ [x.tagName for (x of document.body.childNodes) if (x.nodeType === 1)].join(' '); }",
|
jsterm.execute("{ [x.tagName for (x of document.body.childNodes) " +
|
||||||
|
"if (x.nodeType === 1)].join(' '); }",
|
||||||
(node) => {
|
(node) => {
|
||||||
ok(/H1 DIV H2 P/.test(node.textContent),
|
ok(/H1 DIV H2 P/.test(node.textContent),
|
||||||
"for-of loop should find all top-level nodes");
|
"for-of loop should find all top-level nodes");
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console.html";
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console.html";
|
||||||
|
|
||||||
// Constants used for defining the direction of JSTerm input history navigation.
|
// Constants used for defining the direction of JSTerm input history navigation.
|
||||||
const HISTORY_BACK = -1;
|
const HISTORY_BACK = -1;
|
||||||
|
@ -23,14 +24,14 @@ let test = asyncTest(function*() {
|
||||||
|
|
||||||
let executeList = ["document", "window", "window.location"];
|
let executeList = ["document", "window", "window.location"];
|
||||||
|
|
||||||
for (var item of executeList) {
|
for (let item of executeList) {
|
||||||
input.value = item;
|
input.value = item;
|
||||||
yield jsterm.execute();
|
yield jsterm.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i = executeList.length - 1; i != -1; i--) {
|
for (let x = executeList.length - 1; x != -1; x--) {
|
||||||
jsterm.historyPeruse(HISTORY_BACK);
|
jsterm.historyPeruse(HISTORY_BACK);
|
||||||
is (input.value, executeList[i], "check history previous idx:" + i);
|
is(input.value, executeList[x], "check history previous idx:" + x);
|
||||||
}
|
}
|
||||||
|
|
||||||
jsterm.historyPeruse(HISTORY_BACK);
|
jsterm.historyPeruse(HISTORY_BACK);
|
||||||
|
@ -39,7 +40,7 @@ let test = asyncTest(function*() {
|
||||||
jsterm.historyPeruse(HISTORY_BACK);
|
jsterm.historyPeruse(HISTORY_BACK);
|
||||||
is(input.value, executeList[0], "test that item is still still index 0");
|
is(input.value, executeList[0], "test that item is still still index 0");
|
||||||
|
|
||||||
for (var i = 1; i < executeList.length; i++) {
|
for (let i = 1; i < executeList.length; i++) {
|
||||||
jsterm.historyPeruse(HISTORY_FORWARD);
|
jsterm.historyPeruse(HISTORY_FORWARD);
|
||||||
is(input.value, executeList[i], "check history next idx:" + i);
|
is(input.value, executeList[i], "check history next idx:" + i);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
// Test that dynamically created (HTML|XML|SVG)Documents can be inspected by
|
// Test that dynamically created (HTML|XML|SVG)Documents can be inspected by
|
||||||
// clicking on the object in console (bug 1035198).
|
// clicking on the object in console (bug 1035198).
|
||||||
|
|
||||||
"use strict;"
|
"use strict";
|
||||||
|
|
||||||
const TEST_CASES = [
|
const TEST_CASES = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console.html";
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console.html";
|
||||||
|
|
||||||
let test = asyncTest(function*() {
|
let test = asyncTest(function*() {
|
||||||
yield loadTab(TEST_URI);
|
yield loadTab(TEST_URI);
|
||||||
|
@ -23,8 +24,7 @@ let test = asyncTest(function*() {
|
||||||
let length = input.value.length;
|
let length = input.value.length;
|
||||||
input.selectionEnd = length;
|
input.selectionEnd = length;
|
||||||
input.selectionStart = length;
|
input.selectionStart = length;
|
||||||
function getHeight()
|
function getHeight() {
|
||||||
{
|
|
||||||
return input.clientHeight;
|
return input.clientHeight;
|
||||||
}
|
}
|
||||||
let initialHeight = getHeight();
|
let initialHeight = getHeight();
|
||||||
|
|
|
@ -3,7 +3,10 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console.html";
|
"use strict";
|
||||||
|
|
||||||
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console.html";
|
||||||
|
|
||||||
let jsterm;
|
let jsterm;
|
||||||
|
|
||||||
|
@ -28,8 +31,7 @@ function checkResult(msg, desc) {
|
||||||
if (typeof msg == "string") {
|
if (typeof msg == "string") {
|
||||||
is(node.textContent.trim(), msg,
|
is(node.textContent.trim(), msg,
|
||||||
"correct message shown for " + desc);
|
"correct message shown for " + desc);
|
||||||
}
|
} else if (typeof msg == "function") {
|
||||||
else if (typeof msg == "function") {
|
|
||||||
ok(msg(node), "correct message shown for " + desc);
|
ok(msg(node), "correct message shown for " + desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,9 +40,9 @@ function checkResult(msg, desc) {
|
||||||
return def.promise;
|
return def.promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
function* testJSTerm(hud)
|
function* testJSTerm(hud) {
|
||||||
{
|
const HELP_URL = "https://developer.mozilla.org/docs/Tools/" +
|
||||||
const HELP_URL = "https://developer.mozilla.org/docs/Tools/Web_Console/Helpers";
|
"Web_Console/Helpers";
|
||||||
|
|
||||||
jsterm.clearOutput();
|
jsterm.clearOutput();
|
||||||
yield jsterm.execute("$('#header').getAttribute('id')");
|
yield jsterm.execute("$('#header').getAttribute('id')");
|
||||||
|
@ -59,8 +61,7 @@ function* testJSTerm(hud)
|
||||||
|
|
||||||
yield waitForSuccess({
|
yield waitForSuccess({
|
||||||
name: "clear() worked",
|
name: "clear() worked",
|
||||||
validator: function()
|
validator: function() {
|
||||||
{
|
|
||||||
return jsterm.outputNode.childNodes.length == 0;
|
return jsterm.outputNode.childNodes.length == 0;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console.html";
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console.html";
|
||||||
|
|
||||||
let test = asyncTest(function*() {
|
let test = asyncTest(function*() {
|
||||||
yield loadTab(TEST_URI);
|
yield loadTab(TEST_URI);
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console.html";
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console.html";
|
||||||
|
|
||||||
let test = asyncTest(function*() {
|
let test = asyncTest(function*() {
|
||||||
yield loadTab(TEST_URI);
|
yield loadTab(TEST_URI);
|
||||||
|
@ -27,7 +28,7 @@ let test = asyncTest(function*() {
|
||||||
category: CATEGORY_WEBDEV,
|
category: CATEGORY_WEBDEV,
|
||||||
severity: SEVERITY_LOG,
|
severity: SEVERITY_LOG,
|
||||||
}],
|
}],
|
||||||
})
|
});
|
||||||
|
|
||||||
is(hud.outputNode.children.length, 50, "number of messages");
|
is(hud.outputNode.children.length, 50, "number of messages");
|
||||||
|
|
||||||
|
@ -88,9 +89,8 @@ function countMessageNodes(hud) {
|
||||||
return displayedMessageNodes;
|
return displayedMessageNodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setStringFilter(hud, aValue)
|
function setStringFilter(hud, value) {
|
||||||
{
|
hud.ui.filterBox.value = value;
|
||||||
hud.ui.filterBox.value = aValue;
|
|
||||||
hud.ui.adjustVisibilityOnSearchStringChange();
|
hud.ui.adjustVisibilityOnSearchStringChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,13 @@
|
||||||
// Tests that the text filter box works to filter based on filenames
|
// Tests that the text filter box works to filter based on filenames
|
||||||
// where the logs were generated.
|
// where the logs were generated.
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-bug_923281_console_log_filter.html";
|
"use strict";
|
||||||
|
|
||||||
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-bug_923281_console_log_filter.html";
|
||||||
|
|
||||||
let hud;
|
let hud;
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
let test = asyncTest(function* () {
|
let test = asyncTest(function* () {
|
||||||
yield loadTab(TEST_URI);
|
yield loadTab(TEST_URI);
|
||||||
|
|
||||||
|
@ -32,7 +33,7 @@ function consoleOpened() {
|
||||||
category: CATEGORY_WEBDEV,
|
category: CATEGORY_WEBDEV,
|
||||||
severity: SEVERITY_LOG
|
severity: SEVERITY_LOG
|
||||||
}],
|
}],
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function testLiveFilteringOnSearchStrings() {
|
function testLiveFilteringOnSearchStrings() {
|
||||||
|
@ -74,9 +75,8 @@ function countMessageNodes() {
|
||||||
return displayedMessageNodes;
|
return displayedMessageNodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setStringFilter(aValue)
|
function setStringFilter(value) {
|
||||||
{
|
hud.ui.filterBox.value = value;
|
||||||
hud.ui.filterBox.value = aValue;
|
|
||||||
hud.ui.adjustVisibilityOnSearchStringChange();
|
hud.ui.adjustVisibilityOnSearchStringChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console.html";
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console.html";
|
||||||
|
|
||||||
let test = asyncTest(function*() {
|
let test = asyncTest(function*() {
|
||||||
yield loadTab(TEST_URI);
|
yield loadTab(TEST_URI);
|
||||||
|
|
|
@ -12,11 +12,16 @@
|
||||||
|
|
||||||
// Tests that network log messages bring up the network panel.
|
// Tests that network log messages bring up the network panel.
|
||||||
|
|
||||||
const TEST_URI = "data:text/html;charset=utf-8,Web Console network logging tests";
|
"use strict";
|
||||||
|
|
||||||
const TEST_NETWORK_REQUEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-network-request.html";
|
const TEST_URI = "data:text/html;charset=utf-8,Web Console network " +
|
||||||
|
"logging tests";
|
||||||
|
|
||||||
const TEST_IMG = "http://example.com/browser/browser/devtools/webconsole/test/test-image.png";
|
const TEST_NETWORK_REQUEST_URI = "http://example.com/browser/browser/" +
|
||||||
|
"devtools/webconsole/test/test-network-request.html";
|
||||||
|
|
||||||
|
const TEST_IMG = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-image.png";
|
||||||
|
|
||||||
const TEST_DATA_JSON_CONTENT =
|
const TEST_DATA_JSON_CONTENT =
|
||||||
'{ id: "test JSON data", myArray: [ "foo", "bar", "baz", "biff" ] }';
|
'{ id: "test JSON data", myArray: [ "foo", "bar", "baz", "biff" ] }';
|
||||||
|
@ -25,8 +30,7 @@ let lastRequest = null;
|
||||||
let requestCallback = null;
|
let requestCallback = null;
|
||||||
let browser, hud;
|
let browser, hud;
|
||||||
|
|
||||||
function test()
|
function test() {
|
||||||
{
|
|
||||||
loadTab(TEST_URI).then((tab) => {
|
loadTab(TEST_URI).then((tab) => {
|
||||||
browser = tab.browser;
|
browser = tab.browser;
|
||||||
|
|
||||||
|
@ -40,9 +44,8 @@ function test()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function requestCallbackWrapper(aRequest)
|
function requestCallbackWrapper(request) {
|
||||||
{
|
lastRequest = request;
|
||||||
lastRequest = aRequest;
|
|
||||||
|
|
||||||
hud.ui.webConsoleClient.getResponseContent(lastRequest.actor,
|
hud.ui.webConsoleClient.getResponseContent(lastRequest.actor,
|
||||||
function(aResponse) {
|
function(aResponse) {
|
||||||
|
@ -50,9 +53,9 @@ function requestCallbackWrapper(aRequest)
|
||||||
lastRequest.discardResponseBody = aResponse.contentDiscarded;
|
lastRequest.discardResponseBody = aResponse.contentDiscarded;
|
||||||
|
|
||||||
hud.ui.webConsoleClient.getRequestPostData(lastRequest.actor,
|
hud.ui.webConsoleClient.getRequestPostData(lastRequest.actor,
|
||||||
function(aResponse) {
|
function(response) {
|
||||||
lastRequest.request.postData = aResponse.postData;
|
lastRequest.request.postData = response.postData;
|
||||||
lastRequest.discardRequestBody = aResponse.postDataDiscarded;
|
lastRequest.discardRequestBody = response.postDataDiscarded;
|
||||||
|
|
||||||
if (requestCallback) {
|
if (requestCallback) {
|
||||||
requestCallback();
|
requestCallback();
|
||||||
|
@ -61,8 +64,7 @@ function requestCallbackWrapper(aRequest)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function testPageLoad()
|
function testPageLoad() {
|
||||||
{
|
|
||||||
requestCallback = function() {
|
requestCallback = function() {
|
||||||
// Check if page load was logged correctly.
|
// Check if page load was logged correctly.
|
||||||
ok(lastRequest, "Page load was logged");
|
ok(lastRequest, "Page load was logged");
|
||||||
|
@ -84,8 +86,7 @@ function testPageLoad()
|
||||||
content.location = TEST_NETWORK_REQUEST_URI;
|
content.location = TEST_NETWORK_REQUEST_URI;
|
||||||
}
|
}
|
||||||
|
|
||||||
function testPageLoadBody()
|
function testPageLoadBody() {
|
||||||
{
|
|
||||||
// Turn on logging of request bodies and check again.
|
// Turn on logging of request bodies and check again.
|
||||||
hud.ui.setSaveRequestAndResponseBodies(true).then(() => {
|
hud.ui.setSaveRequestAndResponseBodies(true).then(() => {
|
||||||
ok(hud.ui._saveRequestAndResponseBodies,
|
ok(hud.ui._saveRequestAndResponseBodies,
|
||||||
|
@ -95,8 +96,7 @@ function testPageLoadBody()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function testPageLoadBodyAfterSettingUpdate()
|
function testPageLoadBodyAfterSettingUpdate() {
|
||||||
{
|
|
||||||
let loaded = false;
|
let loaded = false;
|
||||||
let requestCallbackInvoked = false;
|
let requestCallbackInvoked = false;
|
||||||
|
|
||||||
|
@ -127,8 +127,7 @@ function testPageLoadBodyAfterSettingUpdate()
|
||||||
content.location.reload();
|
content.location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
function testXhrGet()
|
function testXhrGet() {
|
||||||
{
|
|
||||||
requestCallback = function() {
|
requestCallback = function() {
|
||||||
ok(lastRequest, "testXhrGet() was logged");
|
ok(lastRequest, "testXhrGet() was logged");
|
||||||
is(lastRequest.request.method, "GET", "Method is correct");
|
is(lastRequest.request.method, "GET", "Method is correct");
|
||||||
|
@ -146,8 +145,7 @@ function testXhrGet()
|
||||||
content.wrappedJSObject.testXhrGet();
|
content.wrappedJSObject.testXhrGet();
|
||||||
}
|
}
|
||||||
|
|
||||||
function testXhrPost()
|
function testXhrPost() {
|
||||||
{
|
|
||||||
requestCallback = function() {
|
requestCallback = function() {
|
||||||
ok(lastRequest, "testXhrPost() was logged");
|
ok(lastRequest, "testXhrPost() was logged");
|
||||||
is(lastRequest.request.method, "POST", "Method is correct");
|
is(lastRequest.request.method, "POST", "Method is correct");
|
||||||
|
@ -165,20 +163,19 @@ function testXhrPost()
|
||||||
content.wrappedJSObject.testXhrPost();
|
content.wrappedJSObject.testXhrPost();
|
||||||
}
|
}
|
||||||
|
|
||||||
function testFormSubmission()
|
function testFormSubmission() {
|
||||||
{
|
|
||||||
// Start the form submission test. As the form is submitted, the page is
|
// Start the form submission test. As the form is submitted, the page is
|
||||||
// loaded again. Bind to the load event to catch when this is done.
|
// loaded again. Bind to the load event to catch when this is done.
|
||||||
requestCallback = function() {
|
requestCallback = function() {
|
||||||
ok(lastRequest, "testFormSubmission() was logged");
|
ok(lastRequest, "testFormSubmission() was logged");
|
||||||
is(lastRequest.request.method, "POST", "Method is correct");
|
is(lastRequest.request.method, "POST", "Method is correct");
|
||||||
isnot(lastRequest.request.postData.text.
|
isnot(lastRequest.request.postData.text
|
||||||
indexOf("Content-Type: application/x-www-form-urlencoded"), -1,
|
.indexOf("Content-Type: application/x-www-form-urlencoded"), -1,
|
||||||
"Content-Type is correct");
|
"Content-Type is correct");
|
||||||
isnot(lastRequest.request.postData.text.
|
isnot(lastRequest.request.postData.text
|
||||||
indexOf("Content-Length: 20"), -1, "Content-length is correct");
|
.indexOf("Content-Length: 20"), -1, "Content-length is correct");
|
||||||
isnot(lastRequest.request.postData.text.
|
isnot(lastRequest.request.postData.text
|
||||||
indexOf("name=foo+bar&age=144"), -1, "Form data is correct");
|
.indexOf("name=foo+bar&age=144"), -1, "Form data is correct");
|
||||||
is(lastRequest.response.content.text.indexOf("<!DOCTYPE HTML>"), 0,
|
is(lastRequest.response.content.text.indexOf("<!DOCTYPE HTML>"), 0,
|
||||||
"Response body's beginning is okay");
|
"Response body's beginning is okay");
|
||||||
|
|
||||||
|
@ -191,9 +188,7 @@ function testFormSubmission()
|
||||||
}`);
|
}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function testNetworkPanel() {
|
||||||
function testNetworkPanel()
|
|
||||||
{
|
|
||||||
// Open the NetworkPanel. The functionality of the NetworkPanel is tested
|
// Open the NetworkPanel. The functionality of the NetworkPanel is tested
|
||||||
// within separate test files.
|
// within separate test files.
|
||||||
let networkPanel = hud.ui.openNetworkPanel(hud.ui.filterBox, lastRequest);
|
let networkPanel = hud.ui.openNetworkPanel(hud.ui.filterBox, lastRequest);
|
||||||
|
@ -213,4 +208,3 @@ function testNetworkPanel()
|
||||||
executeSoon(finishTest);
|
executeSoon(finishTest);
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,14 +3,19 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
const TEST_URI = "data:text/html;charset=utf-8,<p>Web Console test for notifications";
|
"use strict";
|
||||||
|
|
||||||
|
const TEST_URI = "data:text/html;charset=utf-8,<p>Web Console test for " +
|
||||||
|
"notifications";
|
||||||
|
|
||||||
let test = asyncTest(function* () {
|
let test = asyncTest(function* () {
|
||||||
yield loadTab(TEST_URI);
|
yield loadTab(TEST_URI);
|
||||||
|
|
||||||
let consoleOpened = promise.defer();
|
let consoleOpened = promise.defer();
|
||||||
let gotEvents = waitForEvents(consoleOpened.promise);
|
let gotEvents = waitForEvents(consoleOpened.promise);
|
||||||
let hud = yield openConsole().then(() => consoleOpened.resolve());
|
yield openConsole().then(() => {
|
||||||
|
consoleOpened.resolve();
|
||||||
|
});
|
||||||
|
|
||||||
yield gotEvents;
|
yield gotEvents;
|
||||||
});
|
});
|
||||||
|
@ -18,25 +23,22 @@ let test = asyncTest(function* () {
|
||||||
function waitForEvents(onConsoleOpened) {
|
function waitForEvents(onConsoleOpened) {
|
||||||
let deferred = promise.defer();
|
let deferred = promise.defer();
|
||||||
|
|
||||||
function webConsoleCreated(aID)
|
function webConsoleCreated(id) {
|
||||||
{
|
|
||||||
Services.obs.removeObserver(observer, "web-console-created");
|
Services.obs.removeObserver(observer, "web-console-created");
|
||||||
ok(HUDService.getHudReferenceById(aID), "We have a hud reference");
|
ok(HUDService.getHudReferenceById(id), "We have a hud reference");
|
||||||
content.wrappedJSObject.console.log("adding a log message");
|
content.wrappedJSObject.console.log("adding a log message");
|
||||||
}
|
}
|
||||||
|
|
||||||
function webConsoleDestroyed(aID)
|
function webConsoleDestroyed(id) {
|
||||||
{
|
|
||||||
Services.obs.removeObserver(observer, "web-console-destroyed");
|
Services.obs.removeObserver(observer, "web-console-destroyed");
|
||||||
ok(!HUDService.getHudReferenceById(aID), "We do not have a hud reference");
|
ok(!HUDService.getHudReferenceById(id), "We do not have a hud reference");
|
||||||
executeSoon(deferred.resolve);
|
executeSoon(deferred.resolve);
|
||||||
}
|
}
|
||||||
|
|
||||||
function webConsoleMessage(aID, aNodeID)
|
function webConsoleMessage(id, nodeID) {
|
||||||
{
|
|
||||||
Services.obs.removeObserver(observer, "web-console-message-created");
|
Services.obs.removeObserver(observer, "web-console-message-created");
|
||||||
ok(aID, "we have a console ID");
|
ok(id, "we have a console ID");
|
||||||
is(typeof aNodeID, "string", "message node id is a string");
|
is(typeof nodeID, "string", "message node id is a string");
|
||||||
onConsoleOpened.then(closeConsole);
|
onConsoleOpened.then(closeConsole);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,32 +46,30 @@ function waitForEvents(onConsoleOpened) {
|
||||||
|
|
||||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
|
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
|
||||||
|
|
||||||
observe: function observe(aSubject, aTopic, aData)
|
observe: function observe(subject, topic, data) {
|
||||||
{
|
subject = subject.QueryInterface(Ci.nsISupportsString);
|
||||||
aSubject = aSubject.QueryInterface(Ci.nsISupportsString);
|
|
||||||
|
|
||||||
switch(aTopic) {
|
switch (topic) {
|
||||||
case "web-console-created":
|
case "web-console-created":
|
||||||
webConsoleCreated(aSubject.data);
|
webConsoleCreated(subject.data);
|
||||||
break;
|
break;
|
||||||
case "web-console-destroyed":
|
case "web-console-destroyed":
|
||||||
webConsoleDestroyed(aSubject.data);
|
webConsoleDestroyed(subject.data);
|
||||||
break;
|
break;
|
||||||
case "web-console-message-created":
|
case "web-console-message-created":
|
||||||
webConsoleMessage(aSubject, aData);
|
webConsoleMessage(subject, data);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
init: function init()
|
init: function init() {
|
||||||
{
|
|
||||||
Services.obs.addObserver(this, "web-console-created", false);
|
Services.obs.addObserver(this, "web-console-created", false);
|
||||||
Services.obs.addObserver(this, "web-console-destroyed", false);
|
Services.obs.addObserver(this, "web-console-destroyed", false);
|
||||||
Services.obs.addObserver(this, "web-console-message-created", false);
|
Services.obs.addObserver(this, "web-console-message-created", false);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
observer.init();
|
observer.init();
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,8 @@
|
||||||
function test() {
|
function test() {
|
||||||
function* runner() {
|
function* runner() {
|
||||||
const TEST_EVAL_STRING = "document";
|
const TEST_EVAL_STRING = "document";
|
||||||
const TEST_PAGE_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console.html";
|
const TEST_PAGE_URI = "http://example.com/browser/browser/devtools/" +
|
||||||
|
"webconsole/test/test-console.html";
|
||||||
const {tab} = yield loadTab(TEST_PAGE_URI);
|
const {tab} = yield loadTab(TEST_PAGE_URI);
|
||||||
const hud = yield openConsole(tab);
|
const hud = yield openConsole(tab);
|
||||||
|
|
||||||
|
@ -40,7 +41,7 @@ function test() {
|
||||||
if (aLink == TEST_PAGE_URI) {
|
if (aLink == TEST_PAGE_URI) {
|
||||||
linkOpened = true;
|
linkOpened = true;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
EventUtils.synthesizeMouseAtCenter(urlNode, {}, hud.iframeWindow);
|
EventUtils.synthesizeMouseAtCenter(urlNode, {}, hud.iframeWindow);
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,12 @@
|
||||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
///////////////////
|
|
||||||
//
|
|
||||||
// Whitelisting this test.
|
// Whitelisting this test.
|
||||||
// As part of bug 1077403, the leaking uncaught rejection should be fixed.
|
// As part of bug 1077403, the leaking uncaught rejection should be fixed.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
thisTestLeaksUncaughtRejectionsAndShouldBeFixed("null");
|
thisTestLeaksUncaughtRejectionsAndShouldBeFixed("null");
|
||||||
|
|
||||||
// Test the webconsole output for various types of objects.
|
// Test the webconsole output for various types of objects.
|
||||||
|
|
|
@ -5,7 +5,10 @@
|
||||||
|
|
||||||
// Test the webconsole output for various types of objects.
|
// Test the webconsole output for various types of objects.
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console-output-02.html";
|
"use strict";
|
||||||
|
|
||||||
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console-output-02.html";
|
||||||
|
|
||||||
let inputTests = [
|
let inputTests = [
|
||||||
// 0 - native named function
|
// 0 - native named function
|
||||||
|
@ -64,8 +67,8 @@ let inputTests = [
|
||||||
// 6 - array with objects
|
// 6 - array with objects
|
||||||
{
|
{
|
||||||
input: "window.array2",
|
input: "window.array2",
|
||||||
output: 'Array [ "a", HTMLDocument \u2192 test-console-output-02.html, <body>, ' +
|
output: 'Array [ "a", HTMLDocument \u2192 test-console-output-02.html, ' +
|
||||||
"DOMStringMap[0], DOMTokenList[0] ]",
|
"<body>, DOMStringMap[0], DOMTokenList[0] ]",
|
||||||
printOutput: '"a,[object HTMLDocument],[object HTMLBodyElement],' +
|
printOutput: '"a,[object HTMLDocument],[object HTMLBodyElement],' +
|
||||||
'[object DOMStringMap],"',
|
'[object DOMStringMap],"',
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
|
@ -75,8 +78,9 @@ let inputTests = [
|
||||||
// 7 - array with more than 10 elements
|
// 7 - array with more than 10 elements
|
||||||
{
|
{
|
||||||
input: "window.array3",
|
input: "window.array3",
|
||||||
output: 'Array [ 1, Window \u2192 test-console-output-02.html, null, "a", "b", ' +
|
output: 'Array [ 1, Window \u2192 test-console-output-02.html, null, ' +
|
||||||
'undefined, false, "", -Infinity, testfn3DisplayName(), 3 more\u2026 ]',
|
'"a", "b", undefined, false, "", -Infinity, ' +
|
||||||
|
'testfn3DisplayName(), 3 more\u2026 ]',
|
||||||
printOutput: '"1,[object Window],,a,b,,false,,-Infinity,' +
|
printOutput: '"1,[object Window],,a,b,,false,,-Infinity,' +
|
||||||
'function testfn3() { return 42; },[object Object],foo,bar"',
|
'function testfn3() { return 42; },[object Object],foo,bar"',
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
|
@ -104,7 +108,8 @@ let inputTests = [
|
||||||
// 10 - Set with cyclic reference
|
// 10 - Set with cyclic reference
|
||||||
{
|
{
|
||||||
input: "window.set1",
|
input: "window.set1",
|
||||||
output: 'Set [ 1, 2, null, Array[13], "a", "b", undefined, <head>, Set[9] ]',
|
output: 'Set [ 1, 2, null, Array[13], "a", "b", undefined, <head>, ' +
|
||||||
|
'Set[9] ]',
|
||||||
printOutput: "[object Set]",
|
printOutput: "[object Set]",
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
variablesViewLabel: "Set[9]",
|
variablesViewLabel: "Set[9]",
|
||||||
|
@ -113,8 +118,8 @@ let inputTests = [
|
||||||
// 11 - Object with cyclic reference and a getter
|
// 11 - Object with cyclic reference and a getter
|
||||||
{
|
{
|
||||||
input: "window.testobj2",
|
input: "window.testobj2",
|
||||||
output: 'Object { a: "b", c: "d", e: 1, f: "2", foo: Object, bar: Object, ' +
|
output: 'Object { a: "b", c: "d", e: 1, f: "2", foo: Object, ' +
|
||||||
"getterTest: Getter }",
|
"bar: Object, getterTest: Getter }",
|
||||||
printOutput: "[object Object]",
|
printOutput: "[object Object]",
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
variablesViewLabel: "Object",
|
variablesViewLabel: "Object",
|
||||||
|
@ -123,8 +128,9 @@ let inputTests = [
|
||||||
// 12 - Object with more than 10 properties
|
// 12 - Object with more than 10 properties
|
||||||
{
|
{
|
||||||
input: "window.testobj3",
|
input: "window.testobj3",
|
||||||
output: 'Object { a: "b", c: "d", e: 1, f: "2", g: true, h: null, i: undefined, ' +
|
output: 'Object { a: "b", c: "d", e: 1, f: "2", g: true, h: null, ' +
|
||||||
'j: "", k: StyleSheetList[0], l: NodeList[5], 2 more\u2026 }',
|
'i: undefined, j: "", k: StyleSheetList[0], l: NodeList[5], ' +
|
||||||
|
'2 more\u2026 }',
|
||||||
printOutput: "[object Object]",
|
printOutput: "[object Object]",
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
variablesViewLabel: "Object",
|
variablesViewLabel: "Object",
|
||||||
|
|
|
@ -5,7 +5,10 @@
|
||||||
|
|
||||||
// Test the webconsole output for various types of objects.
|
// Test the webconsole output for various types of objects.
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console-output-03.html";
|
"use strict";
|
||||||
|
|
||||||
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console-output-03.html";
|
||||||
|
|
||||||
let inputTests = [
|
let inputTests = [
|
||||||
|
|
||||||
|
|
|
@ -3,16 +3,18 @@
|
||||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
///////////////////
|
|
||||||
//
|
|
||||||
// Whitelisting this test.
|
// Whitelisting this test.
|
||||||
// As part of bug 1077403, the leaking uncaught rejection should be fixed.
|
// As part of bug 1077403, the leaking uncaught rejection should be fixed.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
thisTestLeaksUncaughtRejectionsAndShouldBeFixed("null");
|
thisTestLeaksUncaughtRejectionsAndShouldBeFixed("null");
|
||||||
|
|
||||||
// Test the webconsole output for various types of objects.
|
// Test the webconsole output for various types of objects.
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console-output-04.html";
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console-output-04.html";
|
||||||
|
|
||||||
let inputTests = [
|
let inputTests = [
|
||||||
// 0
|
// 0
|
||||||
|
@ -36,7 +38,7 @@ let inputTests = [
|
||||||
// 2
|
// 2
|
||||||
{
|
{
|
||||||
input: "testDocumentFragment()",
|
input: "testDocumentFragment()",
|
||||||
output: 'DocumentFragment [ <div#foo1.bar>, <div#foo3> ]',
|
output: "DocumentFragment [ <div#foo1.bar>, <div#foo3> ]",
|
||||||
printOutput: "[object DocumentFragment]",
|
printOutput: "[object DocumentFragment]",
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
variablesViewLabel: "DocumentFragment[2]",
|
variablesViewLabel: "DocumentFragment[2]",
|
||||||
|
@ -56,7 +58,8 @@ let inputTests = [
|
||||||
// 4
|
// 4
|
||||||
{
|
{
|
||||||
input: "testDOMException()",
|
input: "testDOMException()",
|
||||||
output: 'DOMException [SyntaxError: "An invalid or illegal string was specified"',
|
output: 'DOMException [SyntaxError: "An invalid or illegal string was ' +
|
||||||
|
'specified"',
|
||||||
printOutput: '"SyntaxError: An invalid or illegal string was specified"',
|
printOutput: '"SyntaxError: An invalid or illegal string was specified"',
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
variablesViewLabel: "SyntaxError",
|
variablesViewLabel: "SyntaxError",
|
||||||
|
|
|
@ -5,8 +5,11 @@
|
||||||
|
|
||||||
// Test the webconsole output for various types of objects.
|
// Test the webconsole output for various types of objects.
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
const TEST_URI = "data:text/html;charset=utf8,test for console output - 05";
|
const TEST_URI = "data:text/html;charset=utf8,test for console output - 05";
|
||||||
const ELLIPSIS = Services.prefs.getComplexValue("intl.ellipsis", Ci.nsIPrefLocalizedString).data;
|
const ELLIPSIS = Services.prefs.getComplexValue("intl.ellipsis",
|
||||||
|
Ci.nsIPrefLocalizedString).data;
|
||||||
|
|
||||||
let dateNow = Date.now();
|
let dateNow = Date.now();
|
||||||
|
|
||||||
|
@ -99,7 +102,8 @@ let inputTests = [
|
||||||
|
|
||||||
// 10
|
// 10
|
||||||
{
|
{
|
||||||
input: "(function () { var p = new Promise(function () {}); p.foo = 1; return p; }())",
|
input: "(function () { var p = new Promise(function () {}); " +
|
||||||
|
"p.foo = 1; return p; }())",
|
||||||
output: 'Promise { <state>: "pending", foo: 1 }',
|
output: 'Promise { <state>: "pending", foo: 1 }',
|
||||||
printOutput: "[object Promise]",
|
printOutput: "[object Promise]",
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
|
@ -108,8 +112,11 @@ let inputTests = [
|
||||||
|
|
||||||
// 11
|
// 11
|
||||||
{
|
{
|
||||||
input: "new Object({1: 'this\\nis\\nsupposed\\nto\\nbe\\na\\nvery\\nlong\\nstring\\n,shown\\non\\na\\nsingle\\nline', 2: 'a shorter string', 3: 100})",
|
input: "new Object({1: 'this\\nis\\nsupposed\\nto\\nbe\\na\\nvery" +
|
||||||
output: 'Object { 1: "this is supposed to be a very long ' + ELLIPSIS + '", 2: "a shorter string", 3: 100 }',
|
"\\nlong\\nstring\\n,shown\\non\\na\\nsingle\\nline', " +
|
||||||
|
"2: 'a shorter string', 3: 100})",
|
||||||
|
output: 'Object { 1: "this is supposed to be a very long ' + ELLIPSIS +
|
||||||
|
'", 2: "a shorter string", 3: 100 }',
|
||||||
printOutput: "[object Object]",
|
printOutput: "[object Object]",
|
||||||
inspectable: false,
|
inspectable: false,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,84 +1,87 @@
|
||||||
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
|
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
|
||||||
/* Any copyright is dedicated to the Public Domain.
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// Test the webconsole output for various arrays.
|
// Test the webconsole output for various arrays.
|
||||||
|
|
||||||
const TEST_URI = "data:text/html;charset=utf8,test for console output - 06";
|
const TEST_URI = "data:text/html;charset=utf8,test for console output - 06";
|
||||||
const ELLIPSIS = Services.prefs.getComplexValue("intl.ellipsis", Ci.nsIPrefLocalizedString).data;
|
const ELLIPSIS = Services.prefs.getComplexValue("intl.ellipsis",
|
||||||
const test_str_in = "SHOW\\nALL\\nOF\\nTHIS\\nON\\nA\\nSINGLE\\nLINE ONLY. ESCAPE ALL NEWLINE";
|
Ci.nsIPrefLocalizedString).data;
|
||||||
const test_str_out = "SHOW ALL OF THIS ON A SINGLE LINE O" + ELLIPSIS;
|
const testStrIn = "SHOW\\nALL\\nOF\\nTHIS\\nON\\nA\\nSINGLE" +
|
||||||
|
"\\nLINE ONLY. ESCAPE ALL NEWLINE";
|
||||||
|
const testStrOut = "SHOW ALL OF THIS ON A SINGLE LINE O" + ELLIPSIS;
|
||||||
|
|
||||||
let inputTests = [
|
let inputTests = [
|
||||||
// 1 - array with empty slots only
|
// 1 - array with empty slots only
|
||||||
{
|
{
|
||||||
input: 'Array(5)',
|
input: "Array(5)",
|
||||||
output: 'Array [ <5 empty slots> ]',
|
output: "Array [ <5 empty slots> ]",
|
||||||
printOutput: ',,,,',
|
printOutput: ",,,,",
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
variablesViewLabel: "Array[5]",
|
variablesViewLabel: "Array[5]",
|
||||||
},
|
},
|
||||||
// 2 - array with one empty slot at the beginning
|
// 2 - array with one empty slot at the beginning
|
||||||
{
|
{
|
||||||
input: '[,1,2,3]',
|
input: "[,1,2,3]",
|
||||||
output: 'Array [ <1 empty slot>, 1, 2, 3 ]',
|
output: "Array [ <1 empty slot>, 1, 2, 3 ]",
|
||||||
printOutput: ",1,2,3",
|
printOutput: ",1,2,3",
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
variablesViewLabel: "Array[4]",
|
variablesViewLabel: "Array[4]",
|
||||||
},
|
},
|
||||||
// 3 - array with multiple consecutive empty slots at the beginning
|
// 3 - array with multiple consecutive empty slots at the beginning
|
||||||
{
|
{
|
||||||
input: '[,,,3,4,5]',
|
input: "[,,,3,4,5]",
|
||||||
output: 'Array [ <3 empty slots>, 3, 4, 5 ]',
|
output: "Array [ <3 empty slots>, 3, 4, 5 ]",
|
||||||
printOutput: ",,,3,4,5",
|
printOutput: ",,,3,4,5",
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
variablesViewLabel: "Array[6]",
|
variablesViewLabel: "Array[6]",
|
||||||
},
|
},
|
||||||
// 4 - array with one empty slot at the middle
|
// 4 - array with one empty slot at the middle
|
||||||
{
|
{
|
||||||
input: '[0,1,,3,4,5]',
|
input: "[0,1,,3,4,5]",
|
||||||
output: 'Array [ 0, 1, <1 empty slot>, 3, 4, 5 ]',
|
output: "Array [ 0, 1, <1 empty slot>, 3, 4, 5 ]",
|
||||||
printOutput: "0,1,,3,4,5",
|
printOutput: "0,1,,3,4,5",
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
variablesViewLabel: "Array[6]",
|
variablesViewLabel: "Array[6]",
|
||||||
},
|
},
|
||||||
// 5 - array with multiple successive empty slots at the middle
|
// 5 - array with multiple successive empty slots at the middle
|
||||||
{
|
{
|
||||||
input: '[0,1,,,,5]',
|
input: "[0,1,,,,5]",
|
||||||
output: 'Array [ 0, 1, <3 empty slots>, 5 ]',
|
output: "Array [ 0, 1, <3 empty slots>, 5 ]",
|
||||||
printOutput: "0,1,,,,5",
|
printOutput: "0,1,,,,5",
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
variablesViewLabel: "Array[6]",
|
variablesViewLabel: "Array[6]",
|
||||||
},
|
},
|
||||||
// 6 - array with multiple non successive single empty slots
|
// 6 - array with multiple non successive single empty slots
|
||||||
{
|
{
|
||||||
input: '[0,,2,,4,5]',
|
input: "[0,,2,,4,5]",
|
||||||
output: 'Array [ 0, <1 empty slot>, 2, <1 empty slot>, 4, 5 ]',
|
output: "Array [ 0, <1 empty slot>, 2, <1 empty slot>, 4, 5 ]",
|
||||||
printOutput: "0,,2,,4,5",
|
printOutput: "0,,2,,4,5",
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
variablesViewLabel: "Array[6]",
|
variablesViewLabel: "Array[6]",
|
||||||
},
|
},
|
||||||
// 7 - array with multiple multi-slot holes
|
// 7 - array with multiple multi-slot holes
|
||||||
{
|
{
|
||||||
input: '[0,,,3,,,,7,8]',
|
input: "[0,,,3,,,,7,8]",
|
||||||
output: 'Array [ 0, <2 empty slots>, 3, <3 empty slots>, 7, 8 ]',
|
output: "Array [ 0, <2 empty slots>, 3, <3 empty slots>, 7, 8 ]",
|
||||||
printOutput: "0,,,3,,,,7,8",
|
printOutput: "0,,,3,,,,7,8",
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
variablesViewLabel: "Array[9]",
|
variablesViewLabel: "Array[9]",
|
||||||
},
|
},
|
||||||
// 8 - array with a single slot hole at the end
|
// 8 - array with a single slot hole at the end
|
||||||
{
|
{
|
||||||
input: '[0,1,2,3,4,,]',
|
input: "[0,1,2,3,4,,]",
|
||||||
output: 'Array [ 0, 1, 2, 3, 4, <1 empty slot> ]',
|
output: "Array [ 0, 1, 2, 3, 4, <1 empty slot> ]",
|
||||||
printOutput: "0,1,2,3,4,",
|
printOutput: "0,1,2,3,4,",
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
variablesViewLabel: "Array[6]",
|
variablesViewLabel: "Array[6]",
|
||||||
},
|
},
|
||||||
// 9 - array with multiple consecutive empty slots at the end
|
// 9 - array with multiple consecutive empty slots at the end
|
||||||
{
|
{
|
||||||
input: '[0,1,2,,,,]',
|
input: "[0,1,2,,,,]",
|
||||||
output: 'Array [ 0, 1, 2, <3 empty slots> ]',
|
output: "Array [ 0, 1, 2, <3 empty slots> ]",
|
||||||
printOutput: "0,1,2,,,",
|
printOutput: "0,1,2,,,",
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
variablesViewLabel: "Array[6]",
|
variablesViewLabel: "Array[6]",
|
||||||
|
@ -86,8 +89,8 @@ let inputTests = [
|
||||||
|
|
||||||
// 10 - array with members explicitly set to null
|
// 10 - array with members explicitly set to null
|
||||||
{
|
{
|
||||||
input: '[0,null,null,3,4,5]',
|
input: "[0,null,null,3,4,5]",
|
||||||
output: 'Array [ 0, null, null, 3, 4, 5 ]',
|
output: "Array [ 0, null, null, 3, 4, 5 ]",
|
||||||
printOutput: "0,,,3,4,5",
|
printOutput: "0,,,3,4,5",
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
variablesViewLabel: "Array[6]"
|
variablesViewLabel: "Array[6]"
|
||||||
|
@ -95,8 +98,8 @@ let inputTests = [
|
||||||
|
|
||||||
// 11 - array with members explicitly set to undefined
|
// 11 - array with members explicitly set to undefined
|
||||||
{
|
{
|
||||||
input: '[0,undefined,undefined,3,4,5]',
|
input: "[0,undefined,undefined,3,4,5]",
|
||||||
output: 'Array [ 0, undefined, undefined, 3, 4, 5 ]',
|
output: "Array [ 0, undefined, undefined, 3, 4, 5 ]",
|
||||||
printOutput: "0,,,3,4,5",
|
printOutput: "0,,,3,4,5",
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
variablesViewLabel: "Array[6]"
|
variablesViewLabel: "Array[6]"
|
||||||
|
@ -104,10 +107,14 @@ let inputTests = [
|
||||||
|
|
||||||
// 12 - array with long strings as elements
|
// 12 - array with long strings as elements
|
||||||
{
|
{
|
||||||
input: '["' + test_str_in + '", "' + test_str_in + '", "' + test_str_in + '"]',
|
input: '["' + testStrIn + '", "' + testStrIn + '", "' + testStrIn + '"]',
|
||||||
output: 'Array [ "' + test_str_out + '", "' + test_str_out + '", "' + test_str_out + '" ]',
|
output: 'Array [ "' + testStrOut + '", "' + testStrOut + '", "' +
|
||||||
|
testStrOut + '" ]',
|
||||||
inspectable: false,
|
inspectable: false,
|
||||||
printOutput: "SHOW\nALL\nOF\nTHIS\nON\nA\nSINGLE\nLINE ONLY. ESCAPE ALL NEWLINE,SHOW\nALL\nOF\nTHIS\nON\nA\nSINGLE\nLINE ONLY. ESCAPE ALL NEWLINE,SHOW\nALL\nOF\nTHIS\nON\nA\nSINGLE\nLINE ONLY. ESCAPE ALL NEWLINE",
|
printOutput: "SHOW\nALL\nOF\nTHIS\nON\nA\nSINGLE\nLINE ONLY. ESCAPE " +
|
||||||
|
"ALL NEWLINE,SHOW\nALL\nOF\nTHIS\nON\nA\nSINGLE\nLINE ONLY. " +
|
||||||
|
"ESCAPE ALL NEWLINE,SHOW\nALL\nOF\nTHIS\nON\nA\nSINGLE\n" +
|
||||||
|
"LINE ONLY. ESCAPE ALL NEWLINE",
|
||||||
variablesViewLabel: "Array[3]"
|
variablesViewLabel: "Array[3]"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -129,8 +136,10 @@ let inputTests = [
|
||||||
|
|
||||||
// 15
|
// 15
|
||||||
{
|
{
|
||||||
input: '({0: "a", 1: "b", 2: "c", 3: "d", 4: "e", 5: "f", 6: "g", 7: "h", 8: "i", 9: "j", 10: "k", 11: "l"})',
|
input: '({0: "a", 1: "b", 2: "c", 3: "d", 4: "e", 5: "f", 6: "g", ' +
|
||||||
output: 'Object [ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", 2 more\u2026 ]',
|
'7: "h", 8: "i", 9: "j", 10: "k", 11: "l"})',
|
||||||
|
output: 'Object [ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", ' +
|
||||||
|
'2 more\u2026 ]',
|
||||||
printOutput: "[object Object]",
|
printOutput: "[object Object]",
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
variablesViewLabel: "Object[12]",
|
variablesViewLabel: "Object[12]",
|
||||||
|
@ -138,8 +147,10 @@ let inputTests = [
|
||||||
|
|
||||||
// 16
|
// 16
|
||||||
{
|
{
|
||||||
input: '({0: "a", 1: "b", 2: "c", 3: "d", 4: "e", 5: "f", 6: "g", 7: "h", 8: "i", 9: "j", 10: "k", 11: "l", m: "n"})',
|
input: '({0: "a", 1: "b", 2: "c", 3: "d", 4: "e", 5: "f", 6: "g", ' +
|
||||||
output: 'Object { 0: "a", 1: "b", 2: "c", 3: "d", 4: "e", 5: "f", 6: "g", 7: "h", 8: "i", 9: "j", 3 more\u2026 }',
|
'7: "h", 8: "i", 9: "j", 10: "k", 11: "l", m: "n"})',
|
||||||
|
output: 'Object { 0: "a", 1: "b", 2: "c", 3: "d", 4: "e", 5: "f", ' +
|
||||||
|
'6: "g", 7: "h", 8: "i", 9: "j", 3 more\u2026 }',
|
||||||
printOutput: "[object Object]",
|
printOutput: "[object Object]",
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
variablesViewLabel: "Object",
|
variablesViewLabel: "Object",
|
||||||
|
|
|
@ -14,8 +14,8 @@ let test = asyncTest(function*() {
|
||||||
let hud = yield openConsole();
|
let hud = yield openConsole();
|
||||||
hud.jsterm.clearOutput();
|
hud.jsterm.clearOutput();
|
||||||
|
|
||||||
let controller = top.document.commandDispatcher.
|
let controller = top.document.commandDispatcher
|
||||||
getControllerForCommand("cmd_copy");
|
.getControllerForCommand("cmd_copy");
|
||||||
is(controller.isCommandEnabled("cmd_copy"), false, "cmd_copy is disabled");
|
is(controller.isCommandEnabled("cmd_copy"), false, "cmd_copy is disabled");
|
||||||
|
|
||||||
content.console.log("Hello world! bug916997a");
|
content.console.log("Hello world! bug916997a");
|
||||||
|
@ -38,7 +38,8 @@ let test = asyncTest(function*() {
|
||||||
hud.outputNode.focus();
|
hud.outputNode.focus();
|
||||||
|
|
||||||
goUpdateCommand("cmd_copy");
|
goUpdateCommand("cmd_copy");
|
||||||
controller = top.document.commandDispatcher.getControllerForCommand("cmd_copy");
|
controller = top.document.commandDispatcher
|
||||||
|
.getControllerForCommand("cmd_copy");
|
||||||
is(controller.isCommandEnabled("cmd_copy"), true, "cmd_copy is enabled");
|
is(controller.isCommandEnabled("cmd_copy"), true, "cmd_copy is enabled");
|
||||||
|
|
||||||
let selection = hud.iframeWindow.getSelection() + "";
|
let selection = hud.iframeWindow.getSelection() + "";
|
||||||
|
@ -48,7 +49,9 @@ let test = asyncTest(function*() {
|
||||||
clipboardValue = str;
|
clipboardValue = str;
|
||||||
return str.indexOf("bug916997a") > -1 && str.indexOf("bug916997b") > -1;
|
return str.indexOf("bug916997a") > -1 && str.indexOf("bug916997b") > -1;
|
||||||
},
|
},
|
||||||
() => { goDoCommand("cmd_copy"); },
|
() => {
|
||||||
|
goDoCommand("cmd_copy");
|
||||||
|
},
|
||||||
() => {
|
() => {
|
||||||
info("clipboard value '" + clipboardValue + "'");
|
info("clipboard value '" + clipboardValue + "'");
|
||||||
let lines = clipboardValue.trim().split("\n");
|
let lines = clipboardValue.trim().split("\n");
|
||||||
|
|
|
@ -3,17 +3,18 @@
|
||||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
///////////////////
|
|
||||||
//
|
|
||||||
// Whitelisting this test.
|
// Whitelisting this test.
|
||||||
// As part of bug 1077403, the leaking uncaught rejections should be fixed.
|
// As part of bug 1077403, the leaking uncaught rejections should be fixed.
|
||||||
//
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
thisTestLeaksUncaughtRejectionsAndShouldBeFixed(null);
|
thisTestLeaksUncaughtRejectionsAndShouldBeFixed(null);
|
||||||
thisTestLeaksUncaughtRejectionsAndShouldBeFixed("TypeError: this.toolbox is null");
|
thisTestLeaksUncaughtRejectionsAndShouldBeFixed("TypeError: this.toolbox is null");
|
||||||
|
|
||||||
// Test the webconsole output for various types of DOM Nodes.
|
// Test the webconsole output for various types of DOM Nodes.
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console-output-dom-elements.html";
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console-output-dom-elements.html";
|
||||||
|
|
||||||
let inputTests = [
|
let inputTests = [
|
||||||
{
|
{
|
||||||
|
@ -36,7 +37,7 @@ let inputTests = [
|
||||||
|
|
||||||
{
|
{
|
||||||
input: "testDocument()",
|
input: "testDocument()",
|
||||||
output: 'HTMLDocument \u2192 ' + TEST_URI,
|
output: "HTMLDocument \u2192 " + TEST_URI,
|
||||||
printOutput: "[object HTMLDocument]",
|
printOutput: "[object HTMLDocument]",
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
noClick: true,
|
noClick: true,
|
||||||
|
@ -54,7 +55,9 @@ let inputTests = [
|
||||||
|
|
||||||
{
|
{
|
||||||
input: "testNodeList()",
|
input: "testNodeList()",
|
||||||
output: 'NodeList [ <html>, <head>, <meta>, <title>, <body#body-id.body-class>, <p>, <iframe>, <div.some.classname.here.with.more.classnames.here>, <script> ]',
|
output: "NodeList [ <html>, <head>, <meta>, <title>, " +
|
||||||
|
"<body#body-id.body-class>, <p>, <iframe>, " +
|
||||||
|
"<div.some.classname.here.with.more.classnames.here>, <script> ]",
|
||||||
printOutput: "[object NodeList]",
|
printOutput: "[object NodeList]",
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
noClick: true,
|
noClick: true,
|
||||||
|
@ -63,7 +66,7 @@ let inputTests = [
|
||||||
|
|
||||||
{
|
{
|
||||||
input: "testNodeInIframe()",
|
input: "testNodeInIframe()",
|
||||||
output: '<p>',
|
output: "<p>",
|
||||||
printOutput: "[object HTMLParagraphElement]",
|
printOutput: "[object HTMLParagraphElement]",
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
noClick: true,
|
noClick: true,
|
||||||
|
@ -72,7 +75,7 @@ let inputTests = [
|
||||||
|
|
||||||
{
|
{
|
||||||
input: "testDocumentFragment()",
|
input: "testDocumentFragment()",
|
||||||
output: 'DocumentFragment [ <span.foo>, <div#fragdiv> ]',
|
output: "DocumentFragment [ <span.foo>, <div#fragdiv> ]",
|
||||||
printOutput: "[object DocumentFragment]",
|
printOutput: "[object DocumentFragment]",
|
||||||
inspectable: true,
|
inspectable: true,
|
||||||
noClick: true,
|
noClick: true,
|
||||||
|
|
|
@ -6,35 +6,54 @@
|
||||||
// Test the inspector links in the webconsole output for DOM Nodes actually
|
// Test the inspector links in the webconsole output for DOM Nodes actually
|
||||||
// open the inspector and select the right node
|
// open the inspector and select the right node
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console-output-dom-elements.html";
|
"use strict";
|
||||||
|
|
||||||
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console-output-dom-elements.html";
|
||||||
|
|
||||||
const TEST_DATA = [
|
const TEST_DATA = [
|
||||||
{
|
{
|
||||||
// The first test shouldn't be returning the body element as this is the
|
// The first test shouldn't be returning the body element as this is the
|
||||||
// default selected node, so re-selecting it won't fire the inspector-updated
|
// default selected node, so re-selecting it won't fire the
|
||||||
// event
|
// inspector-updated event
|
||||||
input: "testNode()",
|
input: "testNode()",
|
||||||
output: '<p some-attribute="some-value">',
|
output: '<p some-attribute="some-value">',
|
||||||
tagName: 'P',
|
tagName: "P",
|
||||||
attrs: [{name: "some-attribute", value: "some-value"}]
|
attrs: [{name: "some-attribute", value: "some-value"}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: "testBodyNode()",
|
input: "testBodyNode()",
|
||||||
output: '<body id="body-id" class="body-class">',
|
output: '<body id="body-id" class="body-class">',
|
||||||
tagName: 'BODY',
|
tagName: "BODY",
|
||||||
attrs: [{name: "id", value: "body-id"}, {name: "class", value: "body-class"}]
|
attrs: [
|
||||||
|
{
|
||||||
|
name: "id", value: "body-id"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "class", value: "body-class"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: "testNodeInIframe()",
|
input: "testNodeInIframe()",
|
||||||
output: '<p>',
|
output: "<p>",
|
||||||
tagName: 'P',
|
tagName: "P",
|
||||||
attrs: []
|
attrs: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: "testDocumentElement()",
|
input: "testDocumentElement()",
|
||||||
output: '<html lang="en-US" dir="ltr">',
|
output: '<html lang="en-US" dir="ltr">',
|
||||||
tagName: 'HTML',
|
tagName: "HTML",
|
||||||
attrs: [{name: "lang", value: "en-US"}, {name: "dir", value: "ltr"}]
|
attrs: [
|
||||||
|
{
|
||||||
|
name: "lang",
|
||||||
|
value: "en-US"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "dir",
|
||||||
|
value: "ltr"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -53,12 +72,13 @@ function test() {
|
||||||
info("Iterating over the test data");
|
info("Iterating over the test data");
|
||||||
for (let data of TEST_DATA) {
|
for (let data of TEST_DATA) {
|
||||||
let [result] = yield jsEval(data.input, hud, {text: data.output});
|
let [result] = yield jsEval(data.input, hud, {text: data.output});
|
||||||
let {widget, msg} = yield getWidgetAndMessage(result);
|
let {msg} = yield getWidgetAndMessage(result);
|
||||||
|
|
||||||
let inspectorIcon = msg.querySelector(".open-inspector");
|
let inspectorIcon = msg.querySelector(".open-inspector");
|
||||||
ok(inspectorIcon, "Inspector icon found in the ElementNode widget");
|
ok(inspectorIcon, "Inspector icon found in the ElementNode widget");
|
||||||
|
|
||||||
info("Clicking on the inspector icon and waiting for the inspector to be selected");
|
info("Clicking on the inspector icon and waiting for the " +
|
||||||
|
"inspector to be selected");
|
||||||
let onInspectorSelected = toolbox.once("inspector-selected");
|
let onInspectorSelected = toolbox.once("inspector-selected");
|
||||||
let onInspectorUpdated = inspector.once("inspector-updated");
|
let onInspectorUpdated = inspector.once("inspector-updated");
|
||||||
let onNewNode = toolbox.selection.once("new-node-front");
|
let onNewNode = toolbox.selection.once("new-node-front");
|
||||||
|
@ -77,8 +97,10 @@ function test() {
|
||||||
|
|
||||||
let attrs = nodeFront.attributes;
|
let attrs = nodeFront.attributes;
|
||||||
for (let i in data.attrs) {
|
for (let i in data.attrs) {
|
||||||
is(attrs[i].name, data.attrs[i].name, "The correct node was highlighted");
|
is(attrs[i].name, data.attrs[i].name,
|
||||||
is(attrs[i].value, data.attrs[i].value, "The correct node was highlighted");
|
"The correct node was highlighted");
|
||||||
|
is(attrs[i].value, data.attrs[i].value,
|
||||||
|
"The correct node was highlighted");
|
||||||
}
|
}
|
||||||
|
|
||||||
info("Unhighlight the node by moving away from the markup view");
|
info("Unhighlight the node by moving away from the markup view");
|
||||||
|
|
|
@ -6,7 +6,10 @@
|
||||||
// Test that inspector links in webconsole outputs for DOM Nodes highlight
|
// Test that inspector links in webconsole outputs for DOM Nodes highlight
|
||||||
// the actual DOM Nodes on hover
|
// the actual DOM Nodes on hover
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console-output-dom-elements.html";
|
"use strict";
|
||||||
|
|
||||||
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console-output-dom-elements.html";
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
Task.spawn(function*() {
|
Task.spawn(function*() {
|
||||||
|
@ -17,7 +20,7 @@ function test() {
|
||||||
// Loading the inspector panel at first, to make it possible to listen for
|
// Loading the inspector panel at first, to make it possible to listen for
|
||||||
// new node selections
|
// new node selections
|
||||||
yield toolbox.loadTool("inspector");
|
yield toolbox.loadTool("inspector");
|
||||||
let inspector = toolbox.getPanel("inspector");
|
toolbox.getPanel("inspector");
|
||||||
|
|
||||||
info("Executing 'testNode()' in the web console to output a DOM Node");
|
info("Executing 'testNode()' in the web console to output a DOM Node");
|
||||||
let [result] = yield jsEval("testNode()", hud, {
|
let [result] = yield jsEval("testNode()", hud, {
|
||||||
|
|
|
@ -6,13 +6,16 @@
|
||||||
// Test that inspector links in the webconsole output for DOM Nodes do not try
|
// Test that inspector links in the webconsole output for DOM Nodes do not try
|
||||||
// to highlight or select nodes once they have been detached
|
// to highlight or select nodes once they have been detached
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console-output-dom-elements.html";
|
"use strict";
|
||||||
|
|
||||||
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console-output-dom-elements.html";
|
||||||
|
|
||||||
const TEST_DATA = [
|
const TEST_DATA = [
|
||||||
{
|
{
|
||||||
// The first test shouldn't be returning the body element as this is the
|
// The first test shouldn't be returning the body element as this is the
|
||||||
// default selected node, so re-selecting it won't fire the inspector-updated
|
// default selected node, so re-selecting it won't fire the
|
||||||
// event
|
// inspector-updated event
|
||||||
input: "testNode()",
|
input: "testNode()",
|
||||||
output: '<p some-attribute="some-value">'
|
output: '<p some-attribute="some-value">'
|
||||||
},
|
},
|
||||||
|
@ -22,7 +25,7 @@ const TEST_DATA = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: "testNodeInIframe()",
|
input: "testNodeInIframe()",
|
||||||
output: '<p>'
|
output: "<p>"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: "testDocumentElement()",
|
input: "testDocumentElement()",
|
||||||
|
|
|
@ -3,16 +3,17 @@
|
||||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
///////////////////
|
|
||||||
//
|
|
||||||
// Whitelisting this test.
|
// Whitelisting this test.
|
||||||
// As part of bug 1077403, the leaking uncaught rejection should be fixed.
|
// As part of bug 1077403, the leaking uncaught rejection should be fixed.
|
||||||
//
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
thisTestLeaksUncaughtRejectionsAndShouldBeFixed("null");
|
thisTestLeaksUncaughtRejectionsAndShouldBeFixed("null");
|
||||||
|
|
||||||
// Test the webconsole output for DOM events.
|
// Test the webconsole output for DOM events.
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console-output-events.html";
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console-output-events.html";
|
||||||
|
|
||||||
let test = asyncTest(function* () {
|
let test = asyncTest(function* () {
|
||||||
yield loadTab(TEST_URI);
|
yield loadTab(TEST_URI);
|
||||||
|
|
|
@ -8,19 +8,19 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console.html";
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console.html";
|
||||||
|
|
||||||
let test = asyncTest(function*() {
|
let test = asyncTest(function*() {
|
||||||
yield loadTab(TEST_URI);
|
yield loadTab(TEST_URI);
|
||||||
let hud = yield openConsole();
|
let hud = yield openConsole();
|
||||||
|
|
||||||
let jsterm = hud.jsterm;
|
let jsterm = hud.jsterm;
|
||||||
let outputNode = jsterm.outputNode;
|
|
||||||
|
|
||||||
jsterm.clearOutput();
|
jsterm.clearOutput();
|
||||||
jsterm.execute("console.log('foo', 'bar');");
|
jsterm.execute("console.log('foo', 'bar');");
|
||||||
|
|
||||||
let [function_call, result, console_message] = yield waitForMessages({
|
let [functionCall, result, consoleMessage] = yield waitForMessages({
|
||||||
webconsole: hud,
|
webconsole: hud,
|
||||||
messages: [{
|
messages: [{
|
||||||
text: "console.log('foo', 'bar');",
|
text: "console.log('foo', 'bar');",
|
||||||
|
@ -31,17 +31,17 @@ let test = asyncTest(function*() {
|
||||||
category: CATEGORY_OUTPUT,
|
category: CATEGORY_OUTPUT,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'foo bar',
|
text: "foo bar",
|
||||||
category: CATEGORY_WEBDEV,
|
category: CATEGORY_WEBDEV,
|
||||||
severity: SEVERITY_LOG,
|
severity: SEVERITY_LOG,
|
||||||
}],
|
}],
|
||||||
});
|
});
|
||||||
|
|
||||||
let fncall_node = [...function_call.matched][0];
|
let fncallNode = [...functionCall.matched][0];
|
||||||
let result_node = [...result.matched][0];
|
let resultNode = [...result.matched][0];
|
||||||
let console_message_node = [...console_message.matched][0];
|
let consoleMessageNode = [...consoleMessage.matched][0];
|
||||||
is(fncall_node.nextElementSibling, result_node,
|
is(fncallNode.nextElementSibling, resultNode,
|
||||||
"console.log() is followed by undefined");
|
"console.log() is followed by undefined");
|
||||||
is(result_node.nextElementSibling, console_message_node,
|
is(resultNode.nextElementSibling, consoleMessageNode,
|
||||||
"undefined is followed by 'foo' 'bar'");
|
"undefined is followed by 'foo' 'bar'");
|
||||||
});
|
});
|
||||||
|
|
|
@ -5,7 +5,10 @@
|
||||||
|
|
||||||
// Test the webconsole output for various types of objects.
|
// Test the webconsole output for various types of objects.
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console-output-regexp.html";
|
"use strict";
|
||||||
|
|
||||||
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console-output-regexp.html";
|
||||||
|
|
||||||
let dateNow = Date.now();
|
let dateNow = Date.now();
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-console-table.html";
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-console-table.html";
|
||||||
|
|
||||||
const TEST_DATA = [
|
const TEST_DATA = [
|
||||||
{
|
{
|
||||||
|
@ -63,19 +64,26 @@ const TEST_DATA = [
|
||||||
{
|
{
|
||||||
command: "console.table(family)",
|
command: "console.table(family)",
|
||||||
data: [
|
data: [
|
||||||
{ _index: "mother", firstName: "\"Susan\"", lastName: "\"Doyle\"", age: "32" },
|
{ _index: "mother", firstName: "\"Susan\"", lastName: "\"Doyle\"",
|
||||||
{ _index: "father", firstName: "\"John\"", lastName: "\"Doyle\"", age: "33" },
|
age: "32" },
|
||||||
{ _index: "daughter", firstName: "\"Lily\"", lastName: "\"Doyle\"", age: "5" },
|
{ _index: "father", firstName: "\"John\"", lastName: "\"Doyle\"",
|
||||||
|
age: "33" },
|
||||||
|
{ _index: "daughter", firstName: "\"Lily\"", lastName: "\"Doyle\"",
|
||||||
|
age: "5" },
|
||||||
{ _index: "son", firstName: "\"Mike\"", lastName: "\"Doyle\"", age: "8" },
|
{ _index: "son", firstName: "\"Mike\"", lastName: "\"Doyle\"", age: "8" },
|
||||||
],
|
],
|
||||||
columns: { _index: "(index)", firstName: "firstName", lastName: "lastName", age: "age" }
|
columns: { _index: "(index)", firstName: "firstName", lastName: "lastName",
|
||||||
|
age: "age" }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
command: "console.table(family, [])",
|
command: "console.table(family, [])",
|
||||||
data: [
|
data: [
|
||||||
{ _index: "mother", firstName: "\"Susan\"", lastName: "\"Doyle\"", age: "32" },
|
{ _index: "mother", firstName: "\"Susan\"", lastName: "\"Doyle\"",
|
||||||
{ _index: "father", firstName: "\"John\"", lastName: "\"Doyle\"", age: "33" },
|
age: "32" },
|
||||||
{ _index: "daughter", firstName: "\"Lily\"", lastName: "\"Doyle\"", age: "5" },
|
{ _index: "father", firstName: "\"John\"", lastName: "\"Doyle\"",
|
||||||
|
age: "33" },
|
||||||
|
{ _index: "daughter", firstName: "\"Lily\"", lastName: "\"Doyle\"",
|
||||||
|
age: "5" },
|
||||||
{ _index: "son", firstName: "\"Mike\"", lastName: "\"Doyle\"", age: "8" },
|
{ _index: "son", firstName: "\"Mike\"", lastName: "\"Doyle\"", age: "8" },
|
||||||
],
|
],
|
||||||
columns: { _index: "(index)" }
|
columns: { _index: "(index)" }
|
||||||
|
@ -83,9 +91,12 @@ const TEST_DATA = [
|
||||||
{
|
{
|
||||||
command: "console.table(family, ['firstName', 'lastName'])",
|
command: "console.table(family, ['firstName', 'lastName'])",
|
||||||
data: [
|
data: [
|
||||||
{ _index: "mother", firstName: "\"Susan\"", lastName: "\"Doyle\"", age: "32" },
|
{ _index: "mother", firstName: "\"Susan\"", lastName: "\"Doyle\"",
|
||||||
{ _index: "father", firstName: "\"John\"", lastName: "\"Doyle\"", age: "33" },
|
age: "32" },
|
||||||
{ _index: "daughter", firstName: "\"Lily\"", lastName: "\"Doyle\"", age: "5" },
|
{ _index: "father", firstName: "\"John\"", lastName: "\"Doyle\"",
|
||||||
|
age: "33" },
|
||||||
|
{ _index: "daughter", firstName: "\"Lily\"", lastName: "\"Doyle\"",
|
||||||
|
age: "5" },
|
||||||
{ _index: "son", firstName: "\"Mike\"", lastName: "\"Doyle\"", age: "8" },
|
{ _index: "son", firstName: "\"Mike\"", lastName: "\"Doyle\"", age: "8" },
|
||||||
],
|
],
|
||||||
columns: { _index: "(index)", firstName: "firstName", lastName: "lastName" }
|
columns: { _index: "(index)", firstName: "firstName", lastName: "lastName" }
|
||||||
|
@ -104,7 +115,8 @@ const TEST_DATA = [
|
||||||
{
|
{
|
||||||
command: "console.table(myMap)",
|
command: "console.table(myMap)",
|
||||||
data: [
|
data: [
|
||||||
{ _index: 0, _key: "\"a string\"", _value: "\"value associated with 'a string'\"" },
|
{ _index: 0, _key: "\"a string\"",
|
||||||
|
_value: "\"value associated with 'a string'\"" },
|
||||||
{ _index: 1, _key: "5", _value: "\"value associated with 5\"" },
|
{ _index: 1, _key: "5", _value: "\"value associated with 5\"" },
|
||||||
],
|
],
|
||||||
columns: { _index: "(iteration index)", _key: "Key", _value: "Values" }
|
columns: { _index: "(iteration index)", _key: "Key", _value: "Values" }
|
||||||
|
@ -141,18 +153,19 @@ add_task(function*() {
|
||||||
ok(obj._data, "found table data object");
|
ok(obj._data, "found table data object");
|
||||||
|
|
||||||
let data = obj._data.map(entries => {
|
let data = obj._data.map(entries => {
|
||||||
let result = {};
|
let entryResult = {};
|
||||||
|
|
||||||
for (let key of Object.keys(entries)) {
|
for (let key of Object.keys(entries)) {
|
||||||
result[key] = entries[key] instanceof HTMLElement ?
|
entryResult[key] = entries[key] instanceof HTMLElement ?
|
||||||
entries[key].textContent : entries[key];
|
entries[key].textContent : entries[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return entryResult;
|
||||||
});
|
});
|
||||||
|
|
||||||
is(data.toSource(), testdata.data.toSource(), "table data is correct");
|
is(data.toSource(), testdata.data.toSource(), "table data is correct");
|
||||||
ok(obj._columns, "found table column object");
|
ok(obj._columns, "found table column object");
|
||||||
is(obj._columns.toSource(), testdata.columns.toSource(), "table column is correct");
|
is(obj._columns.toSource(), testdata.columns.toSource(),
|
||||||
|
"table column is correct");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -5,9 +5,12 @@
|
||||||
|
|
||||||
// Bug 1148759 - Test the webconsole can display promises inside objects.
|
// Bug 1148759 - Test the webconsole can display promises inside objects.
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
const TEST_URI = "data:text/html;charset=utf8,test for console and promises";
|
const TEST_URI = "data:text/html;charset=utf8,test for console and promises";
|
||||||
|
|
||||||
let {DebuggerServer} = Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
let {DebuggerServer} =
|
||||||
|
Cu.import("resource://gre/modules/devtools/dbg-server.jsm", {});
|
||||||
|
|
||||||
let LONG_STRING_LENGTH = DebuggerServer.LONG_STRING_LENGTH;
|
let LONG_STRING_LENGTH = DebuggerServer.LONG_STRING_LENGTH;
|
||||||
let LONG_STRING_INITIAL_LENGTH = DebuggerServer.LONG_STRING_INITIAL_LENGTH;
|
let LONG_STRING_INITIAL_LENGTH = DebuggerServer.LONG_STRING_INITIAL_LENGTH;
|
||||||
|
@ -15,7 +18,8 @@ DebuggerServer.LONG_STRING_LENGTH = 100;
|
||||||
DebuggerServer.LONG_STRING_INITIAL_LENGTH = 50;
|
DebuggerServer.LONG_STRING_INITIAL_LENGTH = 50;
|
||||||
|
|
||||||
let longString = (new Array(DebuggerServer.LONG_STRING_LENGTH + 4)).join("a");
|
let longString = (new Array(DebuggerServer.LONG_STRING_LENGTH + 4)).join("a");
|
||||||
let initialString = longString.substring(0, DebuggerServer.LONG_STRING_INITIAL_LENGTH);
|
let initialString = longString.substring(0,
|
||||||
|
DebuggerServer.LONG_STRING_INITIAL_LENGTH);
|
||||||
|
|
||||||
let inputTests = [
|
let inputTests = [
|
||||||
// 0
|
// 0
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
// Tests the property provider, which is part of the code completion
|
// Tests the property provider, which is part of the code completion
|
||||||
// infrastructure.
|
// infrastructure.
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
const TEST_URI = "data:text/html;charset=utf8,<p>test the JS property provider";
|
const TEST_URI = "data:text/html;charset=utf8,<p>test the JS property provider";
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
|
@ -14,12 +16,13 @@ function test() {
|
||||||
|
|
||||||
function testPropertyProvider({browser}) {
|
function testPropertyProvider({browser}) {
|
||||||
browser.removeEventListener("load", testPropertyProvider, true);
|
browser.removeEventListener("load", testPropertyProvider, true);
|
||||||
let tools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
|
let {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||||
let JSPropertyProvider = tools.require("devtools/toolkit/webconsole/utils").JSPropertyProvider;
|
let {require} = devtools;
|
||||||
|
let {JSPropertyProvider} = require("devtools/toolkit/webconsole/utils");
|
||||||
|
|
||||||
let tmp = Cu.import("resource://gre/modules/jsdebugger.jsm", {});
|
let tmp = Cu.import("resource://gre/modules/jsdebugger.jsm", {});
|
||||||
tmp.addDebuggerToGlobal(tmp);
|
tmp.addDebuggerToGlobal(tmp);
|
||||||
let dbg = new tmp.Debugger;
|
let dbg = new tmp.Debugger();
|
||||||
let dbgWindow = dbg.makeGlobalObjectReference(content);
|
let dbgWindow = dbg.makeGlobalObjectReference(content);
|
||||||
|
|
||||||
let completion = JSPropertyProvider(dbgWindow, null, "thisIsNotDefined");
|
let completion = JSPropertyProvider(dbgWindow, null, "thisIsNotDefined");
|
||||||
|
@ -30,16 +33,15 @@ function testPropertyProvider({browser}) {
|
||||||
is(completion, null, "no match for 'window[1].acb");
|
is(completion, null, "no match for 'window[1].acb");
|
||||||
|
|
||||||
// A very advanced completion case.
|
// A very advanced completion case.
|
||||||
var strComplete =
|
let strComplete =
|
||||||
'function a() { }document;document.getElementById(window.locatio';
|
"function a() { }document;document.getElementById(window.locatio";
|
||||||
completion = JSPropertyProvider(dbgWindow, null, strComplete);
|
completion = JSPropertyProvider(dbgWindow, null, strComplete);
|
||||||
ok(completion.matches.length == 2, "two matches found");
|
ok(completion.matches.length == 2, "two matches found");
|
||||||
ok(completion.matchProp == "locatio", "matching part is 'test'");
|
ok(completion.matchProp == "locatio", "matching part is 'test'");
|
||||||
var matches = completion.matches;
|
let matches = completion.matches;
|
||||||
matches.sort();
|
matches.sort();
|
||||||
ok(matches[0] == "location", "the first match is 'location'");
|
ok(matches[0] == "location", "the first match is 'location'");
|
||||||
ok(matches[1] == "locationbar", "the second match is 'locationbar'");
|
ok(matches[1] == "locationbar", "the second match is 'locationbar'");
|
||||||
|
|
||||||
finishTest();
|
finishTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,14 +5,15 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const TEST_URI = "data:text/html;charset=utf-8,Web Console test for reflow activity";
|
const TEST_URI = "data:text/html;charset=utf-8,Web Console test for " +
|
||||||
|
"reflow activity";
|
||||||
|
|
||||||
let test = asyncTest(function* () {
|
let test = asyncTest(function* () {
|
||||||
let { browser } = yield loadTab(TEST_URI);
|
let { browser } = yield loadTab(TEST_URI);
|
||||||
|
|
||||||
let hud = yield openConsole();
|
let hud = yield openConsole();
|
||||||
|
|
||||||
function onReflowListenersReady(aType, aPacket) {
|
function onReflowListenersReady() {
|
||||||
browser.contentDocument.body.style.display = "none";
|
browser.contentDocument.body.style.display = "none";
|
||||||
browser.contentDocument.body.clientTop;
|
browser.contentDocument.body.clientTop;
|
||||||
}
|
}
|
||||||
|
@ -28,5 +29,5 @@ let test = asyncTest(function* () {
|
||||||
category: CATEGORY_CSS,
|
category: CATEGORY_CSS,
|
||||||
severity: SEVERITY_LOG,
|
severity: SEVERITY_LOG,
|
||||||
}],
|
}],
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,7 +2,10 @@
|
||||||
/* Any copyright is dedicated to the Public Domain.
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
|
||||||
const TEST_URI = "data:text/html;charset=utf8,<p>test Scratchpad panel linking</p>";
|
"use strict";
|
||||||
|
|
||||||
|
const TEST_URI = "data:text/html;charset=utf8,<p>test Scratchpad panel " +
|
||||||
|
"linking</p>";
|
||||||
|
|
||||||
let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
|
let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
|
||||||
let { Tools } = require("main");
|
let { Tools } = require("main");
|
||||||
|
|
|
@ -6,9 +6,13 @@
|
||||||
|
|
||||||
// Ensure non-toplevel security errors are displayed
|
// Ensure non-toplevel security errors are displayed
|
||||||
|
|
||||||
const TEST_URI = "data:text/html;charset=utf8,Web Console subresource STS warning test";
|
"use strict";
|
||||||
const TEST_DOC = "https://example.com/browser/browser/devtools/webconsole/test/test_bug1092055_shouldwarn.html";
|
|
||||||
const SAMPLE_MSG = 'invalid Strict-Transport-Security header'
|
const TEST_URI = "data:text/html;charset=utf8,Web Console subresource STS " +
|
||||||
|
"warning test";
|
||||||
|
const TEST_DOC = "https://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test_bug1092055_shouldwarn.html";
|
||||||
|
const SAMPLE_MSG = "invalid Strict-Transport-Security header";
|
||||||
|
|
||||||
let test = asyncTest(function* () {
|
let test = asyncTest(function* () {
|
||||||
let { browser } = yield loadTab(TEST_URI);
|
let { browser } = yield loadTab(TEST_URI);
|
||||||
|
|
|
@ -3,13 +3,15 @@
|
||||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
const TEST_URI = "data:text/html;charset=utf8,Test that the web console " +
|
const TEST_URI = "data:text/html;charset=utf8,Test that the web console " +
|
||||||
"displays requests that have been recorded in the " +
|
"displays requests that have been recorded in the " +
|
||||||
"netmonitor, even if the console hadn't opened yet.";
|
"netmonitor, even if the console hadn't opened yet.";
|
||||||
|
|
||||||
const TEST_FILE = "test-network-request.html";
|
const TEST_FILE = "test-network-request.html";
|
||||||
const TEST_PATH = "http://example.com/browser/browser/devtools/webconsole/test/" +
|
const TEST_PATH = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
TEST_FILE;
|
"test/" + TEST_FILE;
|
||||||
|
|
||||||
const NET_PREF = "devtools.webconsole.filter.networkinfo";
|
const NET_PREF = "devtools.webconsole.filter.networkinfo";
|
||||||
Services.prefs.setBoolPref(NET_PREF, true);
|
Services.prefs.setBoolPref(NET_PREF, true);
|
||||||
|
@ -47,7 +49,6 @@ add_task(function* () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function loadDocument(browser) {
|
function loadDocument(browser) {
|
||||||
let deferred = promise.defer();
|
let deferred = promise.defer();
|
||||||
|
|
||||||
|
|
|
@ -3,10 +3,11 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
const TEST_URI = "data:text/html;charset=utf-8,Web Console test for splitting";
|
const TEST_URI = "data:text/html;charset=utf-8,Web Console test for splitting";
|
||||||
|
|
||||||
function test()
|
function test() {
|
||||||
{
|
|
||||||
// Test is slow on Linux EC2 instances - Bug 962931
|
// Test is slow on Linux EC2 instances - Bug 962931
|
||||||
requestLongerTimeout(2);
|
requestLongerTimeout(2);
|
||||||
|
|
||||||
|
@ -17,13 +18,13 @@ function test()
|
||||||
|
|
||||||
loadTab(TEST_URI).then(testConsoleLoadOnDifferentPanel);
|
loadTab(TEST_URI).then(testConsoleLoadOnDifferentPanel);
|
||||||
|
|
||||||
function testConsoleLoadOnDifferentPanel()
|
function testConsoleLoadOnDifferentPanel() {
|
||||||
{
|
|
||||||
info("About to check console loads even when non-webconsole panel is open");
|
info("About to check console loads even when non-webconsole panel is open");
|
||||||
|
|
||||||
openPanel("inspector").then(() => {
|
openPanel("inspector").then(() => {
|
||||||
toolbox.on("webconsole-ready", () => {
|
toolbox.on("webconsole-ready", () => {
|
||||||
ok(true, "Webconsole has been triggered as loaded while another tool is active");
|
ok(true, "Webconsole has been triggered as loaded while another tool " +
|
||||||
|
"is active");
|
||||||
testKeyboardShortcuts();
|
testKeyboardShortcuts();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -32,8 +33,7 @@ function test()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function testKeyboardShortcuts()
|
function testKeyboardShortcuts() {
|
||||||
{
|
|
||||||
info("About to check that panel responds to ESCAPE keyboard shortcut");
|
info("About to check that panel responds to ESCAPE keyboard shortcut");
|
||||||
|
|
||||||
toolbox.once("split-console", () => {
|
toolbox.once("split-console", () => {
|
||||||
|
@ -45,8 +45,7 @@ function test()
|
||||||
EventUtils.sendKey("ESCAPE", toolbox.frame.contentWindow);
|
EventUtils.sendKey("ESCAPE", toolbox.frame.contentWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkAllTools()
|
function checkAllTools() {
|
||||||
{
|
|
||||||
info("About to check split console with each panel individually.");
|
info("About to check split console with each panel individually.");
|
||||||
|
|
||||||
Task.spawn(function*() {
|
Task.spawn(function*() {
|
||||||
|
@ -61,16 +60,18 @@ function test()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCurrentUIState()
|
function getCurrentUIState() {
|
||||||
{
|
|
||||||
let win = toolbox.doc.defaultView;
|
let win = toolbox.doc.defaultView;
|
||||||
let deck = toolbox.doc.querySelector("#toolbox-deck");
|
let deck = toolbox.doc.querySelector("#toolbox-deck");
|
||||||
let webconsolePanel = toolbox.webconsolePanel;
|
let webconsolePanel = toolbox.webconsolePanel;
|
||||||
let splitter = toolbox.doc.querySelector("#toolbox-console-splitter");
|
let splitter = toolbox.doc.querySelector("#toolbox-console-splitter");
|
||||||
|
|
||||||
let containerHeight = parseFloat(win.getComputedStyle(deck.parentNode).getPropertyValue("height"));
|
let containerHeight = parseFloat(win.getComputedStyle(deck.parentNode)
|
||||||
let deckHeight = parseFloat(win.getComputedStyle(deck).getPropertyValue("height"));
|
.getPropertyValue("height"));
|
||||||
let webconsoleHeight = parseFloat(win.getComputedStyle(webconsolePanel).getPropertyValue("height"));
|
let deckHeight = parseFloat(win.getComputedStyle(deck)
|
||||||
|
.getPropertyValue("height"));
|
||||||
|
let webconsoleHeight = parseFloat(win.getComputedStyle(webconsolePanel)
|
||||||
|
.getPropertyValue("height"));
|
||||||
let splitterVisibility = !splitter.getAttribute("hidden");
|
let splitterVisibility = !splitter.getAttribute("hidden");
|
||||||
let openedConsolePanel = toolbox.currentToolId === "webconsole";
|
let openedConsolePanel = toolbox.currentToolId === "webconsole";
|
||||||
let cmdButton = toolbox.doc.querySelector("#command-button-splitconsole");
|
let cmdButton = toolbox.doc.querySelector("#command-button-splitconsole");
|
||||||
|
@ -85,8 +86,7 @@ function test()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkWebconsolePanelOpened()
|
function checkWebconsolePanelOpened() {
|
||||||
{
|
|
||||||
info("About to check special cases when webconsole panel is open.");
|
info("About to check special cases when webconsole panel is open.");
|
||||||
|
|
||||||
let deferred = promise.defer();
|
let deferred = promise.defer();
|
||||||
|
@ -96,52 +96,68 @@ function test()
|
||||||
|
|
||||||
let currentUIState = getCurrentUIState();
|
let currentUIState = getCurrentUIState();
|
||||||
|
|
||||||
ok (currentUIState.splitterVisibility, "Splitter is visible when console is split");
|
ok(currentUIState.splitterVisibility,
|
||||||
ok (currentUIState.deckHeight > 0, "Deck has a height > 0 when console is split");
|
"Splitter is visible when console is split");
|
||||||
ok (currentUIState.webconsoleHeight > 0, "Web console has a height > 0 when console is split");
|
ok(currentUIState.deckHeight > 0,
|
||||||
ok (!currentUIState.openedConsolePanel, "The console panel is not the current tool");
|
"Deck has a height > 0 when console is split");
|
||||||
|
ok(currentUIState.webconsoleHeight > 0,
|
||||||
|
"Web console has a height > 0 when console is split");
|
||||||
|
ok(!currentUIState.openedConsolePanel,
|
||||||
|
"The console panel is not the current tool");
|
||||||
ok(currentUIState.buttonSelected, "The command button is selected");
|
ok(currentUIState.buttonSelected, "The command button is selected");
|
||||||
|
|
||||||
openPanel("webconsole").then(() => {
|
openPanel("webconsole").then(() => {
|
||||||
|
currentUIState = getCurrentUIState();
|
||||||
|
|
||||||
let currentUIState = getCurrentUIState();
|
ok(!currentUIState.splitterVisibility,
|
||||||
|
"Splitter is hidden when console is opened.");
|
||||||
ok (!currentUIState.splitterVisibility, "Splitter is hidden when console is opened.");
|
is(currentUIState.deckHeight, 0,
|
||||||
is (currentUIState.deckHeight, 0, "Deck has a height == 0 when console is opened.");
|
"Deck has a height == 0 when console is opened.");
|
||||||
is (currentUIState.webconsoleHeight, currentUIState.containerHeight, "Web console is full height.");
|
is(currentUIState.webconsoleHeight, currentUIState.containerHeight,
|
||||||
ok (currentUIState.openedConsolePanel, "The console panel is the current tool");
|
"Web console is full height.");
|
||||||
ok (currentUIState.buttonSelected, "The command button is still selected.");
|
ok(currentUIState.openedConsolePanel,
|
||||||
|
"The console panel is the current tool");
|
||||||
|
ok(currentUIState.buttonSelected,
|
||||||
|
"The command button is still selected.");
|
||||||
|
|
||||||
// Make sure splitting console does nothing while webconsole is opened
|
// Make sure splitting console does nothing while webconsole is opened
|
||||||
toolbox.toggleSplitConsole();
|
toolbox.toggleSplitConsole();
|
||||||
|
|
||||||
currentUIState = getCurrentUIState();
|
currentUIState = getCurrentUIState();
|
||||||
|
|
||||||
ok (!currentUIState.splitterVisibility, "Splitter is hidden when console is opened.");
|
ok(!currentUIState.splitterVisibility,
|
||||||
is (currentUIState.deckHeight, 0, "Deck has a height == 0 when console is opened.");
|
"Splitter is hidden when console is opened.");
|
||||||
is (currentUIState.webconsoleHeight, currentUIState.containerHeight, "Web console is full height.");
|
is(currentUIState.deckHeight, 0,
|
||||||
ok (currentUIState.openedConsolePanel, "The console panel is the current tool");
|
"Deck has a height == 0 when console is opened.");
|
||||||
ok (currentUIState.buttonSelected, "The command button is still selected.");
|
is(currentUIState.webconsoleHeight, currentUIState.containerHeight,
|
||||||
|
"Web console is full height.");
|
||||||
|
ok(currentUIState.openedConsolePanel,
|
||||||
|
"The console panel is the current tool");
|
||||||
|
ok(currentUIState.buttonSelected,
|
||||||
|
"The command button is still selected.");
|
||||||
|
|
||||||
// Make sure that split state is saved after opening another panel
|
// Make sure that split state is saved after opening another panel
|
||||||
openPanel("inspector").then(() => {
|
openPanel("inspector").then(() => {
|
||||||
let currentUIState = getCurrentUIState();
|
currentUIState = getCurrentUIState();
|
||||||
ok (currentUIState.splitterVisibility, "Splitter is visible when console is split");
|
ok(currentUIState.splitterVisibility,
|
||||||
ok (currentUIState.deckHeight > 0, "Deck has a height > 0 when console is split");
|
"Splitter is visible when console is split");
|
||||||
ok (currentUIState.webconsoleHeight > 0, "Web console has a height > 0 when console is split");
|
ok(currentUIState.deckHeight > 0,
|
||||||
ok (!currentUIState.openedConsolePanel, "The console panel is not the current tool");
|
"Deck has a height > 0 when console is split");
|
||||||
ok (currentUIState.buttonSelected, "The command button is still selected.");
|
ok(currentUIState.webconsoleHeight > 0,
|
||||||
|
"Web console has a height > 0 when console is split");
|
||||||
|
ok(!currentUIState.openedConsolePanel,
|
||||||
|
"The console panel is not the current tool");
|
||||||
|
ok(currentUIState.buttonSelected,
|
||||||
|
"The command button is still selected.");
|
||||||
|
|
||||||
toolbox.toggleSplitConsole();
|
toolbox.toggleSplitConsole();
|
||||||
deferred.resolve();
|
deferred.resolve();
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
function openPanel(toolId, callback)
|
function openPanel(toolId) {
|
||||||
{
|
|
||||||
let deferred = promise.defer();
|
let deferred = promise.defer();
|
||||||
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
||||||
gDevTools.showToolbox(target, toolId).then(function(box) {
|
gDevTools.showToolbox(target, toolId).then(function(box) {
|
||||||
|
@ -151,8 +167,7 @@ function test()
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
function openAndCheckPanel(toolId)
|
function openAndCheckPanel(toolId) {
|
||||||
{
|
|
||||||
let deferred = promise.defer();
|
let deferred = promise.defer();
|
||||||
openPanel(toolId).then(() => {
|
openPanel(toolId).then(() => {
|
||||||
info("Checking toolbox for " + toolId);
|
info("Checking toolbox for " + toolId);
|
||||||
|
@ -162,27 +177,33 @@ function test()
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkToolboxUI()
|
function checkToolboxUI() {
|
||||||
{
|
|
||||||
let currentUIState = getCurrentUIState();
|
let currentUIState = getCurrentUIState();
|
||||||
|
|
||||||
ok(!currentUIState.splitterVisibility, "Splitter is hidden by default");
|
ok(!currentUIState.splitterVisibility, "Splitter is hidden by default");
|
||||||
is (currentUIState.deckHeight, currentUIState.containerHeight, "Deck has a height > 0 by default");
|
is(currentUIState.deckHeight, currentUIState.containerHeight,
|
||||||
is (currentUIState.webconsoleHeight, 0, "Web console is collapsed by default");
|
"Deck has a height > 0 by default");
|
||||||
ok (!currentUIState.openedConsolePanel, "The console panel is not the current tool");
|
is(currentUIState.webconsoleHeight, 0,
|
||||||
|
"Web console is collapsed by default");
|
||||||
|
ok(!currentUIState.openedConsolePanel,
|
||||||
|
"The console panel is not the current tool");
|
||||||
ok(!currentUIState.buttonSelected, "The command button is not selected.");
|
ok(!currentUIState.buttonSelected, "The command button is not selected.");
|
||||||
|
|
||||||
toolbox.toggleSplitConsole();
|
toolbox.toggleSplitConsole();
|
||||||
|
|
||||||
currentUIState = getCurrentUIState();
|
currentUIState = getCurrentUIState();
|
||||||
|
|
||||||
ok (currentUIState.splitterVisibility, "Splitter is visible when console is split");
|
ok(currentUIState.splitterVisibility,
|
||||||
ok (currentUIState.deckHeight > 0, "Deck has a height > 0 when console is split");
|
"Splitter is visible when console is split");
|
||||||
ok (currentUIState.webconsoleHeight > 0, "Web console has a height > 0 when console is split");
|
ok(currentUIState.deckHeight > 0,
|
||||||
|
"Deck has a height > 0 when console is split");
|
||||||
|
ok(currentUIState.webconsoleHeight > 0,
|
||||||
|
"Web console has a height > 0 when console is split");
|
||||||
is(Math.round(currentUIState.deckHeight + currentUIState.webconsoleHeight),
|
is(Math.round(currentUIState.deckHeight + currentUIState.webconsoleHeight),
|
||||||
currentUIState.containerHeight,
|
currentUIState.containerHeight,
|
||||||
"Everything adds up to container height");
|
"Everything adds up to container height");
|
||||||
ok (!currentUIState.openedConsolePanel, "The console panel is not the current tool");
|
ok(!currentUIState.openedConsolePanel,
|
||||||
|
"The console panel is not the current tool");
|
||||||
ok(currentUIState.buttonSelected, "The command button is selected.");
|
ok(currentUIState.buttonSelected, "The command button is selected.");
|
||||||
|
|
||||||
toolbox.toggleSplitConsole();
|
toolbox.toggleSplitConsole();
|
||||||
|
@ -190,14 +211,16 @@ function test()
|
||||||
currentUIState = getCurrentUIState();
|
currentUIState = getCurrentUIState();
|
||||||
|
|
||||||
ok(!currentUIState.splitterVisibility, "Splitter is hidden after toggling");
|
ok(!currentUIState.splitterVisibility, "Splitter is hidden after toggling");
|
||||||
is (currentUIState.deckHeight, currentUIState.containerHeight, "Deck has a height > 0 after toggling");
|
is(currentUIState.deckHeight, currentUIState.containerHeight,
|
||||||
is (currentUIState.webconsoleHeight, 0, "Web console is collapsed after toggling");
|
"Deck has a height > 0 after toggling");
|
||||||
ok (!currentUIState.openedConsolePanel, "The console panel is not the current tool");
|
is(currentUIState.webconsoleHeight, 0,
|
||||||
|
"Web console is collapsed after toggling");
|
||||||
|
ok(!currentUIState.openedConsolePanel,
|
||||||
|
"The console panel is not the current tool");
|
||||||
ok(!currentUIState.buttonSelected, "The command button is not selected.");
|
ok(!currentUIState.buttonSelected, "The command button is not selected.");
|
||||||
}
|
}
|
||||||
|
|
||||||
function testBottomHost()
|
function testBottomHost() {
|
||||||
{
|
|
||||||
checkHostType(Toolbox.HostType.BOTTOM);
|
checkHostType(Toolbox.HostType.BOTTOM);
|
||||||
|
|
||||||
checkToolboxUI();
|
checkToolboxUI();
|
||||||
|
@ -205,8 +228,7 @@ function test()
|
||||||
toolbox.switchHost(Toolbox.HostType.SIDE).then(testSidebarHost);
|
toolbox.switchHost(Toolbox.HostType.SIDE).then(testSidebarHost);
|
||||||
}
|
}
|
||||||
|
|
||||||
function testSidebarHost()
|
function testSidebarHost() {
|
||||||
{
|
|
||||||
checkHostType(Toolbox.HostType.SIDE);
|
checkHostType(Toolbox.HostType.SIDE);
|
||||||
|
|
||||||
checkToolboxUI();
|
checkToolboxUI();
|
||||||
|
@ -214,8 +236,7 @@ function test()
|
||||||
toolbox.switchHost(Toolbox.HostType.WINDOW).then(testWindowHost);
|
toolbox.switchHost(Toolbox.HostType.WINDOW).then(testWindowHost);
|
||||||
}
|
}
|
||||||
|
|
||||||
function testWindowHost()
|
function testWindowHost() {
|
||||||
{
|
|
||||||
checkHostType(Toolbox.HostType.WINDOW);
|
checkHostType(Toolbox.HostType.WINDOW);
|
||||||
|
|
||||||
checkToolboxUI();
|
checkToolboxUI();
|
||||||
|
@ -223,24 +244,21 @@ function test()
|
||||||
toolbox.switchHost(Toolbox.HostType.BOTTOM).then(testDestroy);
|
toolbox.switchHost(Toolbox.HostType.BOTTOM).then(testDestroy);
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkHostType(hostType)
|
function checkHostType(hostType) {
|
||||||
{
|
|
||||||
is(toolbox.hostType, hostType, "host type is " + hostType);
|
is(toolbox.hostType, hostType, "host type is " + hostType);
|
||||||
|
|
||||||
let pref = Services.prefs.getCharPref("devtools.toolbox.host");
|
let pref = Services.prefs.getCharPref("devtools.toolbox.host");
|
||||||
is(pref, hostType, "host pref is " + hostType);
|
is(pref, hostType, "host pref is " + hostType);
|
||||||
}
|
}
|
||||||
|
|
||||||
function testDestroy()
|
function testDestroy() {
|
||||||
{
|
|
||||||
toolbox.destroy().then(function() {
|
toolbox.destroy().then(function() {
|
||||||
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
let target = TargetFactory.forTab(gBrowser.selectedTab);
|
||||||
gDevTools.showToolbox(target).then(finish);
|
gDevTools.showToolbox(target).then(finish);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function finish()
|
function finish() {
|
||||||
{
|
|
||||||
toolbox = null;
|
toolbox = null;
|
||||||
finishTest();
|
finishTest();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
info("Test various cases where the escape key should hide the split console.");
|
info("Test various cases where the escape key should hide the split console.");
|
||||||
|
|
||||||
|
@ -15,7 +17,8 @@ function test() {
|
||||||
Task.spawn(runner).then(finish);
|
Task.spawn(runner).then(finish);
|
||||||
|
|
||||||
function* runner() {
|
function* runner() {
|
||||||
let {tab} = yield loadTab("data:text/html;charset=utf-8,<p>Web Console test for splitting");
|
let {tab} = yield loadTab("data:text/html;charset=utf-8,<p>Web Console " +
|
||||||
|
"test for splitting");
|
||||||
let target = TargetFactory.forTab(tab);
|
let target = TargetFactory.forTab(tab);
|
||||||
toolbox = yield gDevTools.showToolbox(target, "inspector");
|
toolbox = yield gDevTools.showToolbox(target, "inspector");
|
||||||
|
|
||||||
|
@ -53,15 +56,6 @@ function test() {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function testShowSplitConsoleAfterEscape() {
|
|
||||||
let result = toolbox.once("split-console", () => {
|
|
||||||
ok(toolbox.splitConsole, "Split console is shown.");
|
|
||||||
});
|
|
||||||
EventUtils.sendKey("ESCAPE", toolbox.frame.contentWindow);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
function testHideSplitConsoleAfterEscape() {
|
function testHideSplitConsoleAfterEscape() {
|
||||||
let result = toolbox.once("split-console", () => {
|
let result = toolbox.once("split-console", () => {
|
||||||
ok(!toolbox.splitConsole, "Split console is hidden.");
|
ok(!toolbox.splitConsole, "Split console is hidden.");
|
||||||
|
|
|
@ -3,11 +3,14 @@
|
||||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
info("Test that the split console state is persisted");
|
info("Test that the split console state is persisted");
|
||||||
|
|
||||||
let toolbox;
|
let toolbox;
|
||||||
let TEST_URI = "data:text/html;charset=utf-8,<p>Web Console test for splitting</p>";
|
let TEST_URI = "data:text/html;charset=utf-8,<p>Web Console test for " +
|
||||||
|
"splitting</p>";
|
||||||
|
|
||||||
Task.spawn(runner).then(finish);
|
Task.spawn(runner).then(finish);
|
||||||
|
|
||||||
|
@ -40,7 +43,8 @@ function test() {
|
||||||
|
|
||||||
yield toolbox.closeSplitConsole();
|
yield toolbox.closeSplitConsole();
|
||||||
|
|
||||||
info ("Making sure that the search box is refocused after closing the split console");
|
info("Making sure that the search box is refocused after closing the " +
|
||||||
|
"split console");
|
||||||
// Use the binding element since inspector.searchBox is a XUL element.
|
// Use the binding element since inspector.searchBox is a XUL element.
|
||||||
activeElement = getActiveElement(inspector.panelDoc);
|
activeElement = getActiveElement(inspector.panelDoc);
|
||||||
activeElement = activeElement.ownerDocument.getBindingParent(activeElement);
|
activeElement = activeElement.ownerDocument.getBindingParent(activeElement);
|
||||||
|
@ -57,14 +61,6 @@ function test() {
|
||||||
return activeElement;
|
return activeElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleSplitConsoleWithEscape() {
|
|
||||||
let onceSplitConsole = toolbox.once("split-console");
|
|
||||||
let contentWindow = toolbox.frame.contentWindow;
|
|
||||||
contentWindow.focus();
|
|
||||||
EventUtils.sendKey("ESCAPE", contentWindow);
|
|
||||||
return onceSplitConsole;
|
|
||||||
}
|
|
||||||
|
|
||||||
function finish() {
|
function finish() {
|
||||||
toolbox = TEST_URI = null;
|
toolbox = TEST_URI = null;
|
||||||
Services.prefs.clearUserPref("devtools.toolbox.splitconsoleEnabled");
|
Services.prefs.clearUserPref("devtools.toolbox.splitconsoleEnabled");
|
||||||
|
|
|
@ -3,11 +3,14 @@
|
||||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
info("Test that the split console state is persisted");
|
info("Test that the split console state is persisted");
|
||||||
|
|
||||||
let toolbox;
|
let toolbox;
|
||||||
let TEST_URI = "data:text/html;charset=utf-8,<p>Web Console test for splitting</p>";
|
let TEST_URI = "data:text/html;charset=utf-8,<p>Web Console test for " +
|
||||||
|
"splitting</p>";
|
||||||
|
|
||||||
Task.spawn(runner).then(finish);
|
Task.spawn(runner).then(finish);
|
||||||
|
|
||||||
|
@ -18,25 +21,29 @@ function test() {
|
||||||
toolbox = yield gDevTools.showToolbox(target, "inspector");
|
toolbox = yield gDevTools.showToolbox(target, "inspector");
|
||||||
|
|
||||||
ok(!toolbox.splitConsole, "Split console is hidden by default.");
|
ok(!toolbox.splitConsole, "Split console is hidden by default.");
|
||||||
ok(!isCommandButtonChecked(), "Split console button is unchecked by default.");
|
ok(!isCommandButtonChecked(), "Split console button is unchecked by " +
|
||||||
|
"default.");
|
||||||
yield toggleSplitConsoleWithEscape();
|
yield toggleSplitConsoleWithEscape();
|
||||||
ok(toolbox.splitConsole, "Split console is now visible.");
|
ok(toolbox.splitConsole, "Split console is now visible.");
|
||||||
ok(isCommandButtonChecked(), "Split console button is now checked.");
|
ok(isCommandButtonChecked(), "Split console button is now checked.");
|
||||||
ok(getVisiblePrefValue(), "Visibility pref is true");
|
ok(getVisiblePrefValue(), "Visibility pref is true");
|
||||||
|
|
||||||
is(getHeightPrefValue(), toolbox.webconsolePanel.height, "Panel height matches the pref");
|
is(getHeightPrefValue(), toolbox.webconsolePanel.height,
|
||||||
|
"Panel height matches the pref");
|
||||||
toolbox.webconsolePanel.height = 200;
|
toolbox.webconsolePanel.height = 200;
|
||||||
|
|
||||||
yield toolbox.destroy();
|
yield toolbox.destroy();
|
||||||
|
|
||||||
info("Opening a tab while there is a true user setting on split console pref");
|
info("Opening a tab while there is a true user setting on split console " +
|
||||||
|
"pref");
|
||||||
({tab} = yield loadTab(TEST_URI));
|
({tab} = yield loadTab(TEST_URI));
|
||||||
target = TargetFactory.forTab(tab);
|
target = TargetFactory.forTab(tab);
|
||||||
toolbox = yield gDevTools.showToolbox(target, "inspector");
|
toolbox = yield gDevTools.showToolbox(target, "inspector");
|
||||||
|
|
||||||
ok(toolbox.splitConsole, "Split console is visible by default.");
|
ok(toolbox.splitConsole, "Split console is visible by default.");
|
||||||
ok(isCommandButtonChecked(), "Split console button is checked by default.");
|
ok(isCommandButtonChecked(), "Split console button is checked by default.");
|
||||||
is(getHeightPrefValue(), 200, "Height is set based on panel height after closing");
|
is(getHeightPrefValue(), 200, "Height is set based on panel height after " +
|
||||||
|
"closing");
|
||||||
|
|
||||||
// Use the binding element since jsterm.inputNode is a XUL textarea element.
|
// Use the binding element since jsterm.inputNode is a XUL textarea element.
|
||||||
let activeElement = getActiveElement(toolbox.doc);
|
let activeElement = getActiveElement(toolbox.doc);
|
||||||
|
@ -59,10 +66,11 @@ function test() {
|
||||||
|
|
||||||
yield toolbox.destroy();
|
yield toolbox.destroy();
|
||||||
|
|
||||||
is(getHeightPrefValue(), 10000, "Height is set based on panel height after closing");
|
is(getHeightPrefValue(), 10000,
|
||||||
|
"Height is set based on panel height after closing");
|
||||||
|
|
||||||
|
info("Opening a tab while there is a false user setting on split " +
|
||||||
info("Opening a tab while there is a false user setting on split console pref");
|
"console pref");
|
||||||
({tab} = yield loadTab(TEST_URI));
|
({tab} = yield loadTab(TEST_URI));
|
||||||
target = TargetFactory.forTab(tab);
|
target = TargetFactory.forTab(tab);
|
||||||
toolbox = yield gDevTools.showToolbox(target, "inspector");
|
toolbox = yield gDevTools.showToolbox(target, "inspector");
|
||||||
|
@ -90,8 +98,8 @@ function test() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function isCommandButtonChecked() {
|
function isCommandButtonChecked() {
|
||||||
return toolbox.doc.querySelector("#command-button-splitconsole").
|
return toolbox.doc.querySelector("#command-button-splitconsole")
|
||||||
hasAttribute("checked");
|
.hasAttribute("checked");
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleSplitConsoleWithEscape() {
|
function toggleSplitConsoleWithEscape() {
|
||||||
|
|
|
@ -5,15 +5,14 @@
|
||||||
// Check that the webconsole works if the network monitor is first opened, then
|
// Check that the webconsole works if the network monitor is first opened, then
|
||||||
// the user switches to the webconsole. See bug 970914.
|
// the user switches to the webconsole. See bug 970914.
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
function test() {
|
function test() {
|
||||||
Task.spawn(runner).then(finishTest);
|
Task.spawn(runner).then(finishTest);
|
||||||
|
|
||||||
function* runner() {
|
function* runner() {
|
||||||
const {tab} = yield loadTab("data:text/html;charset=utf8,<p>hello");
|
const {tab} = yield loadTab("data:text/html;charset=utf8,<p>hello");
|
||||||
|
|
||||||
const target = TargetFactory.forTab(tab);
|
|
||||||
const toolbox = yield gDevTools.showToolbox(target, "netmonitor");
|
|
||||||
|
|
||||||
const hud = yield openConsole(tab);
|
const hud = yield openConsole(tab);
|
||||||
|
|
||||||
hud.jsterm.execute("console.log('foobar bug970914')");
|
hud.jsterm.execute("console.log('foobar bug970914')");
|
||||||
|
@ -29,7 +28,8 @@ function test() {
|
||||||
});
|
});
|
||||||
|
|
||||||
let text = hud.outputNode.textContent;
|
let text = hud.outputNode.textContent;
|
||||||
isnot(text.indexOf("foobar bug970914"), -1, "console.log message confirmed");
|
isnot(text.indexOf("foobar bug970914"), -1,
|
||||||
|
"console.log message confirmed");
|
||||||
ok(!/logging API|disabled by a script/i.test(text),
|
ok(!/logging API|disabled by a script/i.test(text),
|
||||||
"no warning about disabled console API");
|
"no warning about disabled console API");
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,10 @@
|
||||||
// Tests that source URLs in the Web Console can be clicked to display the
|
// Tests that source URLs in the Web Console can be clicked to display the
|
||||||
// standard View Source window.
|
// standard View Source window.
|
||||||
|
|
||||||
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-error.html";
|
"use strict";
|
||||||
|
|
||||||
|
const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/" +
|
||||||
|
"test/test-error.html";
|
||||||
|
|
||||||
let getItemForAttachment;
|
let getItemForAttachment;
|
||||||
let Sources;
|
let Sources;
|
||||||
|
|
|
@ -27,3 +27,7 @@
|
||||||
<!ENTITY trackingProtection.showPreferences "Privacy Preferences">
|
<!ENTITY trackingProtection.showPreferences "Privacy Preferences">
|
||||||
|
|
||||||
<!ENTITY trackingProtection.startTour "See what's new">
|
<!ENTITY trackingProtection.startTour "See what's new">
|
||||||
|
|
||||||
|
<!ENTITY trackingProtection.disabled "You have turned off Tracking Protection.">
|
||||||
|
<!ENTITY trackingProtection.enable.label "Turn on Tracking Protection">
|
||||||
|
<!ENTITY trackingProtection.enable.accesskey "T">
|
||||||
|
|
|
@ -773,10 +773,16 @@ you can use these alternative items. Otherwise, their values should be empty. -
|
||||||
<!ENTITY trackingProtection.detectedBlocked2 "&brandShortName; is blocking attempts to track your browsing.">
|
<!ENTITY trackingProtection.detectedBlocked2 "&brandShortName; is blocking attempts to track your browsing.">
|
||||||
<!ENTITY trackingProtection.detectedNotBlocked2 "This site includes content that tracks your browsing. You have disabled protection.">
|
<!ENTITY trackingProtection.detectedNotBlocked2 "This site includes content that tracks your browsing. You have disabled protection.">
|
||||||
<!ENTITY trackingProtection.notDetected2 "This site doesn’t include any content that tracks your browsing.">
|
<!ENTITY trackingProtection.notDetected2 "This site doesn’t include any content that tracks your browsing.">
|
||||||
|
<!-- LOCALIZATION NOTE (trackingProtection.unblock.label, trackingProtection.unblock.accesskey):
|
||||||
|
The associated button with this label and accesskey is only shown when opening the control
|
||||||
|
center while looking at a site with trackers in NON-private browsing mode. -->
|
||||||
<!ENTITY trackingProtection.unblock.label "Disable protection for this site">
|
<!ENTITY trackingProtection.unblock.label "Disable protection for this site">
|
||||||
<!ENTITY trackingProtection.unblock.accesskey "D">
|
<!ENTITY trackingProtection.unblock.accesskey "D">
|
||||||
<!-- LOCALIZATION NOTE (trackingProtection.unblockPrivate.label): Uses trackingProtection.unblock.accesskey as its accesskey. -->
|
<!-- LOCALIZATION NOTE (trackingProtection.unblockPrivate.label, trackingProtection.unblockPrivate.accesskey):
|
||||||
|
The associated button with this label and accesskey is only shown when opening the control
|
||||||
|
center while looking at a site with trackers in PRIVATE browsing mode. -->
|
||||||
<!ENTITY trackingProtection.unblockPrivate.label "Disable protection for this session">
|
<!ENTITY trackingProtection.unblockPrivate.label "Disable protection for this session">
|
||||||
|
<!ENTITY trackingProtection.unblockPrivate.accesskey "D">
|
||||||
<!ENTITY trackingProtection.block2.label "Enable protection">
|
<!ENTITY trackingProtection.block2.label "Enable protection">
|
||||||
<!ENTITY trackingProtection.block2.accesskey "E">
|
<!ENTITY trackingProtection.block2.accesskey "E">
|
||||||
|
|
||||||
|
|
|
@ -1069,11 +1069,6 @@ toolbarbutton[constrain-size="true"][cui-areatype="toolbar"] > .toolbarbutton-ba
|
||||||
outline: 1px dotted -moz-DialogText;
|
outline: 1px dotted -moz-DialogText;
|
||||||
}
|
}
|
||||||
|
|
||||||
.default-notification-icon,
|
|
||||||
#default-notification-icon {
|
|
||||||
list-style-image: url(moz-icon://stock/gtk-dialog-info?size=16);
|
|
||||||
}
|
|
||||||
|
|
||||||
.indexedDB-notification-icon,
|
.indexedDB-notification-icon,
|
||||||
#indexedDB-notification-icon {
|
#indexedDB-notification-icon {
|
||||||
list-style-image: url(moz-icon://stock/gtk-dialog-question?size=16);
|
list-style-image: url(moz-icon://stock/gtk-dialog-question?size=16);
|
||||||
|
@ -1539,8 +1534,9 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
|
||||||
-moz-binding: url("chrome://browser/content/customizableui/toolbar.xml#toolbar-drag");
|
-moz-binding: url("chrome://browser/content/customizableui/toolbar.xml#toolbar-drag");
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabbrowser-tab:focus > .tab-stack > .tab-content > .tab-label {
|
.tabbrowser-tab:focus > .tab-stack > .tab-content {
|
||||||
outline: 1px dotted;
|
outline: 1px dotted;
|
||||||
|
outline-offset: -6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#context_reloadTab {
|
#context_reloadTab {
|
||||||
|
|
|
@ -493,8 +493,7 @@ browser.jar:
|
||||||
#ifdef E10S_TESTING_ONLY
|
#ifdef E10S_TESTING_ONLY
|
||||||
skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png)
|
skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png)
|
||||||
#endif
|
#endif
|
||||||
skin/classic/browser/warning16.png (../shared/warning16.png)
|
skin/classic/browser/warning.svg (../shared/warning.svg)
|
||||||
skin/classic/browser/warning16@2x.png (../shared/warning16@2x.png)
|
|
||||||
|
|
||||||
../extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/chrome.jar:
|
../extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/chrome.jar:
|
||||||
% override chrome://browser/skin/feeds/audioFeedIcon.png chrome://browser/skin/feeds/feedIcon.png
|
% override chrome://browser/skin/feeds/audioFeedIcon.png chrome://browser/skin/feeds/feedIcon.png
|
||||||
|
|
|
@ -2661,7 +2661,9 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
|
||||||
border-width: 0 11px;
|
border-width: 0 11px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabbrowser-tab:focus > .tab-stack > .tab-content > .tab-label {
|
.tabbrowser-tab:focus > .tab-stack > .tab-content > .tab-label:not([pinned]),
|
||||||
|
.tabbrowser-tab:focus > .tab-stack > .tab-content > .tab-icon-image[pinned],
|
||||||
|
.tabbrowser-tab:focus > .tab-stack > .tab-content > .tab-throbber[pinned] {
|
||||||
box-shadow: @focusRingShadow@;
|
box-shadow: @focusRingShadow@;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -623,8 +623,7 @@ browser.jar:
|
||||||
#ifdef E10S_TESTING_ONLY
|
#ifdef E10S_TESTING_ONLY
|
||||||
skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png)
|
skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png)
|
||||||
#endif
|
#endif
|
||||||
skin/classic/browser/warning16.png (../shared/warning16.png)
|
skin/classic/browser/warning.svg (../shared/warning.svg)
|
||||||
skin/classic/browser/warning16@2x.png (../shared/warning16@2x.png)
|
|
||||||
|
|
||||||
../extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/chrome.jar:
|
../extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/chrome.jar:
|
||||||
% override chrome://browser/skin/feeds/audioFeedIcon.png chrome://browser/skin/feeds/feedIcon.png
|
% override chrome://browser/skin/feeds/audioFeedIcon.png chrome://browser/skin/feeds/feedIcon.png
|
||||||
|
|
|
@ -642,8 +642,8 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton {
|
||||||
|
|
||||||
#PanelUI-footer-fxa[fxastatus="migrate-signup"] > #PanelUI-fxa-status > #PanelUI-fxa-label,
|
#PanelUI-footer-fxa[fxastatus="migrate-signup"] > #PanelUI-fxa-status > #PanelUI-fxa-label,
|
||||||
#PanelUI-footer-fxa[fxastatus="migrate-verify"] > #PanelUI-fxa-status > #PanelUI-fxa-label {
|
#PanelUI-footer-fxa[fxastatus="migrate-verify"] > #PanelUI-fxa-status > #PanelUI-fxa-label {
|
||||||
list-style-image: url(chrome://browser/skin/warning16.png);
|
list-style-image: url(chrome://browser/skin/warning.svg);
|
||||||
-moz-image-region: rect(0, 32px, 16px, 16px);
|
-moz-image-region: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
#PanelUI-customize {
|
#PanelUI-customize {
|
||||||
|
@ -1509,12 +1509,6 @@ menuitem[checked="true"].subviewbutton > .menu-iconic-left {
|
||||||
list-style-image: url(chrome://browser/skin/syncProgress-horizontalbar@2x.png);
|
list-style-image: url(chrome://browser/skin/syncProgress-horizontalbar@2x.png);
|
||||||
}
|
}
|
||||||
|
|
||||||
#PanelUI-footer-fxa[fxastatus="migrate-signup"] > #PanelUI-fxa-status > #PanelUI-fxa-label,
|
|
||||||
#PanelUI-footer-fxa[fxastatus="migrate-verify"] > #PanelUI-fxa-status > #PanelUI-fxa-label {
|
|
||||||
list-style-image: url(chrome://browser/skin/warning16@2x.png);
|
|
||||||
-moz-image-region: rect(0, 64px, 32px, 32px);
|
|
||||||
}
|
|
||||||
|
|
||||||
#PanelUI-customize {
|
#PanelUI-customize {
|
||||||
list-style-image: url(chrome://browser/skin/menuPanel-customize@2x.png);
|
list-style-image: url(chrome://browser/skin/menuPanel-customize@2x.png);
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,16 +120,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.notification-anchor-icon {
|
.notification-anchor-icon {
|
||||||
|
%ifdef MOZ_WIDGET_GTK
|
||||||
|
list-style-image: url(moz-icon://stock/gtk-dialog-info?size=16);
|
||||||
|
%else
|
||||||
|
list-style-image: url(chrome://global/skin/icons/information-16.png);
|
||||||
|
%endif
|
||||||
width: 16px;
|
width: 16px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
margin: 0 2px;
|
margin: 0 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.default-notification-icon,
|
|
||||||
#default-notification-icon {
|
|
||||||
list-style-image: url(chrome://global/skin/icons/information-16.png);
|
|
||||||
}
|
|
||||||
|
|
||||||
.identity-notification-icon,
|
.identity-notification-icon,
|
||||||
#identity-notification-icon {
|
#identity-notification-icon {
|
||||||
list-style-image: url(chrome://mozapps/skin/profile/profileicon.png);
|
list-style-image: url(chrome://mozapps/skin/profile/profileicon.png);
|
||||||
|
@ -318,6 +318,14 @@
|
||||||
border-image: url("chrome://browser/skin/urlbar-arrow@2x.png") 0 16 0 0 fill;
|
border-image: url("chrome://browser/skin/urlbar-arrow@2x.png") 0 16 0 0 fill;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.notification-anchor-icon {
|
||||||
|
%ifdef MOZ_WIDGET_GTK
|
||||||
|
list-style-image: url(moz-icon://stock/gtk-dialog-info?size=dialog);
|
||||||
|
%else
|
||||||
|
list-style-image: url(chrome://global/skin/icons/information-32.png);
|
||||||
|
%endif
|
||||||
|
}
|
||||||
|
|
||||||
.webRTC-shareDevices-notification-icon,
|
.webRTC-shareDevices-notification-icon,
|
||||||
#webRTC-shareDevices-notification-icon {
|
#webRTC-shareDevices-notification-icon {
|
||||||
list-style-image: url(chrome://browser/skin/webRTC-shareDevice-16@2x.png);
|
list-style-image: url(chrome://browser/skin/webRTC-shareDevice-16@2x.png);
|
||||||
|
@ -365,11 +373,6 @@
|
||||||
|
|
||||||
%ifdef XP_MACOSX
|
%ifdef XP_MACOSX
|
||||||
/* OSX only until we have icons for Windows and Linux */
|
/* OSX only until we have icons for Windows and Linux */
|
||||||
.default-notification-icon,
|
|
||||||
#default-notification-icon {
|
|
||||||
list-style-image: url(chrome://global/skin/icons/information-32.png);
|
|
||||||
}
|
|
||||||
|
|
||||||
.geo-notification-icon,
|
.geo-notification-icon,
|
||||||
#geo-notification-icon {
|
#geo-notification-icon {
|
||||||
list-style-image: url(chrome://browser/skin/Geolocation-16@2x.png);
|
list-style-image: url(chrome://browser/skin/Geolocation-16@2x.png);
|
||||||
|
|
|
@ -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/. -->
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||||
|
<path fill="#ffbf00" d="M14.8,12.5L9.3,1.9C9,1.3,8.5,1,8,1C7.5,1,7,1.3,6.7,1.9L1.2,12.5c-0.3,0.6-0.3,1.2,0,1.7C1.5,14.7,2,15,2.6,15h10.8 c0.6,0,1.1-0.3,1.4-0.8C15.1,13.7,15.1,13.1,14.8,12.5z"/>
|
||||||
|
<path fill="#fff" d="M8,11c-0.8,0-1.5,0.7-1.5,1.5C6.5,13.3,7.2,14,8,14 c0.8,0,1.5-0.7,1.5-1.5C9.5,11.7,8.8,11,8,11z M8,10L8,10C8.6,10,9,9.6,9,9l0.2-4.2c0-0.7-0.5-1.2-1.2-1.2S6.8,4.1,6.8,4.8L7,9 C7,9.6,7.4,10,8,10z"/>
|
||||||
|
</svg>
|
После Ширина: | Высота: | Размер: 725 B |
Двоичные данные
browser/themes/shared/warning16.png
До Ширина: | Высота: | Размер: 445 B |
Двоичные данные
browser/themes/shared/warning16@2x.png
До Ширина: | Высота: | Размер: 583 B |
|
@ -2082,8 +2082,9 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
|
||||||
}
|
}
|
||||||
|
|
||||||
/* tabbrowser-tab focus ring */
|
/* tabbrowser-tab focus ring */
|
||||||
.tabbrowser-tab:focus > .tab-stack > .tab-content > .tab-label {
|
.tabbrowser-tab:focus > .tab-stack > .tab-content {
|
||||||
outline: 1px dotted;
|
outline: 1px dotted;
|
||||||
|
outline-offset: -6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Background tabs:
|
/* Background tabs:
|
||||||
|
|
|
@ -105,6 +105,8 @@ browser.jar:
|
||||||
skin/classic/browser/privatebrowsing-mask-titlebar-XPVista7-tall.png
|
skin/classic/browser/privatebrowsing-mask-titlebar-XPVista7-tall.png
|
||||||
skin/classic/browser/reload-stop-go.png
|
skin/classic/browser/reload-stop-go.png
|
||||||
skin/classic/browser/reload-stop-go@2x.png
|
skin/classic/browser/reload-stop-go@2x.png
|
||||||
|
skin/classic/browser/reload-stop-go-preWin10.png
|
||||||
|
skin/classic/browser/reload-stop-go-preWin10@2x.png
|
||||||
skin/classic/browser/searchbar.css
|
skin/classic/browser/searchbar.css
|
||||||
skin/classic/browser/searchbar-dropdown-arrow.png
|
skin/classic/browser/searchbar-dropdown-arrow.png
|
||||||
skin/classic/browser/searchbar-dropdown-arrow-XP.png
|
skin/classic/browser/searchbar-dropdown-arrow-XP.png
|
||||||
|
@ -142,6 +144,8 @@ browser.jar:
|
||||||
skin/classic/browser/urlbar-popup-blocked.png
|
skin/classic/browser/urlbar-popup-blocked.png
|
||||||
skin/classic/browser/urlbar-history-dropmarker.png
|
skin/classic/browser/urlbar-history-dropmarker.png
|
||||||
skin/classic/browser/urlbar-history-dropmarker@2x.png
|
skin/classic/browser/urlbar-history-dropmarker@2x.png
|
||||||
|
skin/classic/browser/urlbar-history-dropmarker-preWin10.png
|
||||||
|
skin/classic/browser/urlbar-history-dropmarker-preWin10@2x.png
|
||||||
skin/classic/browser/session-restore.svg (../shared/incontent-icons/session-restore.svg)
|
skin/classic/browser/session-restore.svg (../shared/incontent-icons/session-restore.svg)
|
||||||
skin/classic/browser/tab-crashed.svg (../shared/incontent-icons/tab-crashed.svg)
|
skin/classic/browser/tab-crashed.svg (../shared/incontent-icons/tab-crashed.svg)
|
||||||
skin/classic/browser/welcome-back.svg (../shared/incontent-icons/welcome-back.svg)
|
skin/classic/browser/welcome-back.svg (../shared/incontent-icons/welcome-back.svg)
|
||||||
|
@ -598,8 +602,7 @@ browser.jar:
|
||||||
#ifdef E10S_TESTING_ONLY
|
#ifdef E10S_TESTING_ONLY
|
||||||
skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png)
|
skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png)
|
||||||
#endif
|
#endif
|
||||||
skin/classic/browser/warning16.png (../shared/warning16.png)
|
skin/classic/browser/warning.svg (../shared/warning.svg)
|
||||||
skin/classic/browser/warning16@2x.png (../shared/warning16@2x.png)
|
|
||||||
|
|
||||||
../extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/chrome.jar:
|
../extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/chrome.jar:
|
||||||
% override chrome://browser/skin/page-livemarks.png chrome://browser/skin/feeds/feedIcon16.png
|
% override chrome://browser/skin/page-livemarks.png chrome://browser/skin/feeds/feedIcon16.png
|
||||||
|
@ -691,3 +694,8 @@ browser.jar:
|
||||||
% override chrome://browser/skin/preferences/checkbox.png chrome://browser/skin/preferences/checkbox-aero.png os=WINNT osversion=6.1
|
% override chrome://browser/skin/preferences/checkbox.png chrome://browser/skin/preferences/checkbox-aero.png os=WINNT osversion=6.1
|
||||||
% override chrome://browser/skin/preferences/checkbox.png chrome://browser/skin/preferences/checkbox-xp.png os=WINNT osversion<6
|
% override chrome://browser/skin/preferences/checkbox.png chrome://browser/skin/preferences/checkbox-xp.png os=WINNT osversion<6
|
||||||
|
|
||||||
|
% override chrome://browser/skin/reload-stop-go.png chrome://browser/skin/reload-stop-go-preWin10.png os=WINNT osversion<=6.3
|
||||||
|
% override chrome://browser/skin/reload-stop-go@2x.png chrome://browser/skin/reload-stop-go-preWin10@2x.png os=WINNT osversion<=6.3
|
||||||
|
% override chrome://browser/skin/urlbar-history-dropmarker.png chrome://browser/skin/urlbar-history-dropmarker-preWin10.png os=WINNT osversion<=6.3
|
||||||
|
% override chrome://browser/skin/urlbar-history-dropmarker@2x.png chrome://browser/skin/urlbar-history-dropmarker-preWin10@2x.png os=WINNT osversion<=6.3
|
||||||
|
|
||||||
|
|
После Ширина: | Высота: | Размер: 1.9 KiB |
После Ширина: | Высота: | Размер: 3.6 KiB |
Двоичные данные
browser/themes/windows/reload-stop-go.png
До Ширина: | Высота: | Размер: 1.9 KiB После Ширина: | Высота: | Размер: 966 B |