This commit is contained in:
Ryan VanderMeulen 2015-07-20 16:04:28 -04:00
Родитель 129bc3aeeb d09f468ca1
Коммит f62f6fed08
116 изменённых файлов: 1099 добавлений и 702 удалений

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

@ -7786,5 +7786,10 @@ let AboutPrivateBrowsingListener = {
msg => {
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) {
chromeGlobal.addEventListener("AboutPrivateBrowsingOpenWindow", this,
false, true);
chromeGlobal.addEventListener("AboutPrivateBrowsingEnableTrackingProtection", this,
false, true);
},
get isAboutPrivateBrowsing() {
@ -282,6 +284,9 @@ let AboutPrivateBrowsingListener = {
case "AboutPrivateBrowsingOpenWindow":
sendAsyncMessage("AboutPrivateBrowsing:OpenPrivateWindow");
break;
case "AboutPrivateBrowsingEnableTrackingProtection":
sendAsyncMessage("AboutPrivateBrowsing:EnableTrackingProtection");
break;
}
},
};

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

@ -7,8 +7,7 @@
hidden="true"
onpopupshown="gIdentityHandler.onPopupShown(event);"
onpopuphidden="gIdentityHandler.onPopupHidden(event);"
orient="vertical"
level="top">
orient="vertical">
<broadcasterset>
<broadcaster id="identity-popup-content-host" value=""/>
@ -60,7 +59,7 @@
<button id="tracking-action-unblock-private"
label="&trackingProtection.unblockPrivate.label;"
class="identity-popup-button"
accesskey="&trackingProtection.unblock.accesskey;"
accesskey="&trackingProtection.unblockPrivate.accesskey;"
oncommand="TrackingProtection.disableForCurrentPage();" />
<button id="tracking-action-block"
label="&trackingProtection.block2.label;"

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

@ -77,12 +77,15 @@
"react/prop-types": 2,
"react/self-closing-comp": 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
"react/jsx-uses-react": 0,
"react/react-in-jsx-scope": 0,
// These ones we don't want to ever enable
"react/display-name": 0,
"react/jsx-boolean-value": 0,
"react/no-danger": 0,
"react/no-multi-comp": 0
}
}

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

@ -787,7 +787,6 @@ loop.roomViews = (function(mozL10n) {
),
React.createElement(sharedViews.chat.TextChatView, {
dispatcher: this.props.dispatcher,
showAlways: false,
showRoomName: false,
useDesktopPaths: true})
)

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

@ -787,7 +787,6 @@ loop.roomViews = (function(mozL10n) {
</div>
<sharedViews.chat.TextChatView
dispatcher={this.props.dispatcher}
showAlways={false}
showRoomName={false}
useDesktopPaths={true} />
</div>

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

@ -1451,6 +1451,10 @@ html[dir="rtl"] .standalone .room-conversation-wrapper .room-inner-info-area {
min-height: 60px;
}
.fx-embedded .text-chat-view > .text-chat-entries-empty {
display: none;
}
.text-chat-box {
flex: 0 0 auto;
max-height: 40px;

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

@ -149,12 +149,13 @@ loop.shared.views.chat = (function(mozL10n) {
/* Keep track of the last printed timestamp. */
var lastTimestamp = 0;
if (!this.props.messageList.length) {
return null;
}
var entriesClasses = React.addons.classSet({
"text-chat-entries": true,
"text-chat-entries-empty": !this.props.messageList.length
});
return (
React.createElement("div", {className: "text-chat-entries"},
React.createElement("div", {className: entriesClasses},
React.createElement("div", {className: "text-chat-scroller"},
this.props.messageList.map(function(entry, i) {
@ -379,10 +380,6 @@ loop.shared.views.chat = (function(mozL10n) {
hasNonSpecialMessages = !!messageList.length;
}
if (!this.state.textChatEnabled && !messageList.length) {
return null;
}
var textChatViewClasses = React.addons.classSet({
"text-chat-view": true,
"text-chat-disabled": !this.state.textChatEnabled

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

@ -149,12 +149,13 @@ loop.shared.views.chat = (function(mozL10n) {
/* Keep track of the last printed timestamp. */
var lastTimestamp = 0;
if (!this.props.messageList.length) {
return null;
}
var entriesClasses = React.addons.classSet({
"text-chat-entries": true,
"text-chat-entries-empty": !this.props.messageList.length
});
return (
<div className="text-chat-entries">
<div className={entriesClasses}>
<div className="text-chat-scroller">
{
this.props.messageList.map(function(entry, i) {
@ -379,10 +380,6 @@ loop.shared.views.chat = (function(mozL10n) {
hasNonSpecialMessages = !!messageList.length;
}
if (!this.state.textChatEnabled && !messageList.length) {
return null;
}
var textChatViewClasses = React.addons.classSet({
"text-chat-view": true,
"text-chat-disabled": !this.state.textChatEnabled

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

@ -29,8 +29,10 @@
// window.navigator.doNotTrack "yes" is for old versions of FF
// window.navigator.doNotTrack "1" is for current versions of FF + Chrome + Opera
// window.doNotTrack is safari
// window.navigator.msDoNotTrack
// window.doNotTrack is Safari + IE11
// 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" &&
window.navigator.doNotTrack !== "1" &&
window.doNotTrack !== "1" &&

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

@ -507,7 +507,6 @@ loop.standaloneRoomViews = (function(mozL10n) {
),
React.createElement(sharedViews.chat.TextChatView, {
dispatcher: this.props.dispatcher,
showAlways: true,
showRoomName: true,
useDesktopPaths: false}),
React.createElement("div", {className: "local"},

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

@ -507,7 +507,6 @@ loop.standaloneRoomViews = (function(mozL10n) {
</div>
<sharedViews.chat.TextChatView
dispatcher={this.props.dispatcher}
showAlways={true}
showRoomName={true}
useDesktopPaths={false} />
<div className="local">

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

@ -13,7 +13,7 @@
"dependencies": {},
"devDependencies": {
"eslint": "0.24.x",
"eslint-plugin-react": "2.6.x",
"eslint-plugin-react": "2.7.x",
"express": "4.x"
},
"scripts": {

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

@ -7,7 +7,7 @@ const HAWK_TOKEN_LENGTH = 64;
const {
LOOP_SESSION_TYPE,
MozLoopServiceInternal,
MozLoopService,
MozLoopService
} = Cu.import("resource:///modules/loop/MozLoopService.jsm", {});
const {LoopCalls} = Cu.import("resource:///modules/loop/LoopCalls.jsm", {});
const {LoopRooms} = Cu.import("resource:///modules/loop/LoopRooms.jsm", {});

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

@ -38,7 +38,7 @@ describe("loop.shared.views.TextChatView", function () {
});
describe("TextChatEntriesView", function() {
var view;
var view, node;
function mountTestComponent(extraProps) {
var basicProps = {
@ -52,6 +52,31 @@ describe("loop.shared.views.TextChatView", function () {
_.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() {
view = mountTestComponent({
messageList: [{
@ -67,7 +92,7 @@ describe("loop.shared.views.TextChatView", function () {
}]
});
var node = view.getDOMNode();
node = view.getDOMNode();
expect(node).to.not.eql(null);
var entries = node.querySelectorAll(".text-chat-entry");
@ -124,66 +149,6 @@ describe("loop.shared.views.TextChatView", function () {
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() {
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() {
var view, fakeServer;
@ -319,29 +326,12 @@ describe("loop.shared.views.TextChatView", function () {
.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() {
view = mountTestComponent();
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() {
view = mountTestComponent();

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

@ -25,7 +25,9 @@ body.tour {
body.normal .showPrivate,
body.private .showNormal,
body.tour #pageContainer,
body:not(.tour) .showTour {
body:not(.tour) .showTour,
body[tpEnabled] .showTpDisabled,
body:not([tpEnabled]) .showTpEnabled {
display: none !important;
}
@ -64,7 +66,7 @@ a {
font-size: 1rem;
}
button {
#startPrivateBrowsing {
margin-top: 1.2em;
-moz-margin-start: 0;
}
@ -126,6 +128,14 @@ button {
background-color: var(--in-content-primary-button-background-hover);
}
#tourTpDisabled {
font-size: 14px;
}
#enableTrackingProtection {
height: 40px;
}
#tourFooter {
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/PrivateBrowsingUtils.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
let stringBundle = Services.strings.createBundle(
"chrome://browser/locale/aboutPrivateBrowsing.properties");
@ -25,6 +26,20 @@ if (!PrivateBrowsingUtils.isContentWindowPrivate(window)) {
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) {
let icon = document.createElement("link");
icon.setAttribute("rel", "icon");
@ -51,12 +66,15 @@ document.addEventListener("DOMContentLoaded", function () {
let tourURL = formatURLPref("privacy.trackingprotection.introURL");
document.getElementById("startTour").setAttribute("href", tourURL);
document.getElementById("tourLearnMore").setAttribute("href", learnMoreURL);
// Update state that depends on preferences.
prefObserver.observe();
}
let startPrivateBrowsing = document.getElementById("startPrivateBrowsing");
if (startPrivateBrowsing) {
startPrivateBrowsing.addEventListener("command", openPrivateWindow);
}
document.getElementById("startPrivateBrowsing")
.addEventListener("command", openPrivateWindow);
document.getElementById("enableTrackingProtection")
.addEventListener("command", enableTrackingProtection);
}, false);
function openPrivateWindow() {
@ -64,3 +82,10 @@ function openPrivateWindow() {
document.dispatchEvent(
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 id="tourBottom" class="showTour">
<p id="tourDescription">&trackingProtection.description;</p>
<p><a id="startTour">&trackingProtection.startTour;</a></p>
<p><a id="showPreferences" href="about:preferences#privacy"
<p class="showTpEnabled"><a id="startTour">&trackingProtection.startTour;</a></p>
<p class="showTpEnabled"><a id="showPreferences" href="about:preferences#privacy"
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>
<p id="tourFooter" class="showTour">
<span id="tourFooterText">&aboutPrivateBrowsing.shortdescription;</span>

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

@ -97,3 +97,43 @@ add_task(function* test_tourActions() {
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");
XPCOMUtils.defineLazyModuleGetter(this, "Metrics",
"resource://gre/modules/Metrics.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode",
"resource://gre/modules/ReaderMode.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ReaderParent",
@ -120,6 +122,20 @@ this.UITour = {
widgetName: "urlbar-container",
}],
["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", {
query: (aDocument) => {
let customizeButton = aDocument.getElementById("PanelUI-customize");
@ -1725,7 +1741,7 @@ this.UITour = {
onPanelHidden: function(aEvent) {
aEvent.target.removeAttribute("noautohide");
UITour.recreatePopup(aEvent.target);
this.availableTargetsCache.clear();
UITour.availableTargetsCache.clear();
},
recreatePopup: function(aPanel) {

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

@ -15,6 +15,9 @@ skip-if = true # Bug 1113038 - Intermittent "Popup was opened"
[browser_trackingProtection.js]
skip-if = os == "linux" # Intermittent NS_ERROR_NOT_AVAILABLE [nsIUrlClassifierDBService.beginUpdate]
tag = trackingprotection
[browser_trackingProtection_tour.js]
skip-if = e10s # Bug 1073247 - UITour tests not e10s friendly
tag = trackingprotection
[browser_showMenu_controlCenter.js]
skip-if = e10s # Bug 1073247 - UITour tests not e10s friendly
tag = trackingprotection

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

@ -28,7 +28,7 @@ let tests = [
function test_testing_host(done) {
// Add two testing origins intentionally surrounded by whitespace to be ignored.
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(() => {
Services.prefs.clearUserPref("browser.uitour.testingOrigins");
@ -40,7 +40,7 @@ let tests = [
loadUITourTestPage(function() {
gContentAPI.getConfiguration("appinfo", callback);
}, "https://test2.example.com/");
}, "https://test2.example.org/");
},
function test_unsecure_host(done) {
loadUITourTestPage(function() {
@ -51,7 +51,7 @@ let tests = [
is(bookmarksMenu.open, false, "Bookmark menu should not open on a unsecure host");
done();
}, "http://example.com/");
}, "http://example.org/");
},
function test_unsecure_host_override(done) {
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");
Services.prefs.setBoolPref("browser.uitour.requireSecure", true);
}, "http://example.com/");
}, "http://example.org/");
},
function test_disabled(done) {
Services.prefs.setBoolPref("browser.uitour.enabled", false);

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

@ -31,7 +31,7 @@ let tests = [
is(desc.textContent, "some text", "Popup should have correct description text");
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(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");
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");
buttons = document.getElementById("UITourTooltipButtons");
@ -101,7 +101,7 @@ let tests = [
is(desc.textContent, "moar text", "Popup should have correct description text");
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");
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);
}
function getConfigurationPromise(configName) {
return new Promise(resolve => {
gContentAPI.getConfiguration(configName, data => resolve(data));
});
}
function hideInfoPromise(...args) {
let popup = document.getElementById("UITourTooltip");
gContentAPI.hideInfo.apply(gContentAPI, args);
@ -153,12 +159,13 @@ function promisePanelShown(win) {
function promisePanelElementEvent(win, aPanel, aEvent) {
let deferred = Promise.defer();
let timeoutId = win.setTimeout(() => {
deferred.reject("Panel did not show within 5 seconds.");
deferred.reject("Event did not happen within 5 seconds.");
}, 5000);
aPanel.addEventListener(aEvent, function onPanelEvent(e) {
aPanel.removeEventListener(aEvent, onPanelEvent);
win.clearTimeout(timeoutId);
deferred.resolve();
// Wait one tick to let UITour.jsm process the event as well.
executeSoon(deferred.resolve);
});
return deferred.promise;
}
@ -176,7 +183,7 @@ function is_element_hidden(element, msg) {
ok(is_hidden(element), msg);
}
function loadUITourTestPage(callback, host = "https://example.com/") {
function loadUITourTestPage(callback, host = "https://example.org/") {
if (gTestTab)
gBrowser.removeTab(gTestTab);
@ -198,8 +205,8 @@ function loadUITourTestPage(callback, host = "https://example.com/") {
function UITourTest() {
Services.prefs.setBoolPref("browser.uitour.enabled", true);
let testHttpsUri = Services.io.newURI("https://example.com", null, null);
let testHttpUri = Services.io.newURI("http://example.com", null, null);
let testHttpsUri = Services.io.newURI("https://example.org", null, null);
let testHttpUri = Services.io.newURI("http://example.org", null, null);
Services.perms.add(testHttpsUri, "uitour", Services.perms.ALLOW_ACTION);
Services.perms.add(testHttpUri, "uitour", Services.perms.ALLOW_ACTION);

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

@ -148,7 +148,7 @@ var HarAutomation = Class({
"defaultFileName");
}
this.executeExport(data);
return this.executeExport(data);
},
/**

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

@ -77,5 +77,10 @@ function register(toolbox) {
overlays.set(toolbox, overlay);
}
function get(toolbox) {
return overlays.get(toolbox);
}
// Exports from this module
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";
const HSTS_INVALID_HEADER_MSG = "The site specified an invalid " +
"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* () {
yield loadTab(TEST_URI);

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

@ -4,8 +4,12 @@
// 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";
const TEST_URI_PATH = "/browser/browser/devtools/webconsole/test/test-certificate-messages.html";
"use strict";
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 = [
{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);
let aOutputNode = gHud.outputNode;
waitForSuccess({
name: gCurrentTest.name,

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

@ -22,18 +22,23 @@ let test = asyncTest(function*() {
outputNode.focus();
EventUtils.synthesizeKey("-", { accelKey: true }, hud.iframeWindow);
is(inputNode.style.fontSize, "10px", "input font stays at same size with ctrl+-");
is(outputNode.style.fontSize, inputNode.style.fontSize, "output font stays at same size with ctrl+-");
is(inputNode.style.fontSize, "10px",
"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);
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);
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);
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/
*/
// When strings containing URLs are entered into the webconsole,
// check its output and ensure that the output can be clicked to open those URLs.
// When strings containing URLs are entered into the webconsole, check
// its output and ensure that the output can be clicked to open those URLs.
"use strict";

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

@ -6,32 +6,43 @@
// Check that inspecting a closure in the variables view sidebar works when
// 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;
function test()
{
function test() {
registerCleanupFunction(() => {
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(() => {
openConsole().then((hud) => {
openDebugger().then(({ toolbox, panelWin }) => {
let deferred = promise.defer();
panelWin.gThreadClient.addOneTimeListener("resumed", (aEvent, aPacket) => {
ok(true, "Debugger resumed");
deferred.resolve({ toolbox: toolbox, panelWin: panelWin });
});
resumeDebugger(toolbox, panelWin, deferred);
return deferred.promise;
}).then(({ toolbox, panelWin }) => {
let deferred = promise.defer();
panelWin.once(panelWin.EVENTS.FETCHED_SCOPES, (aEvent, aPacket) => {
ok(true, "Scopes were fetched");
toolbox.selectTool("webconsole").then(() => consoleOpened(hud));
deferred.resolve();
});
fetchScopes(hud, toolbox, panelWin, deferred);
let button = content.document.querySelector("button");
ok(button, "button element found");
@ -43,8 +54,7 @@ function test()
});
}
function consoleOpened(hud)
{
function consoleOpened(hud) {
gWebConsole = hud;
gJSTerm = hud.jsterm;
gJSTerm.execute("window.george.getName");
@ -59,9 +69,8 @@ function consoleOpened(hud)
}).then(onExecuteGetName);
}
function onExecuteGetName(aResults)
{
let clickable = aResults[0].clickableElements[0];
function onExecuteGetName(results) {
let clickable = results[0].clickableElements[0];
ok(clickable, "clickable object found");
gJSTerm.once("variablesview-fetched", onGetNameFetch);
@ -76,19 +85,17 @@ function onExecuteGetName(aResults)
});
}
function onGetNameFetch(aEvent, aVar)
{
gVariablesView = aVar._variablesView;
function onGetNameFetch(evt, view) {
gVariablesView = view._variablesView;
ok(gVariablesView, "variables view object");
findVariableViewProperties(aVar, [
findVariableViewProperties(view, [
{ name: /_pfactory/, value: "" },
], { webconsole: gWebConsole }).then(onExpandClosure);
}
function onExpandClosure(aResults)
{
let prop = aResults[0].matchedProp;
function onExpandClosure(results) {
let prop = results[0].matchedProp;
ok(prop, "matched the name property in the variables view");
gVariablesView.window.focus();

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

@ -5,7 +5,10 @@
// 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;
@ -21,7 +24,7 @@ function consoleOpened(aHud) {
waitForMessages({
webconsole: hud,
messages: [{
text: 'Error Message',
text: "Error Message",
category: CATEGORY_WEBDEV,
severity: SEVERITY_ERROR
}]
@ -30,12 +33,13 @@ function consoleOpened(aHud) {
function testLocationColumn() {
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++) {
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();

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

@ -5,6 +5,8 @@
// Tests that code completion works properly.
"use strict";
const TEST_URI = "data:text/html;charset=utf8,<p>test code completion";
let jsterm;
@ -49,19 +51,22 @@ let test = asyncTest(function* () {
yield complete(jsterm.COMPLETE_FORWARD);
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.
yield jsterm.complete(jsterm.COMPLETE_FORWARD);
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.
complete(jsterm.COMPLETE_BACKWARD);
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();
@ -76,7 +81,8 @@ let test = asyncTest(function* () {
input.value = "console.log('one');\nconsol";
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.
input.value = "Object.name.sl";
@ -93,7 +99,6 @@ let test = asyncTest(function* () {
jsterm = null;
});
function complete(type) {
let updated = jsterm.once("autocomplete-updated");
jsterm.complete(type);

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

@ -9,7 +9,8 @@
function test() {
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("/"));
Task.spawn(runner).then(finishTest);
@ -21,7 +22,8 @@ function test() {
const stack = [{
file: TEST_FILE,
fn: "thirdCall",
line: /\b2[123]\b/, // 21,22,23
// 21,22,23
line: /\b2[123]\b/,
}, {
file: TEST_FILE,
fn: "secondCall",

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

@ -7,7 +7,10 @@
// output anything in the web console and they do not throw any exceptions.
// 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() {
loadTab(TEST_URI).then(() => {

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

@ -7,7 +7,8 @@
"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*() {
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;
aHud.jsterm.clearOutput();
hud.jsterm.clearOutput();
console[aMethod]("foo-bar-baz");
console[aMethod]("baar-baz");
console[method]("foo-bar-baz");
console[method]("baar-baz");
yield waitForMessages({
webconsole: aHud,
webconsole: hud,
messages: [{
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,
"1 hidden " + aMethod + " node via string filtering")
is(outputNode.querySelectorAll(".filtered-by-string").length, 1,
"1 hidden " + method + " node via string filtering");
aHud.jsterm.clearOutput();
hud.jsterm.clearOutput();
// now toggle the current method off - make sure no visible message
// 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({
webconsole: aHud,
webconsole: hud,
messages: [{
text: "foo-bar-baz",
}],
});
setStringFilter("", aHud);
setStringFilter("", hud);
let filter;
switch(aMethod) {
switch (method) {
case "debug":
filter = "log";
break;
@ -67,35 +68,35 @@ function* testMethod(aMethod, aHud, aOutputNode) {
filter = "error";
break;
default:
filter = aMethod;
filter = method;
break;
}
aHud.setFilterState(filter, false);
hud.setFilterState(filter, false);
is(aOutputNode.querySelectorAll(".filtered-by-type").length, 1,
"1 message hidden for " + aMethod + " (logging turned off)")
is(outputNode.querySelectorAll(".filtered-by-type").length, 1,
"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,
"1 message shown for " + aMethod + " (logging turned on)")
is(outputNode.querySelectorAll(".message:not(.filtered-by-type)").length, 1,
"1 message shown for " + method + " (logging turned on)");
aHud.jsterm.clearOutput();
hud.jsterm.clearOutput();
// test for multiple arguments.
console[aMethod]("foo", "bar");
console[method]("foo", "bar");
yield waitForMessages({
webconsole: aHud,
webconsole: hud,
messages: [{
text: 'foo bar',
text: "foo bar",
category: CATEGORY_WEBDEV,
}],
})
});
}
function setStringFilter(aValue, aHud) {
aHud.ui.filterBox.value = aValue;
aHud.ui.adjustVisibilityOnSearchStringChange();
function setStringFilter(value, hud) {
hud.ui.filterBox.value = value;
hud.ui.adjustVisibilityOnSearchStringChange();
}

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

@ -1,16 +1,19 @@
/* Any copyright is dedicated to the Public Domain.
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";
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 options = {'set': [["dom.workers.sharedWorkers.enabled", true]]};
let options = {
set: [["dom.workers.sharedWorkers.enabled", true]]
};
SpecialPowers.pushPrefEnv(options, deferred.resolve);
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,
"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,
"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);
});

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

@ -2,8 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
function 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);

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

@ -30,8 +30,8 @@ let test = asyncTest(function*() {
let [msgWithText, msgWithObj] = [...result.matched];
ok(msgWithText && msgWithObj, "Two messages should have appeared");
let contextMenu = hud.iframeWindow.
document.getElementById("output-contextmenu");
let contextMenu = hud.iframeWindow.document
.getElementById("output-contextmenu");
let openInVarViewItem = contextMenu.querySelector("#menu_openInVarView");
let obj = msgWithObj.querySelector(".cm-variable");
let text = msgWithText.querySelector(".console-string");

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

@ -4,7 +4,10 @@
// 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() {
Task.spawn(runner).then(finishTest);

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

@ -8,15 +8,19 @@
"use strict";
function test() {
let originalNetPref = Services.prefs.getBoolPref("devtools.webconsole.filter.networkinfo");
let originalNetPref = Services.prefs
.getBoolPref("devtools.webconsole.filter.networkinfo");
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);
Task.spawn(runner).then(finishTest);
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 hud = yield openConsole(tab);
@ -43,7 +47,8 @@ function test() {
deferred.resolve();
});
EventUtils.synthesizeMouseAtCenter(urlNode, {clickCount: 2}, hud.iframeWindow);
EventUtils.synthesizeMouseAtCenter(urlNode, {clickCount: 2},
hud.iframeWindow);
yield deferred.promise;
}

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

@ -7,7 +7,8 @@
"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*() {
yield loadTab(TEST_URI);
@ -29,6 +30,8 @@ let test = asyncTest(function*() {
let inputNode = [...input.matched][0];
let outputNode = [...output.matched][0];
is(inputNode.getAttribute("category"), "input", "input node category is correct");
is(outputNode.getAttribute("category"), "output", "output node category is correct");
is(inputNode.getAttribute("category"), "input",
"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
// 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 - " +
"preference for toggling timestamps in messages";
"use strict";
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";
let hud;
@ -22,8 +24,7 @@ let test = asyncTest(function* () {
hud = null;
});
function consoleOpened()
{
function consoleOpened() {
info("console opened");
let prefValue = Services.prefs.getBoolPref(PREF_MESSAGE_TIMESTAMP);
ok(!prefValue, "messages have no timestamp by default (pref check)");
@ -34,8 +35,7 @@ function consoleOpened()
return toolbox.selectTool("options");
}
function onOptionsPanelSelected(panel)
{
function onOptionsPanelSelected(panel) {
info("options panel opened");
let prefChanged = gDevTools.once("pref-changed", onPrefChanged);
@ -46,8 +46,7 @@ function onOptionsPanelSelected(panel)
return prefChanged;
}
function onPrefChanged()
{
function onPrefChanged() {
info("pref changed");
let prefValue = Services.prefs.getBoolPref(PREF_MESSAGE_TIMESTAMP);
ok(prefValue, "messages have timestamps (pref check)");

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

@ -3,12 +3,14 @@
// Tests that the filter button context menu logic works correctly.
"use strict";
const TEST_URI = "http://example.com/";
function test() {
loadTab(TEST_URI).then(() => {
openConsole().then(testFilterButtons);
})
});
}
function testFilterButtons(aHud) {
@ -32,21 +34,21 @@ function testRightClick(aCategory, hudBox, aHud) {
function verifyContextMenuIsClosed() {
info("verify the context menu is closed");
is(button.getAttribute("open"), false, "The context menu for the \"" + aCategory +
"\" button is closed");
is(button.getAttribute("open"), false, "The context menu for the \"" +
aCategory + "\" button is closed");
}
function verifyOriginalCheckedState() {
info("verify the button has the original checked state");
is(button.getAttribute("aria-pressed"), origCheckedState,
"The button state should not have changed");
};
}
function verifyNewCheckedState() {
info("verify the button's checked state has changed");
isnot(button.getAttribute("aria-pressed"), origCheckedState,
"The button state should have changed");
};
}
function leftClickToClose() {
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.
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* () {
yield loadTab(TEST_URI);
@ -15,8 +18,9 @@ let test = asyncTest(function* () {
function testForOf(hud) {
let deferred = promise.defer();
var jsterm = hud.jsterm;
jsterm.execute("{ [x.tagName for (x of document.body.childNodes) if (x.nodeType === 1)].join(' '); }",
let jsterm = hud.jsterm;
jsterm.execute("{ [x.tagName for (x of document.body.childNodes) " +
"if (x.nodeType === 1)].join(' '); }",
(node) => {
ok(/H1 DIV H2 P/.test(node.textContent),
"for-of loop should find all top-level nodes");

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

@ -7,7 +7,8 @@
"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.
const HISTORY_BACK = -1;
@ -23,14 +24,14 @@ let test = asyncTest(function*() {
let executeList = ["document", "window", "window.location"];
for (var item of executeList) {
for (let item of executeList) {
input.value = item;
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);
is (input.value, executeList[i], "check history previous idx:" + i);
is(input.value, executeList[x], "check history previous idx:" + x);
}
jsterm.historyPeruse(HISTORY_BACK);
@ -39,7 +40,7 @@ let test = asyncTest(function*() {
jsterm.historyPeruse(HISTORY_BACK);
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);
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
// clicking on the object in console (bug 1035198).
"use strict;"
"use strict";
const TEST_CASES = [
{

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

@ -7,7 +7,8 @@
"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*() {
yield loadTab(TEST_URI);
@ -23,8 +24,7 @@ let test = asyncTest(function*() {
let length = input.value.length;
input.selectionEnd = length;
input.selectionStart = length;
function getHeight()
{
function getHeight() {
return input.clientHeight;
}
let initialHeight = getHeight();

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

@ -3,7 +3,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const 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;
@ -28,8 +31,7 @@ function checkResult(msg, desc) {
if (typeof msg == "string") {
is(node.textContent.trim(), msg,
"correct message shown for " + desc);
}
else if (typeof msg == "function") {
} else if (typeof msg == "function") {
ok(msg(node), "correct message shown for " + desc);
}
@ -38,9 +40,9 @@ function checkResult(msg, desc) {
return def.promise;
}
function* testJSTerm(hud)
{
const HELP_URL = "https://developer.mozilla.org/docs/Tools/Web_Console/Helpers";
function* testJSTerm(hud) {
const HELP_URL = "https://developer.mozilla.org/docs/Tools/" +
"Web_Console/Helpers";
jsterm.clearOutput();
yield jsterm.execute("$('#header').getAttribute('id')");
@ -59,8 +61,7 @@ function* testJSTerm(hud)
yield waitForSuccess({
name: "clear() worked",
validator: function()
{
validator: function() {
return jsterm.outputNode.childNodes.length == 0;
}
});

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

@ -7,7 +7,8 @@
"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*() {
yield loadTab(TEST_URI);

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

@ -7,7 +7,8 @@
"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*() {
yield loadTab(TEST_URI);
@ -27,7 +28,7 @@ let test = asyncTest(function*() {
category: CATEGORY_WEBDEV,
severity: SEVERITY_LOG,
}],
})
});
is(hud.outputNode.children.length, 50, "number of messages");
@ -88,9 +89,8 @@ function countMessageNodes(hud) {
return displayedMessageNodes;
}
function setStringFilter(hud, aValue)
{
hud.ui.filterBox.value = aValue;
function setStringFilter(hud, value) {
hud.ui.filterBox.value = value;
hud.ui.adjustVisibilityOnSearchStringChange();
}

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

@ -5,12 +5,13 @@
// Tests that the text filter box works to filter based on filenames
// 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;
"use strict";
let test = asyncTest(function* () {
yield loadTab(TEST_URI);
@ -32,7 +33,7 @@ function consoleOpened() {
category: CATEGORY_WEBDEV,
severity: SEVERITY_LOG
}],
})
});
}
function testLiveFilteringOnSearchStrings() {
@ -74,9 +75,8 @@ function countMessageNodes() {
return displayedMessageNodes;
}
function setStringFilter(aValue)
{
hud.ui.filterBox.value = aValue;
function setStringFilter(value) {
hud.ui.filterBox.value = value;
hud.ui.adjustVisibilityOnSearchStringChange();
}

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

@ -5,7 +5,8 @@
"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*() {
yield loadTab(TEST_URI);

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

@ -12,11 +12,16 @@
// 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 =
'{ id: "test JSON data", myArray: [ "foo", "bar", "baz", "biff" ] }';
@ -25,8 +30,7 @@ let lastRequest = null;
let requestCallback = null;
let browser, hud;
function test()
{
function test() {
loadTab(TEST_URI).then((tab) => {
browser = tab.browser;
@ -40,9 +44,8 @@ function test()
});
}
function requestCallbackWrapper(aRequest)
{
lastRequest = aRequest;
function requestCallbackWrapper(request) {
lastRequest = request;
hud.ui.webConsoleClient.getResponseContent(lastRequest.actor,
function(aResponse) {
@ -50,9 +53,9 @@ function requestCallbackWrapper(aRequest)
lastRequest.discardResponseBody = aResponse.contentDiscarded;
hud.ui.webConsoleClient.getRequestPostData(lastRequest.actor,
function(aResponse) {
lastRequest.request.postData = aResponse.postData;
lastRequest.discardRequestBody = aResponse.postDataDiscarded;
function(response) {
lastRequest.request.postData = response.postData;
lastRequest.discardRequestBody = response.postDataDiscarded;
if (requestCallback) {
requestCallback();
@ -61,8 +64,7 @@ function requestCallbackWrapper(aRequest)
});
}
function testPageLoad()
{
function testPageLoad() {
requestCallback = function() {
// Check if page load was logged correctly.
ok(lastRequest, "Page load was logged");
@ -84,8 +86,7 @@ function testPageLoad()
content.location = TEST_NETWORK_REQUEST_URI;
}
function testPageLoadBody()
{
function testPageLoadBody() {
// Turn on logging of request bodies and check again.
hud.ui.setSaveRequestAndResponseBodies(true).then(() => {
ok(hud.ui._saveRequestAndResponseBodies,
@ -95,8 +96,7 @@ function testPageLoadBody()
});
}
function testPageLoadBodyAfterSettingUpdate()
{
function testPageLoadBodyAfterSettingUpdate() {
let loaded = false;
let requestCallbackInvoked = false;
@ -127,8 +127,7 @@ function testPageLoadBodyAfterSettingUpdate()
content.location.reload();
}
function testXhrGet()
{
function testXhrGet() {
requestCallback = function() {
ok(lastRequest, "testXhrGet() was logged");
is(lastRequest.request.method, "GET", "Method is correct");
@ -146,8 +145,7 @@ function testXhrGet()
content.wrappedJSObject.testXhrGet();
}
function testXhrPost()
{
function testXhrPost() {
requestCallback = function() {
ok(lastRequest, "testXhrPost() was logged");
is(lastRequest.request.method, "POST", "Method is correct");
@ -165,20 +163,19 @@ function testXhrPost()
content.wrappedJSObject.testXhrPost();
}
function testFormSubmission()
{
function testFormSubmission() {
// 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.
requestCallback = function() {
ok(lastRequest, "testFormSubmission() was logged");
is(lastRequest.request.method, "POST", "Method is correct");
isnot(lastRequest.request.postData.text.
indexOf("Content-Type: application/x-www-form-urlencoded"), -1,
isnot(lastRequest.request.postData.text
.indexOf("Content-Type: application/x-www-form-urlencoded"), -1,
"Content-Type is correct");
isnot(lastRequest.request.postData.text.
indexOf("Content-Length: 20"), -1, "Content-length is correct");
isnot(lastRequest.request.postData.text.
indexOf("name=foo+bar&age=144"), -1, "Form data is correct");
isnot(lastRequest.request.postData.text
.indexOf("Content-Length: 20"), -1, "Content-length is correct");
isnot(lastRequest.request.postData.text
.indexOf("name=foo+bar&age=144"), -1, "Form data is correct");
is(lastRequest.response.content.text.indexOf("<!DOCTYPE HTML>"), 0,
"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
// within separate test files.
let networkPanel = hud.ui.openNetworkPanel(hud.ui.filterBox, lastRequest);
@ -213,4 +208,3 @@ function testNetworkPanel()
executeSoon(finishTest);
}, true);
}

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

@ -3,14 +3,19 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const 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* () {
yield loadTab(TEST_URI);
let consoleOpened = promise.defer();
let gotEvents = waitForEvents(consoleOpened.promise);
let hud = yield openConsole().then(() => consoleOpened.resolve());
yield openConsole().then(() => {
consoleOpened.resolve();
});
yield gotEvents;
});
@ -18,25 +23,22 @@ let test = asyncTest(function* () {
function waitForEvents(onConsoleOpened) {
let deferred = promise.defer();
function webConsoleCreated(aID)
{
function webConsoleCreated(id) {
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");
}
function webConsoleDestroyed(aID)
{
function webConsoleDestroyed(id) {
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);
}
function webConsoleMessage(aID, aNodeID)
{
function webConsoleMessage(id, nodeID) {
Services.obs.removeObserver(observer, "web-console-message-created");
ok(aID, "we have a console ID");
is(typeof aNodeID, "string", "message node id is a string");
ok(id, "we have a console ID");
is(typeof nodeID, "string", "message node id is a string");
onConsoleOpened.then(closeConsole);
}
@ -44,32 +46,30 @@ function waitForEvents(onConsoleOpened) {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]),
observe: function observe(aSubject, aTopic, aData)
{
aSubject = aSubject.QueryInterface(Ci.nsISupportsString);
observe: function observe(subject, topic, data) {
subject = subject.QueryInterface(Ci.nsISupportsString);
switch(aTopic) {
switch (topic) {
case "web-console-created":
webConsoleCreated(aSubject.data);
webConsoleCreated(subject.data);
break;
case "web-console-destroyed":
webConsoleDestroyed(aSubject.data);
webConsoleDestroyed(subject.data);
break;
case "web-console-message-created":
webConsoleMessage(aSubject, aData);
webConsoleMessage(subject, data);
break;
default:
break;
}
},
init: function init()
{
init: function init() {
Services.obs.addObserver(this, "web-console-created", false);
Services.obs.addObserver(this, "web-console-destroyed", false);
Services.obs.addObserver(this, "web-console-message-created", false);
}
}
};
observer.init();

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

@ -10,7 +10,8 @@
function test() {
function* runner() {
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 hud = yield openConsole(tab);
@ -40,7 +41,7 @@ function test() {
if (aLink == TEST_PAGE_URI) {
linkOpened = true;
}
}
};
EventUtils.synthesizeMouseAtCenter(urlNode, {}, hud.iframeWindow);

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

@ -3,11 +3,12 @@
* http://creativecommons.org/publicdomain/zero/1.0/
*/
///////////////////
//
// Whitelisting this test.
// As part of bug 1077403, the leaking uncaught rejection should be fixed.
//
"use strict";
thisTestLeaksUncaughtRejectionsAndShouldBeFixed("null");
// Test the webconsole output for various types of objects.

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

@ -5,7 +5,10 @@
// 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 = [
// 0 - native named function
@ -64,8 +67,8 @@ let inputTests = [
// 6 - array with objects
{
input: "window.array2",
output: 'Array [ "a", HTMLDocument \u2192 test-console-output-02.html, <body>, ' +
"DOMStringMap[0], DOMTokenList[0] ]",
output: 'Array [ "a", HTMLDocument \u2192 test-console-output-02.html, ' +
"<body>, DOMStringMap[0], DOMTokenList[0] ]",
printOutput: '"a,[object HTMLDocument],[object HTMLBodyElement],' +
'[object DOMStringMap],"',
inspectable: true,
@ -75,8 +78,9 @@ let inputTests = [
// 7 - array with more than 10 elements
{
input: "window.array3",
output: 'Array [ 1, Window \u2192 test-console-output-02.html, null, "a", "b", ' +
'undefined, false, "", -Infinity, testfn3DisplayName(), 3 more\u2026 ]',
output: 'Array [ 1, Window \u2192 test-console-output-02.html, null, ' +
'"a", "b", undefined, false, "", -Infinity, ' +
'testfn3DisplayName(), 3 more\u2026 ]',
printOutput: '"1,[object Window],,a,b,,false,,-Infinity,' +
'function testfn3() { return 42; },[object Object],foo,bar"',
inspectable: true,
@ -104,7 +108,8 @@ let inputTests = [
// 10 - Set with cyclic reference
{
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]",
inspectable: true,
variablesViewLabel: "Set[9]",
@ -113,8 +118,8 @@ let inputTests = [
// 11 - Object with cyclic reference and a getter
{
input: "window.testobj2",
output: 'Object { a: "b", c: "d", e: 1, f: "2", foo: Object, bar: Object, ' +
"getterTest: Getter }",
output: 'Object { a: "b", c: "d", e: 1, f: "2", foo: Object, ' +
"bar: Object, getterTest: Getter }",
printOutput: "[object Object]",
inspectable: true,
variablesViewLabel: "Object",
@ -123,8 +128,9 @@ let inputTests = [
// 12 - Object with more than 10 properties
{
input: "window.testobj3",
output: 'Object { a: "b", c: "d", e: 1, f: "2", g: true, h: null, i: undefined, ' +
'j: "", k: StyleSheetList[0], l: NodeList[5], 2 more\u2026 }',
output: 'Object { a: "b", c: "d", e: 1, f: "2", g: true, h: null, ' +
'i: undefined, j: "", k: StyleSheetList[0], l: NodeList[5], ' +
'2 more\u2026 }',
printOutput: "[object Object]",
inspectable: true,
variablesViewLabel: "Object",

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

@ -5,7 +5,10 @@
// 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 = [

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

@ -3,16 +3,18 @@
* http://creativecommons.org/publicdomain/zero/1.0/
*/
///////////////////
//
// Whitelisting this test.
// As part of bug 1077403, the leaking uncaught rejection should be fixed.
//
"use strict";
thisTestLeaksUncaughtRejectionsAndShouldBeFixed("null");
// 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 = [
// 0
@ -36,7 +38,7 @@ let inputTests = [
// 2
{
input: "testDocumentFragment()",
output: 'DocumentFragment [ <div#foo1.bar>, <div#foo3> ]',
output: "DocumentFragment [ <div#foo1.bar>, <div#foo3> ]",
printOutput: "[object DocumentFragment]",
inspectable: true,
variablesViewLabel: "DocumentFragment[2]",
@ -56,7 +58,8 @@ let inputTests = [
// 4
{
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"',
inspectable: true,
variablesViewLabel: "SyntaxError",

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

@ -5,8 +5,11 @@
// 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 ELLIPSIS = Services.prefs.getComplexValue("intl.ellipsis", Ci.nsIPrefLocalizedString).data;
const ELLIPSIS = Services.prefs.getComplexValue("intl.ellipsis",
Ci.nsIPrefLocalizedString).data;
let dateNow = Date.now();
@ -99,7 +102,8 @@ let inputTests = [
// 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 }',
printOutput: "[object Promise]",
inspectable: true,
@ -108,8 +112,11 @@ let inputTests = [
// 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})",
output: 'Object { 1: "this is supposed to be a very long ' + ELLIPSIS + '", 2: "a shorter string", 3: 100 }',
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})",
output: 'Object { 1: "this is supposed to be a very long ' + ELLIPSIS +
'", 2: "a shorter string", 3: 100 }',
printOutput: "[object Object]",
inspectable: false,
}

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

@ -1,84 +1,87 @@
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test the webconsole output for various arrays.
const TEST_URI = "data:text/html;charset=utf8,test for console output - 06";
const ELLIPSIS = Services.prefs.getComplexValue("intl.ellipsis", Ci.nsIPrefLocalizedString).data;
const test_str_in = "SHOW\\nALL\\nOF\\nTHIS\\nON\\nA\\nSINGLE\\nLINE ONLY. ESCAPE ALL NEWLINE";
const test_str_out = "SHOW ALL OF THIS ON A SINGLE LINE O" + ELLIPSIS;
const ELLIPSIS = Services.prefs.getComplexValue("intl.ellipsis",
Ci.nsIPrefLocalizedString).data;
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 = [
// 1 - array with empty slots only
{
input: 'Array(5)',
output: 'Array [ <5 empty slots> ]',
printOutput: ',,,,',
input: "Array(5)",
output: "Array [ <5 empty slots> ]",
printOutput: ",,,,",
inspectable: true,
variablesViewLabel: "Array[5]",
},
// 2 - array with one empty slot at the beginning
{
input: '[,1,2,3]',
output: 'Array [ <1 empty slot>, 1, 2, 3 ]',
input: "[,1,2,3]",
output: "Array [ <1 empty slot>, 1, 2, 3 ]",
printOutput: ",1,2,3",
inspectable: true,
variablesViewLabel: "Array[4]",
},
// 3 - array with multiple consecutive empty slots at the beginning
{
input: '[,,,3,4,5]',
output: 'Array [ <3 empty slots>, 3, 4, 5 ]',
input: "[,,,3,4,5]",
output: "Array [ <3 empty slots>, 3, 4, 5 ]",
printOutput: ",,,3,4,5",
inspectable: true,
variablesViewLabel: "Array[6]",
},
// 4 - array with one empty slot at the middle
{
input: '[0,1,,3,4,5]',
output: 'Array [ 0, 1, <1 empty slot>, 3, 4, 5 ]',
input: "[0,1,,3,4,5]",
output: "Array [ 0, 1, <1 empty slot>, 3, 4, 5 ]",
printOutput: "0,1,,3,4,5",
inspectable: true,
variablesViewLabel: "Array[6]",
},
// 5 - array with multiple successive empty slots at the middle
{
input: '[0,1,,,,5]',
output: 'Array [ 0, 1, <3 empty slots>, 5 ]',
input: "[0,1,,,,5]",
output: "Array [ 0, 1, <3 empty slots>, 5 ]",
printOutput: "0,1,,,,5",
inspectable: true,
variablesViewLabel: "Array[6]",
},
// 6 - array with multiple non successive single empty slots
{
input: '[0,,2,,4,5]',
output: 'Array [ 0, <1 empty slot>, 2, <1 empty slot>, 4, 5 ]',
input: "[0,,2,,4,5]",
output: "Array [ 0, <1 empty slot>, 2, <1 empty slot>, 4, 5 ]",
printOutput: "0,,2,,4,5",
inspectable: true,
variablesViewLabel: "Array[6]",
},
// 7 - array with multiple multi-slot holes
{
input: '[0,,,3,,,,7,8]',
output: 'Array [ 0, <2 empty slots>, 3, <3 empty slots>, 7, 8 ]',
input: "[0,,,3,,,,7,8]",
output: "Array [ 0, <2 empty slots>, 3, <3 empty slots>, 7, 8 ]",
printOutput: "0,,,3,,,,7,8",
inspectable: true,
variablesViewLabel: "Array[9]",
},
// 8 - array with a single slot hole at the end
{
input: '[0,1,2,3,4,,]',
output: 'Array [ 0, 1, 2, 3, 4, <1 empty slot> ]',
input: "[0,1,2,3,4,,]",
output: "Array [ 0, 1, 2, 3, 4, <1 empty slot> ]",
printOutput: "0,1,2,3,4,",
inspectable: true,
variablesViewLabel: "Array[6]",
},
// 9 - array with multiple consecutive empty slots at the end
{
input: '[0,1,2,,,,]',
output: 'Array [ 0, 1, 2, <3 empty slots> ]',
input: "[0,1,2,,,,]",
output: "Array [ 0, 1, 2, <3 empty slots> ]",
printOutput: "0,1,2,,,",
inspectable: true,
variablesViewLabel: "Array[6]",
@ -86,8 +89,8 @@ let inputTests = [
// 10 - array with members explicitly set to null
{
input: '[0,null,null,3,4,5]',
output: 'Array [ 0, null, null, 3, 4, 5 ]',
input: "[0,null,null,3,4,5]",
output: "Array [ 0, null, null, 3, 4, 5 ]",
printOutput: "0,,,3,4,5",
inspectable: true,
variablesViewLabel: "Array[6]"
@ -95,8 +98,8 @@ let inputTests = [
// 11 - array with members explicitly set to undefined
{
input: '[0,undefined,undefined,3,4,5]',
output: 'Array [ 0, undefined, undefined, 3, 4, 5 ]',
input: "[0,undefined,undefined,3,4,5]",
output: "Array [ 0, undefined, undefined, 3, 4, 5 ]",
printOutput: "0,,,3,4,5",
inspectable: true,
variablesViewLabel: "Array[6]"
@ -104,10 +107,14 @@ let inputTests = [
// 12 - array with long strings as elements
{
input: '["' + test_str_in + '", "' + test_str_in + '", "' + test_str_in + '"]',
output: 'Array [ "' + test_str_out + '", "' + test_str_out + '", "' + test_str_out + '" ]',
input: '["' + testStrIn + '", "' + testStrIn + '", "' + testStrIn + '"]',
output: 'Array [ "' + testStrOut + '", "' + testStrOut + '", "' +
testStrOut + '" ]',
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]"
},
@ -129,8 +136,10 @@ let inputTests = [
// 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"})',
output: 'Object [ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", 2 more\u2026 ]',
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"})',
output: 'Object [ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", ' +
'2 more\u2026 ]',
printOutput: "[object Object]",
inspectable: true,
variablesViewLabel: "Object[12]",
@ -138,8 +147,10 @@ let inputTests = [
// 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"})',
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 }',
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"})',
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]",
inspectable: true,
variablesViewLabel: "Object",

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

@ -14,8 +14,8 @@ let test = asyncTest(function*() {
let hud = yield openConsole();
hud.jsterm.clearOutput();
let controller = top.document.commandDispatcher.
getControllerForCommand("cmd_copy");
let controller = top.document.commandDispatcher
.getControllerForCommand("cmd_copy");
is(controller.isCommandEnabled("cmd_copy"), false, "cmd_copy is disabled");
content.console.log("Hello world! bug916997a");
@ -38,7 +38,8 @@ let test = asyncTest(function*() {
hud.outputNode.focus();
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");
let selection = hud.iframeWindow.getSelection() + "";
@ -48,7 +49,9 @@ let test = asyncTest(function*() {
clipboardValue = str;
return str.indexOf("bug916997a") > -1 && str.indexOf("bug916997b") > -1;
},
() => { goDoCommand("cmd_copy"); },
() => {
goDoCommand("cmd_copy");
},
() => {
info("clipboard value '" + clipboardValue + "'");
let lines = clipboardValue.trim().split("\n");

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

@ -3,17 +3,18 @@
* http://creativecommons.org/publicdomain/zero/1.0/
*/
///////////////////
//
// Whitelisting this test.
// As part of bug 1077403, the leaking uncaught rejections should be fixed.
//
"use strict";
thisTestLeaksUncaughtRejectionsAndShouldBeFixed(null);
thisTestLeaksUncaughtRejectionsAndShouldBeFixed("TypeError: this.toolbox is null");
// 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 = [
{
@ -36,7 +37,7 @@ let inputTests = [
{
input: "testDocument()",
output: 'HTMLDocument \u2192 ' + TEST_URI,
output: "HTMLDocument \u2192 " + TEST_URI,
printOutput: "[object HTMLDocument]",
inspectable: true,
noClick: true,
@ -54,7 +55,9 @@ let inputTests = [
{
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]",
inspectable: true,
noClick: true,
@ -63,7 +66,7 @@ let inputTests = [
{
input: "testNodeInIframe()",
output: '<p>',
output: "<p>",
printOutput: "[object HTMLParagraphElement]",
inspectable: true,
noClick: true,
@ -72,7 +75,7 @@ let inputTests = [
{
input: "testDocumentFragment()",
output: 'DocumentFragment [ <span.foo>, <div#fragdiv> ]',
output: "DocumentFragment [ <span.foo>, <div#fragdiv> ]",
printOutput: "[object DocumentFragment]",
inspectable: true,
noClick: true,

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

@ -6,35 +6,54 @@
// Test the inspector links in the webconsole output for DOM Nodes actually
// 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 = [
{
// 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
// event
// default selected node, so re-selecting it won't fire the
// inspector-updated event
input: "testNode()",
output: '<p some-attribute="some-value">',
tagName: 'P',
tagName: "P",
attrs: [{name: "some-attribute", value: "some-value"}]
},
{
input: "testBodyNode()",
output: '<body id="body-id" class="body-class">',
tagName: 'BODY',
attrs: [{name: "id", value: "body-id"}, {name: "class", value: "body-class"}]
tagName: "BODY",
attrs: [
{
name: "id", value: "body-id"
},
{
name: "class", value: "body-class"
}
]
},
{
input: "testNodeInIframe()",
output: '<p>',
tagName: 'P',
output: "<p>",
tagName: "P",
attrs: []
},
{
input: "testDocumentElement()",
output: '<html lang="en-US" dir="ltr">',
tagName: 'HTML',
attrs: [{name: "lang", value: "en-US"}, {name: "dir", value: "ltr"}]
tagName: "HTML",
attrs: [
{
name: "lang",
value: "en-US"
},
{
name: "dir",
value: "ltr"
}
]
}
];
@ -53,12 +72,13 @@ function test() {
info("Iterating over the test data");
for (let data of TEST_DATA) {
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");
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 onInspectorUpdated = inspector.once("inspector-updated");
let onNewNode = toolbox.selection.once("new-node-front");
@ -77,8 +97,10 @@ function test() {
let attrs = nodeFront.attributes;
for (let i in data.attrs) {
is(attrs[i].name, data.attrs[i].name, "The correct node was highlighted");
is(attrs[i].value, data.attrs[i].value, "The correct node was highlighted");
is(attrs[i].name, data.attrs[i].name,
"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");

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

@ -6,7 +6,10 @@
// Test that inspector links in webconsole outputs for DOM Nodes highlight
// 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() {
Task.spawn(function*() {
@ -17,7 +20,7 @@ function test() {
// Loading the inspector panel at first, to make it possible to listen for
// new node selections
yield toolbox.loadTool("inspector");
let inspector = toolbox.getPanel("inspector");
toolbox.getPanel("inspector");
info("Executing 'testNode()' in the web console to output a DOM Node");
let [result] = yield jsEval("testNode()", hud, {

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

@ -6,13 +6,16 @@
// Test that inspector links in the webconsole output for DOM Nodes do not try
// 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 = [
{
// 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
// event
// default selected node, so re-selecting it won't fire the
// inspector-updated event
input: "testNode()",
output: '<p some-attribute="some-value">'
},
@ -22,7 +25,7 @@ const TEST_DATA = [
},
{
input: "testNodeInIframe()",
output: '<p>'
output: "<p>"
},
{
input: "testDocumentElement()",

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

@ -3,16 +3,17 @@
* http://creativecommons.org/publicdomain/zero/1.0/
*/
///////////////////
//
// Whitelisting this test.
// As part of bug 1077403, the leaking uncaught rejection should be fixed.
//
"use strict";
thisTestLeaksUncaughtRejectionsAndShouldBeFixed("null");
// 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* () {
yield loadTab(TEST_URI);

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

@ -8,19 +8,19 @@
"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*() {
yield loadTab(TEST_URI);
let hud = yield openConsole();
let jsterm = hud.jsterm;
let outputNode = jsterm.outputNode;
jsterm.clearOutput();
jsterm.execute("console.log('foo', 'bar');");
let [function_call, result, console_message] = yield waitForMessages({
let [functionCall, result, consoleMessage] = yield waitForMessages({
webconsole: hud,
messages: [{
text: "console.log('foo', 'bar');",
@ -31,17 +31,17 @@ let test = asyncTest(function*() {
category: CATEGORY_OUTPUT,
},
{
text: 'foo bar',
text: "foo bar",
category: CATEGORY_WEBDEV,
severity: SEVERITY_LOG,
}],
});
let fncall_node = [...function_call.matched][0];
let result_node = [...result.matched][0];
let console_message_node = [...console_message.matched][0];
is(fncall_node.nextElementSibling, result_node,
let fncallNode = [...functionCall.matched][0];
let resultNode = [...result.matched][0];
let consoleMessageNode = [...consoleMessage.matched][0];
is(fncallNode.nextElementSibling, resultNode,
"console.log() is followed by undefined");
is(result_node.nextElementSibling, console_message_node,
is(resultNode.nextElementSibling, consoleMessageNode,
"undefined is followed by 'foo' 'bar'");
});

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

@ -5,7 +5,10 @@
// 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();

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

@ -6,7 +6,8 @@
"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 = [
{
@ -63,19 +64,26 @@ const TEST_DATA = [
{
command: "console.table(family)",
data: [
{ _index: "mother", firstName: "\"Susan\"", lastName: "\"Doyle\"", age: "32" },
{ _index: "father", firstName: "\"John\"", lastName: "\"Doyle\"", age: "33" },
{ _index: "daughter", firstName: "\"Lily\"", lastName: "\"Doyle\"", age: "5" },
{ _index: "mother", firstName: "\"Susan\"", lastName: "\"Doyle\"",
age: "32" },
{ _index: "father", firstName: "\"John\"", lastName: "\"Doyle\"",
age: "33" },
{ _index: "daughter", firstName: "\"Lily\"", lastName: "\"Doyle\"",
age: "5" },
{ _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, [])",
data: [
{ _index: "mother", firstName: "\"Susan\"", lastName: "\"Doyle\"", age: "32" },
{ _index: "father", firstName: "\"John\"", lastName: "\"Doyle\"", age: "33" },
{ _index: "daughter", firstName: "\"Lily\"", lastName: "\"Doyle\"", age: "5" },
{ _index: "mother", firstName: "\"Susan\"", lastName: "\"Doyle\"",
age: "32" },
{ _index: "father", firstName: "\"John\"", lastName: "\"Doyle\"",
age: "33" },
{ _index: "daughter", firstName: "\"Lily\"", lastName: "\"Doyle\"",
age: "5" },
{ _index: "son", firstName: "\"Mike\"", lastName: "\"Doyle\"", age: "8" },
],
columns: { _index: "(index)" }
@ -83,9 +91,12 @@ const TEST_DATA = [
{
command: "console.table(family, ['firstName', 'lastName'])",
data: [
{ _index: "mother", firstName: "\"Susan\"", lastName: "\"Doyle\"", age: "32" },
{ _index: "father", firstName: "\"John\"", lastName: "\"Doyle\"", age: "33" },
{ _index: "daughter", firstName: "\"Lily\"", lastName: "\"Doyle\"", age: "5" },
{ _index: "mother", firstName: "\"Susan\"", lastName: "\"Doyle\"",
age: "32" },
{ _index: "father", firstName: "\"John\"", lastName: "\"Doyle\"",
age: "33" },
{ _index: "daughter", firstName: "\"Lily\"", lastName: "\"Doyle\"",
age: "5" },
{ _index: "son", firstName: "\"Mike\"", lastName: "\"Doyle\"", age: "8" },
],
columns: { _index: "(index)", firstName: "firstName", lastName: "lastName" }
@ -104,7 +115,8 @@ const TEST_DATA = [
{
command: "console.table(myMap)",
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\"" },
],
columns: { _index: "(iteration index)", _key: "Key", _value: "Values" }
@ -141,18 +153,19 @@ add_task(function*() {
ok(obj._data, "found table data object");
let data = obj._data.map(entries => {
let result = {};
let entryResult = {};
for (let key of Object.keys(entries)) {
result[key] = entries[key] instanceof HTMLElement ?
entryResult[key] = entries[key] instanceof HTMLElement ?
entries[key].textContent : entries[key];
}
return result;
return entryResult;
});
is(data.toSource(), testdata.data.toSource(), "table data is correct");
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.
"use strict";
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_INITIAL_LENGTH = DebuggerServer.LONG_STRING_INITIAL_LENGTH;
@ -15,7 +18,8 @@ DebuggerServer.LONG_STRING_LENGTH = 100;
DebuggerServer.LONG_STRING_INITIAL_LENGTH = 50;
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 = [
// 0

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

@ -6,6 +6,8 @@
// Tests the property provider, which is part of the code completion
// infrastructure.
"use strict";
const TEST_URI = "data:text/html;charset=utf8,<p>test the JS property provider";
function test() {
@ -14,12 +16,13 @@ function test() {
function testPropertyProvider({browser}) {
browser.removeEventListener("load", testPropertyProvider, true);
let tools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
let JSPropertyProvider = tools.require("devtools/toolkit/webconsole/utils").JSPropertyProvider;
let {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
let {require} = devtools;
let {JSPropertyProvider} = require("devtools/toolkit/webconsole/utils");
let tmp = Cu.import("resource://gre/modules/jsdebugger.jsm", {});
tmp.addDebuggerToGlobal(tmp);
let dbg = new tmp.Debugger;
let dbg = new tmp.Debugger();
let dbgWindow = dbg.makeGlobalObjectReference(content);
let completion = JSPropertyProvider(dbgWindow, null, "thisIsNotDefined");
@ -30,16 +33,15 @@ function testPropertyProvider({browser}) {
is(completion, null, "no match for 'window[1].acb");
// A very advanced completion case.
var strComplete =
'function a() { }document;document.getElementById(window.locatio';
let strComplete =
"function a() { }document;document.getElementById(window.locatio";
completion = JSPropertyProvider(dbgWindow, null, strComplete);
ok(completion.matches.length == 2, "two matches found");
ok(completion.matchProp == "locatio", "matching part is 'test'");
var matches = completion.matches;
let matches = completion.matches;
matches.sort();
ok(matches[0] == "location", "the first match is 'location'");
ok(matches[1] == "locationbar", "the second match is 'locationbar'");
finishTest();
}

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

@ -5,14 +5,15 @@
"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 { browser } = yield loadTab(TEST_URI);
let hud = yield openConsole();
function onReflowListenersReady(aType, aPacket) {
function onReflowListenersReady() {
browser.contentDocument.body.style.display = "none";
browser.contentDocument.body.clientTop;
}
@ -28,5 +29,5 @@ let test = asyncTest(function* () {
category: CATEGORY_CSS,
severity: SEVERITY_LOG,
}],
})
});
});

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

@ -2,7 +2,10 @@
/* Any copyright is dedicated to the Public Domain.
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 { Tools } = require("main");

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

@ -6,9 +6,13 @@
// Ensure non-toplevel security errors are displayed
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'
"use strict";
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 { browser } = yield loadTab(TEST_URI);

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

@ -3,13 +3,15 @@
* http://creativecommons.org/publicdomain/zero/1.0/
*/
"use strict";
const TEST_URI = "data:text/html;charset=utf8,Test that the web console " +
"displays requests that have been recorded in the " +
"netmonitor, even if the console hadn't opened yet.";
const TEST_FILE = "test-network-request.html";
const TEST_PATH = "http://example.com/browser/browser/devtools/webconsole/test/" +
TEST_FILE;
const TEST_PATH = "http://example.com/browser/browser/devtools/webconsole/" +
"test/" + TEST_FILE;
const NET_PREF = "devtools.webconsole.filter.networkinfo";
Services.prefs.setBoolPref(NET_PREF, true);
@ -47,7 +49,6 @@ add_task(function* () {
});
});
function loadDocument(browser) {
let deferred = promise.defer();

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

@ -3,10 +3,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const 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
requestLongerTimeout(2);
@ -17,13 +18,13 @@ function test()
loadTab(TEST_URI).then(testConsoleLoadOnDifferentPanel);
function testConsoleLoadOnDifferentPanel()
{
function testConsoleLoadOnDifferentPanel() {
info("About to check console loads even when non-webconsole panel is open");
openPanel("inspector").then(() => {
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();
});
@ -32,8 +33,7 @@ function test()
});
}
function testKeyboardShortcuts()
{
function testKeyboardShortcuts() {
info("About to check that panel responds to ESCAPE keyboard shortcut");
toolbox.once("split-console", () => {
@ -45,8 +45,7 @@ function test()
EventUtils.sendKey("ESCAPE", toolbox.frame.contentWindow);
}
function checkAllTools()
{
function checkAllTools() {
info("About to check split console with each panel individually.");
Task.spawn(function*() {
@ -61,16 +60,18 @@ function test()
});
}
function getCurrentUIState()
{
function getCurrentUIState() {
let win = toolbox.doc.defaultView;
let deck = toolbox.doc.querySelector("#toolbox-deck");
let webconsolePanel = toolbox.webconsolePanel;
let splitter = toolbox.doc.querySelector("#toolbox-console-splitter");
let containerHeight = parseFloat(win.getComputedStyle(deck.parentNode).getPropertyValue("height"));
let deckHeight = parseFloat(win.getComputedStyle(deck).getPropertyValue("height"));
let webconsoleHeight = parseFloat(win.getComputedStyle(webconsolePanel).getPropertyValue("height"));
let containerHeight = parseFloat(win.getComputedStyle(deck.parentNode)
.getPropertyValue("height"));
let deckHeight = parseFloat(win.getComputedStyle(deck)
.getPropertyValue("height"));
let webconsoleHeight = parseFloat(win.getComputedStyle(webconsolePanel)
.getPropertyValue("height"));
let splitterVisibility = !splitter.getAttribute("hidden");
let openedConsolePanel = toolbox.currentToolId === "webconsole";
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.");
let deferred = promise.defer();
@ -96,52 +96,68 @@ function test()
let currentUIState = getCurrentUIState();
ok (currentUIState.splitterVisibility, "Splitter is visible 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");
ok (!currentUIState.openedConsolePanel, "The console panel is not the current tool");
ok(currentUIState.splitterVisibility,
"Splitter is visible 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");
ok(!currentUIState.openedConsolePanel,
"The console panel is not the current tool");
ok(currentUIState.buttonSelected, "The command button is selected");
openPanel("webconsole").then(() => {
currentUIState = getCurrentUIState();
let currentUIState = getCurrentUIState();
ok (!currentUIState.splitterVisibility, "Splitter is hidden when console is opened.");
is (currentUIState.deckHeight, 0, "Deck has a height == 0 when console is opened.");
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.");
ok(!currentUIState.splitterVisibility,
"Splitter is hidden when console is opened.");
is(currentUIState.deckHeight, 0,
"Deck has a height == 0 when console is opened.");
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 splitting console does nothing while webconsole is opened
toolbox.toggleSplitConsole();
currentUIState = getCurrentUIState();
ok (!currentUIState.splitterVisibility, "Splitter is hidden when console is opened.");
is (currentUIState.deckHeight, 0, "Deck has a height == 0 when console is opened.");
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.");
ok(!currentUIState.splitterVisibility,
"Splitter is hidden when console is opened.");
is(currentUIState.deckHeight, 0,
"Deck has a height == 0 when console is opened.");
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
openPanel("inspector").then(() => {
let currentUIState = getCurrentUIState();
ok (currentUIState.splitterVisibility, "Splitter is visible 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");
ok (!currentUIState.openedConsolePanel, "The console panel is not the current tool");
ok (currentUIState.buttonSelected, "The command button is still selected.");
currentUIState = getCurrentUIState();
ok(currentUIState.splitterVisibility,
"Splitter is visible 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");
ok(!currentUIState.openedConsolePanel,
"The console panel is not the current tool");
ok(currentUIState.buttonSelected,
"The command button is still selected.");
toolbox.toggleSplitConsole();
deferred.resolve();
});
});
return deferred.promise;
}
function openPanel(toolId, callback)
{
function openPanel(toolId) {
let deferred = promise.defer();
let target = TargetFactory.forTab(gBrowser.selectedTab);
gDevTools.showToolbox(target, toolId).then(function(box) {
@ -151,8 +167,7 @@ function test()
return deferred.promise;
}
function openAndCheckPanel(toolId)
{
function openAndCheckPanel(toolId) {
let deferred = promise.defer();
openPanel(toolId).then(() => {
info("Checking toolbox for " + toolId);
@ -162,27 +177,33 @@ function test()
return deferred.promise;
}
function checkToolboxUI()
{
function checkToolboxUI() {
let currentUIState = getCurrentUIState();
ok(!currentUIState.splitterVisibility, "Splitter is hidden by default");
is (currentUIState.deckHeight, currentUIState.containerHeight, "Deck has a height > 0 by default");
is (currentUIState.webconsoleHeight, 0, "Web console is collapsed by default");
ok (!currentUIState.openedConsolePanel, "The console panel is not the current tool");
is(currentUIState.deckHeight, currentUIState.containerHeight,
"Deck has a height > 0 by default");
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.");
toolbox.toggleSplitConsole();
currentUIState = getCurrentUIState();
ok (currentUIState.splitterVisibility, "Splitter is visible 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");
ok(currentUIState.splitterVisibility,
"Splitter is visible 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),
currentUIState.containerHeight,
"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.");
toolbox.toggleSplitConsole();
@ -190,14 +211,16 @@ function test()
currentUIState = getCurrentUIState();
ok(!currentUIState.splitterVisibility, "Splitter is hidden after toggling");
is (currentUIState.deckHeight, currentUIState.containerHeight, "Deck has a height > 0 after toggling");
is (currentUIState.webconsoleHeight, 0, "Web console is collapsed after toggling");
ok (!currentUIState.openedConsolePanel, "The console panel is not the current tool");
is(currentUIState.deckHeight, currentUIState.containerHeight,
"Deck has a height > 0 after toggling");
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.");
}
function testBottomHost()
{
function testBottomHost() {
checkHostType(Toolbox.HostType.BOTTOM);
checkToolboxUI();
@ -205,8 +228,7 @@ function test()
toolbox.switchHost(Toolbox.HostType.SIDE).then(testSidebarHost);
}
function testSidebarHost()
{
function testSidebarHost() {
checkHostType(Toolbox.HostType.SIDE);
checkToolboxUI();
@ -214,8 +236,7 @@ function test()
toolbox.switchHost(Toolbox.HostType.WINDOW).then(testWindowHost);
}
function testWindowHost()
{
function testWindowHost() {
checkHostType(Toolbox.HostType.WINDOW);
checkToolboxUI();
@ -223,24 +244,21 @@ function test()
toolbox.switchHost(Toolbox.HostType.BOTTOM).then(testDestroy);
}
function checkHostType(hostType)
{
function checkHostType(hostType) {
is(toolbox.hostType, hostType, "host type is " + hostType);
let pref = Services.prefs.getCharPref("devtools.toolbox.host");
is(pref, hostType, "host pref is " + hostType);
}
function testDestroy()
{
function testDestroy() {
toolbox.destroy().then(function() {
let target = TargetFactory.forTab(gBrowser.selectedTab);
gDevTools.showToolbox(target).then(finish);
});
}
function finish()
{
function finish() {
toolbox = null;
finishTest();
}

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

@ -3,6 +3,8 @@
* http://creativecommons.org/publicdomain/zero/1.0/
*/
"use strict";
function test() {
info("Test various cases where the escape key should hide the split console.");
@ -15,7 +17,8 @@ function test() {
Task.spawn(runner).then(finish);
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);
toolbox = yield gDevTools.showToolbox(target, "inspector");
@ -53,15 +56,6 @@ function test() {
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() {
let result = toolbox.once("split-console", () => {
ok(!toolbox.splitConsole, "Split console is hidden.");

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

@ -3,11 +3,14 @@
* http://creativecommons.org/publicdomain/zero/1.0/
*/
"use strict";
function test() {
info("Test that the split console state is persisted");
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);
@ -40,7 +43,8 @@ function test() {
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.
activeElement = getActiveElement(inspector.panelDoc);
activeElement = activeElement.ownerDocument.getBindingParent(activeElement);
@ -57,14 +61,6 @@ function test() {
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() {
toolbox = TEST_URI = null;
Services.prefs.clearUserPref("devtools.toolbox.splitconsoleEnabled");

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

@ -3,11 +3,14 @@
* http://creativecommons.org/publicdomain/zero/1.0/
*/
"use strict";
function test() {
info("Test that the split console state is persisted");
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);
@ -18,25 +21,29 @@ function test() {
toolbox = yield gDevTools.showToolbox(target, "inspector");
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();
ok(toolbox.splitConsole, "Split console is now visible.");
ok(isCommandButtonChecked(), "Split console button is now checked.");
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;
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));
target = TargetFactory.forTab(tab);
toolbox = yield gDevTools.showToolbox(target, "inspector");
ok(toolbox.splitConsole, "Split console is visible 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.
let activeElement = getActiveElement(toolbox.doc);
@ -59,10 +66,11 @@ function test() {
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 console pref");
info("Opening a tab while there is a false user setting on split " +
"console pref");
({tab} = yield loadTab(TEST_URI));
target = TargetFactory.forTab(tab);
toolbox = yield gDevTools.showToolbox(target, "inspector");
@ -90,8 +98,8 @@ function test() {
}
function isCommandButtonChecked() {
return toolbox.doc.querySelector("#command-button-splitconsole").
hasAttribute("checked");
return toolbox.doc.querySelector("#command-button-splitconsole")
.hasAttribute("checked");
}
function toggleSplitConsoleWithEscape() {

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

@ -5,15 +5,14 @@
// Check that the webconsole works if the network monitor is first opened, then
// the user switches to the webconsole. See bug 970914.
"use strict";
function test() {
Task.spawn(runner).then(finishTest);
function* runner() {
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);
hud.jsterm.execute("console.log('foobar bug970914')");
@ -29,7 +28,8 @@ function test() {
});
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),
"no warning about disabled console API");
}

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

@ -4,7 +4,10 @@
// Tests that source URLs in the Web Console can be clicked to display the
// 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 Sources;

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

@ -27,3 +27,7 @@
<!ENTITY trackingProtection.showPreferences "Privacy Preferences">
<!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.detectedNotBlocked2 "This site includes content that tracks your browsing. You have disabled protection.">
<!ENTITY trackingProtection.notDetected2 "This site doesnt 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.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.accesskey "D">
<!ENTITY trackingProtection.block2.label "Enable protection">
<!ENTITY trackingProtection.block2.accesskey "E">

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

@ -1069,11 +1069,6 @@ toolbarbutton[constrain-size="true"][cui-areatype="toolbar"] > .toolbarbutton-ba
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 {
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");
}
.tabbrowser-tab:focus > .tab-stack > .tab-content > .tab-label {
.tabbrowser-tab:focus > .tab-stack > .tab-content {
outline: 1px dotted;
outline-offset: -6px;
}
#context_reloadTab {

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

@ -493,8 +493,7 @@ browser.jar:
#ifdef E10S_TESTING_ONLY
skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png)
#endif
skin/classic/browser/warning16.png (../shared/warning16.png)
skin/classic/browser/warning16@2x.png (../shared/warning16@2x.png)
skin/classic/browser/warning.svg (../shared/warning.svg)
../extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/chrome.jar:
% 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;
}
.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@;
}

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

@ -623,8 +623,7 @@ browser.jar:
#ifdef E10S_TESTING_ONLY
skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png)
#endif
skin/classic/browser/warning16.png (../shared/warning16.png)
skin/classic/browser/warning16@2x.png (../shared/warning16@2x.png)
skin/classic/browser/warning.svg (../shared/warning.svg)
../extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/chrome.jar:
% 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-verify"] > #PanelUI-fxa-status > #PanelUI-fxa-label {
list-style-image: url(chrome://browser/skin/warning16.png);
-moz-image-region: rect(0, 32px, 16px, 16px);
list-style-image: url(chrome://browser/skin/warning.svg);
-moz-image-region: auto;
}
#PanelUI-customize {
@ -1509,12 +1509,6 @@ menuitem[checked="true"].subviewbutton > .menu-iconic-left {
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 {
list-style-image: url(chrome://browser/skin/menuPanel-customize@2x.png);
}

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

@ -120,16 +120,16 @@
}
.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;
height: 16px;
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 {
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;
}
.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 {
list-style-image: url(chrome://browser/skin/webRTC-shareDevice-16@2x.png);
@ -365,11 +373,6 @@
%ifdef XP_MACOSX
/* 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 {
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 > .tab-stack > .tab-content > .tab-label {
.tabbrowser-tab:focus > .tab-stack > .tab-content {
outline: 1px dotted;
outline-offset: -6px;
}
/* Background tabs:

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

@ -105,6 +105,8 @@ browser.jar:
skin/classic/browser/privatebrowsing-mask-titlebar-XPVista7-tall.png
skin/classic/browser/reload-stop-go.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-dropdown-arrow.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-history-dropmarker.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/tab-crashed.svg (../shared/incontent-icons/tab-crashed.svg)
skin/classic/browser/welcome-back.svg (../shared/incontent-icons/welcome-back.svg)
@ -598,8 +602,7 @@ browser.jar:
#ifdef E10S_TESTING_ONLY
skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png)
#endif
skin/classic/browser/warning16.png (../shared/warning16.png)
skin/classic/browser/warning16@2x.png (../shared/warning16@2x.png)
skin/classic/browser/warning.svg (../shared/warning.svg)
../extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/chrome.jar:
% 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-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

Двоичные данные
browser/themes/windows/reload-stop-go-preWin10.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.9 KiB

Двоичные данные
browser/themes/windows/reload-stop-go-preWin10@2x.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 3.6 KiB

Двоичные данные
browser/themes/windows/reload-stop-go.png

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.9 KiB

После

Ширина:  |  Высота:  |  Размер: 966 B

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