Merge Fx-Team to Mozilla-Central

This commit is contained in:
Carsten "Tomcat" Book 2013-10-24 06:48:43 +02:00
Родитель 3318f2f9c8 9e21571433
Коммит 160bcf927e
71 изменённых файлов: 697 добавлений и 497 удалений

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

@ -365,12 +365,6 @@ pref("browser.download.manager.quitBehavior", 0);
pref("browser.download.manager.scanWhenDone", true);
pref("browser.download.manager.resumeOnWakeDelay", 10000);
// Enables the asynchronous Downloads API in the Downloads Panel.
pref("browser.download.useJSTransfer", true);
// This allows disabling the Downloads Panel in favor of the old interface.
pref("browser.download.useToolkitUI", false);
// This allows disabling the animated notifications shown by
// the Downloads Indicator when a download starts or completes.
pref("browser.download.animateNotifications", true);

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

@ -235,15 +235,12 @@ this.DownloadsCommon = {
},
/**
* Indicates whether we should show the full Download Manager window interface
* instead of the simplified panel interface. The behavior of downloads
* across browsing session is consistent with the selected interface.
* Indicates that we should show the simplified panel interface instead of the
* full Download Manager window interface. The code associated with the
* Download Manager window interface will be removed in bug 899110.
*/
get useToolkitUI()
{
try {
return Services.prefs.getBoolPref("browser.download.useToolkitUI");
} catch (ex) { }
return false;
},
@ -570,17 +567,12 @@ XPCOMUtils.defineLazyGetter(DownloadsCommon, "isWinVistaOrHigher", function () {
});
/**
* Returns true if we should hook the panel to the JavaScript API for downloads
* instead of the nsIDownloadManager back-end. In order for the logic to work
* properly, this value never changes during the execution of the application,
* even if the underlying preference value has changed. A restart is required
* for the change to take effect.
* Returns true to indicate that we should hook the panel to the JavaScript API
* for downloads instead of the nsIDownloadManager back-end. The code
* associated with nsIDownloadManager will be removed in bug 899110.
*/
XPCOMUtils.defineLazyGetter(DownloadsCommon, "useJSTransfer", function () {
try {
return Services.prefs.getBoolPref("browser.download.useJSTransfer");
} catch (ex) { }
return false;
return true;
});
////////////////////////////////////////////////////////////////////////////////

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

@ -93,29 +93,13 @@ DownloadsStartup.prototype = {
.registerFactory(kDownloadsUICid, "",
kDownloadsUIContractId, null);
// If the integration preference is enabled, override Toolkit's
// nsITransfer implementation with the one from the JavaScript API for
// downloads. This should be used only by developers while testing new
// code that uses the JavaScript API, and will eventually be removed
// when nsIDownloadManager will not be available anymore (bug 851471).
let useJSTransfer = false;
try {
// For performance reasons, we don't want to load the DownloadsCommon
// module during startup, so we read the preference value directly.
useJSTransfer =
Services.prefs.getBoolPref("browser.download.useJSTransfer");
} catch (ex) { }
if (useJSTransfer) {
Components.manager.QueryInterface(Ci.nsIComponentRegistrar)
.registerFactory(kTransferCid, "",
kTransferContractId, null);
} else {
// The other notifications are handled internally by the JavaScript
// API for downloads, no need to observe when that API is enabled.
for (let topic of kObservedTopics) {
Services.obs.addObserver(this, topic, true);
}
}
// Override Toolkit's nsITransfer implementation with the one from the
// JavaScript API for downloads. This will eventually be removed when
// nsIDownloadManager will not be available anymore (bug 851471). The
// old code in this module will be removed in bug 899110.
Components.manager.QueryInterface(Ci.nsIComponentRegistrar)
.registerFactory(kTransferCid, "",
kTransferContractId, null);
break;
case "sessionstore-windows-restored":

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

@ -1420,9 +1420,6 @@ BrowserGlue.prototype = {
}
this._setPersist(toolbarResource, currentsetResource, currentset);
}
Services.prefs.clearUserPref("browser.download.useToolkitUI");
Services.prefs.clearUserPref("browser.library.useNewDownloadsView");
}
#ifdef XP_WIN

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

@ -350,6 +350,10 @@ let SessionStoreInternal = {
// See bug 516755.
_disabledForMultiProcess: false,
// Promise that is resolved when we're ready to initialize
// and restore the session.
_promiseReadyForInitialization: null,
/**
* A promise fulfilled once initialization is complete.
*/
@ -870,13 +874,33 @@ let SessionStoreInternal = {
return;
}
// The very first window that is opened creates a promise that is then
// re-used by all subsequent windows. The promise will be used to tell
// when we're ready for initialization.
if (!this._promiseReadyForInitialization) {
let deferred = Promise.defer();
// Wait for the given window's delayed startup to be finished.
Services.obs.addObserver(function obs(subject, topic) {
if (aWindow == subject) {
Services.obs.removeObserver(obs, topic);
deferred.resolve();
}
}, "browser-delayed-startup-finished", false);
// We are ready for initialization as soon as the session file has been
// read from disk and the initial window's delayed startup has finished.
this._promiseReadyForInitialization =
Promise.all([deferred.promise, gSessionStartup.onceInitialized]);
}
// We can't call this.onLoad since initialization
// hasn't completed, so we'll wait until it is done.
// Even if additional windows are opened and wait
// for initialization as well, the first opened
// window should execute first, and this.onLoad
// will be called with the initialState.
gSessionStartup.onceInitialized.then(() => {
this._promiseReadyForInitialization.then(() => {
if (aWindow.closed) {
return;
}

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

@ -61,3 +61,5 @@ fi
MOZ_WEBGL_CONFORMANT=1
# Enable navigator.mozPay
MOZ_PAY=1
MOZ_JSDOWNLOADS=1

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

@ -1156,8 +1156,13 @@ SourceScripts.prototype = {
_onBlackBoxChange: function (aEvent, { url, isBlackBoxed }) {
const item = DebuggerView.Sources.getItemByValue(url);
if (item) {
DebuggerView.Sources.callMethod("checkItem", item.target, !isBlackBoxed);
if (isBlackBoxed) {
item.target.classList.add("black-boxed");
} else {
item.target.classList.remove("black-boxed");
}
}
DebuggerView.Sources.updateToolbarButtonsState();
DebuggerView.maybeShowBlackBoxMessage();
},

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

@ -19,7 +19,7 @@ function SourcesView() {
this._onSourceSelect = this._onSourceSelect.bind(this);
this._onSourceClick = this._onSourceClick.bind(this);
this._onBreakpointRemoved = this._onBreakpointRemoved.bind(this);
this._onSourceCheck = this._onSourceCheck.bind(this);
this.toggleBlackBoxing = this.toggleBlackBoxing.bind(this);
this._onStopBlackBoxing = this._onStopBlackBoxing.bind(this);
this._onBreakpointClick = this._onBreakpointClick.bind(this);
this._onBreakpointCheckboxClick = this._onBreakpointCheckboxClick.bind(this);
@ -28,7 +28,7 @@ function SourcesView() {
this._onConditionalPopupHiding = this._onConditionalPopupHiding.bind(this);
this._onConditionalTextboxInput = this._onConditionalTextboxInput.bind(this);
this._onConditionalTextboxKeyPress = this._onConditionalTextboxKeyPress.bind(this);
this._updatePrettyPrintButtonState = this._updatePrettyPrintButtonState.bind(this);
this.updateToolbarButtonsState = this.updateToolbarButtonsState.bind(this);
}
SourcesView.prototype = Heritage.extend(WidgetMethods, {
@ -39,7 +39,6 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
dumpn("Initializing the SourcesView");
this.widget = new SideMenuWidget(document.getElementById("sources"), {
showItemCheckboxes: true,
showArrows: true
});
@ -51,6 +50,7 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
this._cmPopup = document.getElementById("sourceEditorContextMenu");
this._cbPanel = document.getElementById("conditional-breakpoint-panel");
this._cbTextbox = document.getElementById("conditional-breakpoint-panel-textbox");
this._blackBoxButton = document.getElementById("black-box");
this._stopBlackBoxButton = document.getElementById("black-boxed-message-button");
this._prettyPrintButton = document.getElementById("pretty-print");
@ -62,7 +62,6 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
window.on(EVENTS.EDITOR_UNLOADED, this._onEditorUnload, false);
this.widget.addEventListener("select", this._onSourceSelect, false);
this.widget.addEventListener("click", this._onSourceClick, false);
this.widget.addEventListener("check", this._onSourceCheck, false);
this._stopBlackBoxButton.addEventListener("click", this._onStopBlackBoxing, false);
this._cbPanel.addEventListener("popupshowing", this._onConditionalPopupShowing, false);
this._cbPanel.addEventListener("popupshown", this._onConditionalPopupShown, false);
@ -86,7 +85,6 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
window.off(EVENTS.EDITOR_UNLOADED, this._onEditorUnload, false);
this.widget.removeEventListener("select", this._onSourceSelect, false);
this.widget.removeEventListener("click", this._onSourceClick, false);
this.widget.removeEventListener("check", this._onSourceCheck, false);
this._stopBlackBoxButton.removeEventListener("click", this._onStopBlackBoxing, false);
this._cbPanel.removeEventListener("popupshowing", this._onConditionalPopupShowing, false);
this._cbPanel.removeEventListener("popupshowing", this._onConditionalPopupShown, false);
@ -702,22 +700,23 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
document.title = L10N.getFormatStr("DebuggerWindowScriptTitle", script);
DebuggerView.maybeShowBlackBoxMessage();
this._updatePrettyPrintButtonState();
this.updateToolbarButtonsState();
},
/**
* Enable or disable the pretty print button depending on whether the selected
* source is black boxed or not and check or uncheck it depending on if the
* selected source is already pretty printed or not.
* Update the checked/unchecked and enabled/disabled states of the buttons in
* the sources toolbar based on the currently selected source's state.
*/
_updatePrettyPrintButtonState: function() {
updateToolbarButtonsState: function() {
const { source } = this.selectedItem.attachment;
const sourceClient = gThreadClient.source(source);
if (sourceClient.isBlackBoxed) {
this._prettyPrintButton.setAttribute("disabled", true);
this._blackBoxButton.setAttribute("checked", true);
} else {
this._prettyPrintButton.removeAttribute("disabled");
this._blackBoxButton.removeAttribute("checked");
}
if (sourceClient.isPrettyPrinted) {
@ -736,26 +735,30 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
},
/**
* The check listener for the sources container.
* Toggle the black boxed state of the selected source.
*/
_onSourceCheck: function({ detail: { checked }, target }) {
const shouldBlackBox = !checked;
toggleBlackBoxing: function() {
const { source } = this.selectedItem.attachment;
const sourceClient = gThreadClient.source(source);
const shouldBlackBox = !sourceClient.isBlackBoxed;
// Be optimistic that the (un-)black boxing will succeed and enable/disable
// the pretty print button immediately. Then, once we actually get the
// results from the server, make sure that it is in the correct state again
// by calling `_updatePrettyPrintButtonState`.
// Be optimistic that the (un-)black boxing will succeed, so enable/disable
// the pretty print button and check/uncheck the black box button
// immediately. Then, once we actually get the results from the server, make
// sure that it is in the correct state again by calling
// `updateToolbarButtonsState`.
if (shouldBlackBox) {
this._prettyPrintButton.setAttribute("disabled", true);
this._blackBoxButton.setAttribute("checked", true);
} else {
this._prettyPrintButton.removeAttribute("disabled");
this._blackBoxButton.removeAttribute("checked");
}
const { source } = this.getItemForElement(target).attachment;
DebuggerController.SourceScripts.blackBox(source, shouldBlackBox)
.then(this._updatePrettyPrintButtonState,
this._updatePrettyPrintButtonState);
.then(this.updateToolbarButtonsState,
this.updateToolbarButtonsState);
},
/**
@ -763,7 +766,9 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
*/
_onStopBlackBoxing: function() {
let sourceForm = this.selectedItem.attachment.source;
DebuggerController.SourceScripts.blackBox(sourceForm, false);
DebuggerController.SourceScripts.blackBox(sourceForm, false)
.then(this.updateToolbarButtonsState,
this.updateToolbarButtonsState);
},
/**

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

@ -32,6 +32,8 @@
<commandset id="debuggerCommands">
<command id="prettyPrintCommand"
oncommand="DebuggerView.Sources.togglePrettyPrint()"/>
<command id="blackBoxCommand"
oncommand="DebuggerView.Sources.toggleBlackBoxing()"/>
<command id="unBlackBoxButton"
oncommand="DebuggerView.Sources._onStopBlackBoxing()"/>
<command id="nextSourceCommand"
@ -320,12 +322,18 @@
<vbox id="sources-pane">
<vbox id="sources" flex="1"/>
<toolbar id="sources-toolbar" class="devtools-toolbar">
<toolbarbutton id="pretty-print"
label="{}"
tooltiptext="&debuggerUI.sources.prettyPrint;"
class="devtools-toolbarbutton devtools-monospace"
command="prettyPrintCommand"
hidden="true"/>
<hbox id="sources-controls">
<toolbarbutton id="black-box"
tooltiptext="&debuggerUI.sources.blackBoxTooltip;"
command="blackBoxCommand"
class="devtools-toolbarbutton"/>
<toolbarbutton id="pretty-print"
label="{}"
tooltiptext="&debuggerUI.sources.prettyPrint;"
class="devtools-toolbarbutton devtools-monospace"
command="prettyPrintCommand"
hidden="true"/>
</hbox>
</toolbar>
</vbox>
<splitter id="sources-and-editor-splitter"

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

@ -65,7 +65,6 @@ support-files =
[browser_dbg_blackboxing-04.js]
[browser_dbg_blackboxing-05.js]
[browser_dbg_blackboxing-06.js]
[browser_dbg_blackboxing-07.js]
[browser_dbg_file-reload.js]
[browser_dbg_breadcrumbs-access.js]
[browser_dbg_break-on-dom-01.js]

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

@ -27,24 +27,19 @@ function test() {
}
function testBlackBoxSource() {
const checkbox = gDebugger.document.querySelector(".side-menu-widget-item-checkbox");
ok(checkbox, "Should get the checkbox for black boxing the source.");
ok(checkbox.checked, "Should not be black boxed by default.");
const bbButton = getBlackBoxButton(gPanel);
ok(!bbButton.checked, "Should not be black boxed by default");
let finished = waitForThreadEvents(gPanel, "blackboxchange").then(aSource => {
return toggleBlackBoxing(gPanel).then(aSource => {
ok(aSource.isBlackBoxed, "The source should be black boxed now.");
ok(!checkbox.checked, "The checkbox should no longer be checked.");
ok(bbButton.checked, "The checkbox should no longer be checked.");
});
checkbox.click();
return finished;
}
function testBlackBoxReload() {
return reloadActiveTab(gPanel, gDebugger.EVENTS.SOURCE_SHOWN).then(() => {
const checkbox = gDebugger.document.querySelector(".side-menu-widget-item-checkbox");
ok(checkbox, "Should get the checkbox for black boxing the source.");
ok(!checkbox.checked, "Should still be black boxed.");
const bbButton = getBlackBoxButton(gPanel);
ok(bbButton.checked, "Should still be black boxed.");
});
}

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

@ -31,12 +31,9 @@ function test() {
}
function testBlackBoxSource() {
let finished = waitForThreadEvents(gPanel, "blackboxchange").then(aSource => {
return toggleBlackBoxing(gPanel).then(aSource => {
ok(aSource.isBlackBoxed, "The source should be black boxed now.");
});
getBlackBoxCheckbox(BLACKBOXME_URL).click();
return finished;
}
function testBlackBoxStack() {
@ -53,12 +50,6 @@ function testBlackBoxStack() {
return finished;
}
function getBlackBoxCheckbox(aUrl) {
return gDebugger.document.querySelector(
".side-menu-widget-item[tooltiptext=\"" + aUrl + "\"] " +
".side-menu-widget-item-checkbox");
}
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;

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

@ -40,7 +40,7 @@ function testBlackBoxStack() {
}
function testBlackBoxSource() {
let finished = waitForThreadEvents(gPanel, "blackboxchange").then(aSource => {
return toggleBlackBoxing(gPanel, BLACKBOXME_URL).then(aSource => {
ok(aSource.isBlackBoxed, "The source should be black boxed now.");
is(gFrames.itemCount, 3,
@ -48,15 +48,6 @@ function testBlackBoxSource() {
is(gDebugger.document.querySelectorAll(".dbg-stackframe-black-boxed").length, 1,
"And one of them should be the combined black boxed frames.");
});
getBlackBoxCheckbox(BLACKBOXME_URL).click();
return finished;
}
function getBlackBoxCheckbox(aUrl) {
return gDebugger.document.querySelector(
".side-menu-widget-item[tooltiptext=\"" + aUrl + "\"] " +
".side-menu-widget-item-checkbox");
}
registerCleanupFunction(function() {

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

@ -32,9 +32,9 @@ function test() {
function blackBoxSources() {
let finished = waitForThreadEvents(gPanel, "blackboxchange", 3);
getBlackBoxCheckbox(EXAMPLE_URL + "code_blackboxing_one.js").click();
getBlackBoxCheckbox(EXAMPLE_URL + "code_blackboxing_two.js").click();
getBlackBoxCheckbox(EXAMPLE_URL + "code_blackboxing_three.js").click();
toggleBlackBoxing(gPanel, EXAMPLE_URL + "code_blackboxing_one.js");
toggleBlackBoxing(gPanel, EXAMPLE_URL + "code_blackboxing_two.js");
toggleBlackBoxing(gPanel, EXAMPLE_URL + "code_blackboxing_three.js");
return finished;
}
@ -52,12 +52,6 @@ function testBlackBoxStack() {
return finished;
}
function getBlackBoxCheckbox(aUrl) {
return gDebugger.document.querySelector(
".side-menu-widget-item[tooltiptext=\"" + aUrl + "\"] " +
".side-menu-widget-item-checkbox");
}
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;

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

@ -21,7 +21,7 @@ function test() {
waitForSourceShown(gPanel, ".coffee")
.then(testSourceEditorShown)
.then(blackBoxSource)
.then(toggleBlackBoxing.bind(null, gPanel))
.then(testBlackBoxMessageShown)
.then(clickStopBlackBoxingButton)
.then(testSourceEditorShownAgain)
@ -37,12 +37,6 @@ function testSourceEditorShown() {
"The first item in the deck should be selected (the source editor).");
}
function blackBoxSource() {
let finished = waitForThreadEvents(gPanel, "blackboxchange");
getAnyBlackBoxCheckbox().click();
return finished;
}
function testBlackBoxMessageShown() {
is(gDeck.selectedIndex, "1",
"The second item in the deck should be selected (the black box message).");
@ -59,11 +53,6 @@ function testSourceEditorShownAgain() {
"The first item in the deck should be selected again (the source editor).");
}
function getAnyBlackBoxCheckbox() {
return gDebugger.document.querySelector(
".side-menu-widget-item .side-menu-widget-item-checkbox");
}
function getEditorBlackboxMessageButton() {
return gDebugger.document.getElementById("black-boxed-message-button");
}

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

@ -2,7 +2,8 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Test that clicking the black box checkbox doesn't select that source.
* Test that clicking the black box checkbox when paused doesn't re-select the
* currently paused frame's source.
*/
const TAB_URL = EXAMPLE_URL + "doc_blackboxing.html";
@ -18,35 +19,35 @@ function test() {
gDebugger = gPanel.panelWin;
gSources = gDebugger.DebuggerView.Sources;
waitForSourceShown(gPanel, ".js")
waitForSourceAndCaretAndScopes(gPanel, ".html", 21)
.then(testBlackBox)
.then(() => closeDebuggerAndFinish(gPanel))
.then(() => resumeDebuggerThenCloseAndFinish(gPanel))
.then(null, aError => {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
gDebuggee.runTest();
});
}
function testBlackBox() {
const selectedUrl = gSources.selectedValue;
const checkbox = getDifferentBlackBoxCheckbox(selectedUrl);
ok(checkbox, "We should be able to grab a different checkbox.");
let finished = waitForThreadEvents(gPanel, "blackboxchange").then(() => {
is(selectedUrl, gSources.selectedValue,
"The same source should still be selected.");
let finished = waitForSourceShown(gPanel, "blackboxme.js").then(() => {
const newSelectedUrl = gSources.selectedValue;
isnot(selectedUrl, newSelectedUrl,
"Should not have the same url selected.");
return toggleBlackBoxing(gPanel).then(() => {
is(gSources.selectedValue, newSelectedUrl,
"The selected source did not change.");
});
});
checkbox.click();
gSources.selectedIndex = 0;
return finished;
}
function getDifferentBlackBoxCheckbox(aUrl) {
return gDebugger.document.querySelector(
".side-menu-widget-item:not([tooltiptext=\"" + aUrl + "\"]) " +
".side-menu-widget-item-checkbox");
}
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;

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

@ -1,66 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Test that clicking the black box checkbox when paused doesn't re-select the
* currently paused frame's source.
*/
const TAB_URL = EXAMPLE_URL + "doc_blackboxing.html";
let gTab, gDebuggee, gPanel, gDebugger;
let gSources;
function test() {
initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
gSources = gDebugger.DebuggerView.Sources;
waitForSourceAndCaretAndScopes(gPanel, ".html", 21)
.then(testBlackBox)
.then(() => resumeDebuggerThenCloseAndFinish(gPanel))
.then(null, aError => {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
gDebuggee.runTest();
});
}
function testBlackBox() {
const selectedUrl = gSources.selectedValue;
let finished = waitForSourceShown(gPanel, "blackboxme.js").then(() => {
const newSelectedUrl = gSources.selectedValue;
isnot(selectedUrl, newSelectedUrl,
"Should not have the same url selected.");
let finished = waitForThreadEvents(gPanel, "blackboxchange").then(() => {
is(gSources.selectedValue, newSelectedUrl,
"The selected source did not change.");
});
getBlackBoxCheckbox(newSelectedUrl).click()
return finished;
});
gSources.selectedIndex = 0;
return finished;
}
function getBlackBoxCheckbox(aUrl) {
return gDebugger.document.querySelector(
".side-menu-widget-item[tooltiptext=\"" + aUrl + "\"] " +
".side-menu-widget-item-checkbox");
}
registerCleanupFunction(function() {
gTab = null;
gDebuggee = null;
gPanel = null;
gDebugger = null;
gSources = null;
});

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

@ -46,69 +46,95 @@ function waitForDebuggerSources() {
}
function testBlackBoxSource() {
return cmd("dbg blackbox " + BLACKBOXME_URL).then(() => {
const checkbox = getBlackBoxCheckbox(BLACKBOXME_URL);
ok(!checkbox.checked,
"Should be able to black box a specific source.");
return Task.spawn(function* () {
yield cmd("dbg blackbox " + BLACKBOXME_URL);
let bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXME_URL);
ok(bbButton.checked,
"Should be able to black box a specific source.");
});
}
function testUnBlackBoxSource() {
return cmd("dbg unblackbox " + BLACKBOXME_URL).then(() => {
const checkbox = getBlackBoxCheckbox(BLACKBOXME_URL);
ok(checkbox.checked,
"Should be able to stop black boxing a specific source.");
return Task.spawn(function* () {
yield cmd("dbg unblackbox " + BLACKBOXME_URL);
let bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXME_URL);
ok(!bbButton.checked,
"Should be able to stop black boxing a specific source.");
});
}
function testBlackBoxGlob() {
return cmd("dbg blackbox --glob *blackboxing_t*.js", 2,
[/blackboxing_three\.js/g, /blackboxing_two\.js/g]).then(() => {
ok(getBlackBoxCheckbox(BLACKBOXME_URL).checked,
"blackboxme should not be black boxed because it doesn't match the glob.");
ok(getBlackBoxCheckbox(BLACKBOXONE_URL).checked,
"blackbox_one should not be black boxed because it doesn't match the glob.");
return Task.spawn(function* () {
yield cmd("dbg blackbox --glob *blackboxing_t*.js", 2,
[/blackboxing_three\.js/g, /blackboxing_two\.js/g]);
ok(!getBlackBoxCheckbox(BLACKBOXTWO_URL).checked,
"blackbox_two should be black boxed because it matches the glob.");
ok(!getBlackBoxCheckbox(BLACKBOXTHREE_URL).checked,
let bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXME_URL);
ok(!bbButton.checked,
"blackboxme should not be black boxed because it doesn't match the glob.");
bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXONE_URL);
ok(!bbButton.checked,
"blackbox_one should not be black boxed because it doesn't match the glob.");
bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXTWO_URL);
ok(bbButton.checked,
"blackbox_two should be black boxed because it matches the glob.");
bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXTHREE_URL);
ok(bbButton.checked,
"blackbox_three should be black boxed because it matches the glob.");
});
}
function testUnBlackBoxGlob() {
return cmd("dbg unblackbox --glob *blackboxing_t*.js", 2).then(() => {
ok(getBlackBoxCheckbox(BLACKBOXTWO_URL).checked,
"blackbox_two should be un-black boxed because it matches the glob.");
ok(getBlackBoxCheckbox(BLACKBOXTHREE_URL).checked,
return Task.spawn(function* () {
yield cmd("dbg unblackbox --glob *blackboxing_t*.js", 2);
let bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXTWO_URL);
ok(!bbButton.checked,
"blackbox_two should be un-black boxed because it matches the glob.");
bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXTHREE_URL);
ok(!bbButton.checked,
"blackbox_three should be un-black boxed because it matches the glob.");
});
}
function testBlackBoxInvert() {
return cmd("dbg blackbox --invert --glob *blackboxing_t*.js", 3,
[/blackboxing_three\.js/g, /blackboxing_two\.js/g]).then(() => {
ok(!getBlackBoxCheckbox(BLACKBOXME_URL).checked,
return Task.spawn(function* () {
yield cmd("dbg blackbox --invert --glob *blackboxing_t*.js", 3,
[/blackboxing_three\.js/g, /blackboxing_two\.js/g]);
let bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXME_URL);
ok(bbButton.checked,
"blackboxme should be black boxed because it doesn't match the glob.");
ok(!getBlackBoxCheckbox(BLACKBOXONE_URL).checked,
bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXONE_URL);
ok(bbButton.checked,
"blackbox_one should be black boxed because it doesn't match the glob.");
ok(!getBlackBoxCheckbox(TEST_URL).checked,
bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, TEST_URL);
ok(bbButton.checked,
"TEST_URL should be black boxed because it doesn't match the glob.");
ok(getBlackBoxCheckbox(BLACKBOXTWO_URL).checked,
bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXTWO_URL);
ok(!bbButton.checked,
"blackbox_two should not be black boxed because it matches the glob.");
ok(getBlackBoxCheckbox(BLACKBOXTHREE_URL).checked,
bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXTHREE_URL);
ok(!bbButton.checked,
"blackbox_three should not be black boxed because it matches the glob.");
});
}
function testUnBlackBoxInvert() {
return cmd("dbg unblackbox --invert --glob *blackboxing_t*.js", 3).then(() => {
ok(getBlackBoxCheckbox(BLACKBOXME_URL).checked,
return Task.spawn(function* () {
yield cmd("dbg unblackbox --invert --glob *blackboxing_t*.js", 3);
let bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXME_URL);
ok(!bbButton.checked,
"blackboxme should be un-black boxed because it does not match the glob.");
ok(getBlackBoxCheckbox(BLACKBOXONE_URL).checked,
bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, BLACKBOXONE_URL);
ok(!bbButton.checked,
"blackbox_one should be un-black boxed because it does not match the glob.");
ok(getBlackBoxCheckbox(TEST_URL).checked,
bbButton = yield selectSourceAndGetBlackBoxButton(gPanel, TEST_URL);
ok(!bbButton.checked,
"TEST_URL should be un-black boxed because it doesn't match the glob.");
});
}
@ -126,9 +152,3 @@ function cmd(aTyped, aEventRepeat = 1, aOutput = "") {
helpers.audit(gOptions, [{ setup: aTyped, output: aOutput, exec: {} }])
]);
}
function getBlackBoxCheckbox(url) {
return gDebugger.document.querySelector(
".side-menu-widget-item[tooltiptext=\"" + url + "\"] " +
".side-menu-widget-item-checkbox");
}

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

@ -22,8 +22,7 @@ function test() {
waitForSourceShown(gPanel, "code_ugly.js")
.then(testSourceIsUgly)
.then(blackBoxSource)
.then(waitForThreadEvents.bind(null, gPanel, "blackboxchange"))
.then(toggleBlackBoxing.bind(null, gPanel))
.then(clickPrettyPrintButton)
.then(testSourceIsStillUgly)
.then(() => closeDebuggerAndFinish(gPanel))
@ -38,12 +37,6 @@ function testSourceIsUgly() {
"The source shouldn't be pretty printed yet.");
}
function blackBoxSource() {
const checkbox = gDebugger.document.querySelector(
".selected .side-menu-widget-item-checkbox");
checkbox.click();
}
function clickPrettyPrintButton() {
gDebugger.document.getElementById("pretty-print").click();
}

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

@ -523,3 +523,29 @@ function resumeDebuggerThenCloseAndFinish(aPanel, aFlags = {}) {
thread.resume(() => closeDebuggerAndFinish(aPanel, aFlags).then(deferred.resolve));
return deferred.promise;
}
function getBlackBoxButton(aPanel) {
return aPanel.panelWin.document.getElementById("black-box");
}
function toggleBlackBoxing(aPanel, aSource = null) {
function clickBlackBoxButton() {
getBlackBoxButton(aPanel).click();
}
const blackBoxChanged = waitForThreadEvents(aPanel, "blackboxchange");
if (aSource) {
aPanel.panelWin.DebuggerView.Sources.selectedValue = aSource;
ensureSourceIs(aPanel, aSource, true).then(clickBlackBoxButton);
} else {
clickBlackBoxButton();
}
return blackBoxChanged;
}
function selectSourceAndGetBlackBoxButton(aPanel, aSource) {
aPanel.panelWin.DebuggerView.Sources.selectedValue = aSource;
return ensureSourceIs(aPanel, aSource, true)
.then(getBlackBoxButton.bind(null, aPanel));
}

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

@ -54,7 +54,14 @@ function submit() {
Services.prefs.setIntPref("devtools.debugger.remote-port", port);
// Initiate the connection
let transport = debuggerSocketConnect(host, port);
let transport;
try {
transport = debuggerSocketConnect(host, port);
} catch(e) {
// Bug 921850: catch rare exception from debuggerSocketConnect
showError("unexpected");
return;
}
gClient = new DebuggerClient(transport);
let delay = Services.prefs.getIntPref("devtools.debugger.remote-timeout");
gConnectionTimeout = setTimeout(handleConnectionTimeout, delay);

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

@ -18,8 +18,9 @@ To confirm the functionality run mochitests for the following components:
The sourceeditor component contains imported CodeMirror tests [3]. Some
tests were commented out because we don't use that functionality within
Firefox (for example Ruby editing mode). Other than that, we don't have
any Mozilla-specific patches applied to CodeMirror itself.
Firefox (for example Ruby editing mode). The search addon (search.js)
was slightly modified to make search UI localizable. Other than that,
we don't have any Mozilla-specific patches applied to CodeMirror itself.
# Addons

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

@ -45,12 +45,16 @@
var isRE = query.match(/^\/(.*)\/([a-z]*)$/);
return isRE ? new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i") : query;
}
var queryDialog =
'Search: <input type="text" style="width: 10em"/> <span style="color: #888">(Use /re/ syntax for regexp search)</span>';
var queryDialog;
function doSearch(cm, rev) {
if (!queryDialog) {
queryDialog = cm.l10n('findCmd.promptMessage') +
' <input type="text" style="width: 10em"/>';
}
var state = getSearchState(cm);
if (state.query) return findNext(cm, rev);
dialog(cm, queryDialog, "Search for:", function(query) {
dialog(cm, queryDialog, cm.l10n('findCmd.promptMessage'), function(query) {
cm.operation(function() {
if (!query || state.query) return;
state.query = parseQuery(query);

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

@ -207,6 +207,10 @@ Editor.prototype = {
cm.on("gutterClick", (cm, line) => this.emit("gutterClick", line));
cm.on("cursorActivity", (cm) => this.emit("cursorActivity"));
win.CodeMirror.defineExtension("l10n", (name) => {
return L10N.GetStringFromName(name);
});
doc.defaultView.controllers.insertControllerAt(0, controller(this, doc.defaultView));
this.container = env;

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

@ -94,6 +94,9 @@ support-files =
test_bug_770099_violation.html
test_bug_770099_violation.html^headers^
testscript.js
test-bug_923281_console_log_filter.html
test-bug_923281_test1.js
test-bug_923281_test2.js
[browser_bug664688_sandbox_update_after_navigation.js]
[browser_bug_638949_copy_link_location.js]
@ -231,3 +234,4 @@ support-files =
[browser_webconsole_property_provider.js]
[browser_webconsole_scratchpad_panel_link.js]
[browser_webconsole_view_source.js]
[browser_webconsole_log_file_filter.js]

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

@ -0,0 +1,80 @@
/* vim:set ts=2 sw=2 sts=2 et: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// 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";
let hud;
function test() {
addTab(TEST_URI);
browser.addEventListener("load", function onLoad() {
browser.removeEventListener("load", onLoad, true);
openConsole(null, consoleOpened);
}, true);
}
function consoleOpened(aHud) {
hud = aHud;
let console = content.console;
console.log("sentinel log");
waitForMessages({
webconsole: hud,
messages: [{
text: "sentinel log",
category: CATEGORY_WEBDEV,
severity: SEVERITY_LOG
}],
}).then(testLiveFilteringOnSearchStrings);
}
function testLiveFilteringOnSearchStrings() {
is(hud.outputNode.children.length, 4, "number of messages");
setStringFilter("random");
is(countMessageNodes(), 1, "the log nodes not containing string " +
"\"random\" are hidden");
setStringFilter("test2.js");
is(countMessageNodes(), 2, "show only log nodes containing string " +
"\"test2.js\" or log nodes created from files with filename " +
"containing \"test2.js\" as substring.");
setStringFilter("test1");
is(countMessageNodes(), 2, "show only log nodes containing string " +
"\"test1\" or log nodes created from files with filename " +
"containing \"test1\" as substring.");
setStringFilter("");
is(countMessageNodes(), 4, "show all log nodes on setting filter string " +
"as \"\".");
finishTest();
}
function countMessageNodes() {
let outputNode = hud.outputNode;
let messageNodes = outputNode.querySelectorAll(".message");
content.console.log(messageNodes.length);
let displayedMessageNodes = 0;
let view = hud.iframeWindow;
for (let i = 0; i < messageNodes.length; i++) {
let computedStyle = view.getComputedStyle(messageNodes[i], null);
if (computedStyle.display !== "none") {
displayedMessageNodes++;
}
}
return displayedMessageNodes;
}
function setStringFilter(aValue)
{
hud.ui.filterBox.value = aValue;
hud.ui.adjustVisibilityOnSearchStringChange();
}

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

@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<html dir="ltr" xml:lang="en-US" lang="en-US">
<head>
<meta charset="utf-8">
<title>Console test</title>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<script type="text/javascript" src="test-bug_923281_test1.js"></script>
<script type="text/javascript" src="test-bug_923281_test2.js"></script>
</head>
<body></body>
</html>

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

@ -0,0 +1,5 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
console.log("Sample log.");
console.log("This log should be filtered when filtered for test2.js.");

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

@ -0,0 +1,4 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
console.log("This is a random text.");

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

@ -873,7 +873,7 @@ WebConsoleFrame.prototype = {
let node = nodes[i];
// hide nodes that match the strings
let text = node.clipboardText;
let text = node.textContent;
// if the text matches the words in aSearchString...
if (this.stringMatchesFilters(text, searchString)) {

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

@ -33,8 +33,12 @@
- the button that opens up an options context menu for the debugger UI. -->
<!ENTITY debuggerUI.optsButton.tooltip "Debugger Options">
<!-- LOCALIZATION NOTE (debuggerUI.sources.blackBoxTooltip): This is the tooltip
- for the button that black boxes the selected source. -->
<!ENTITY debuggerUI.sources.blackBoxTooltip "Toggle Black Boxing">
<!-- LOCALIZATION NOTE (debuggerUI.sources.prettyPrint): This is the tooltip for the
button that pretty prints the selected source. -->
- button that pretty prints the selected source. -->
<!ENTITY debuggerUI.sources.prettyPrint "Prettify Source">
<!-- LOCALIZATION NOTE (debuggerUI.pauseExceptions): This is the label for the

Двоичные данные
browser/themes/linux/devtools/debugger-blackbox.png Normal file

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

После

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

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

@ -22,56 +22,29 @@
font-weight: bold;
}
#sources .side-menu-widget-item-checkbox {
-moz-appearance: none;
opacity: 0;
transition: opacity .15s ease 0s;
#black-box {
list-style-image: url(debugger-blackbox.png);
-moz-image-region: rect(0px,16px,16px,0px);
}
/* Only show the checkbox when the source is hovered over, is selected, or if it
* is not checked. */
#sources .side-menu-widget-item:hover > .side-menu-widget-item-checkbox,
#sources .side-menu-widget-item.selected > .side-menu-widget-item-checkbox,
#sources .side-menu-widget-item-checkbox:not([checked]) {
opacity: 1;
transition: opacity .15s ease 0s;
#black-box[checked] {
-moz-image-region: rect(0px,32px,16px,16px);
}
#sources .side-menu-widget-item-checkbox > .checkbox-spacer-box {
-moz-appearance: none;
}
#sources .side-menu-widget-item-checkbox > .checkbox-spacer-box > .checkbox-check {
-moz-appearance: none;
background: none;
background-image: url(itemToggle.png);
background-repeat: no-repeat;
background-clip: content-box;
background-size: 32px 16px;
background-position: -16px 0;
width: 16px;
height: 16px;
border: 0;
}
#sources .side-menu-widget-item-checkbox[checked] > .checkbox-spacer-box > .checkbox-check {
background-position: 0 0;
}
#sources .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-contents {
#sources .black-boxed {
color: #888;
}
#sources .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-contents > .dbg-breakpoint {
#sources .black-boxed > .dbg-breakpoint {
display: none;
}
#sources .side-menu-widget-item.selected > .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-arrow:-moz-locale-dir(ltr) {
#sources .black-boxed + .side-menu-widget-item-arrow:-moz-locale-dir(ltr) {
background-image: none;
box-shadow: inset -1px 0 0 #222426;
}
#sources .side-menu-widget-item.selected > .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-arrow:-moz-locale-dir(rtl) {
#sources .black-boxed + .side-menu-widget-item-arrow:-moz-locale-dir(rtl) {
background-image: none;
box-shadow: inset 1px 0 0 #222426;
}
@ -147,7 +120,7 @@
/* Sources and breakpoints view */
.dbg-breakpoint {
-moz-margin-start: -14px;
-moz-margin-start: 4px;
}
.dbg-breakpoint-line {
@ -402,7 +375,8 @@
list-style-image: url("chrome://browser/skin/devtools/debugger-step-out.png");
}
#debugger-controls > toolbarbutton {
#debugger-controls > toolbarbutton,
#sources-controls > toolbarbutton {
margin: 0;
box-shadow: none;
border-radius: 0;
@ -411,11 +385,13 @@
outline-offset: -3px;
}
#debugger-controls > toolbarbutton:last-of-type {
#debugger-controls > toolbarbutton:last-of-type,
#sources-controls > toolbarbutton:last-of-type {
-moz-border-end-width: 0;
}
#debugger-controls {
#debugger-controls,
#sources-controls {
box-shadow: 0 1px 0 hsla(210,16%,76%,.15) inset,
0 0 0 1px hsla(210,16%,76%,.15) inset,
0 1px 0 hsla(210,16%,76%,.15);

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

@ -195,6 +195,7 @@ browser.jar:
skin/classic/browser/devtools/debugger-step-in.png (devtools/debugger-step-in.png)
skin/classic/browser/devtools/debugger-step-out.png (devtools/debugger-step-out.png)
skin/classic/browser/devtools/debugger-step-over.png (devtools/debugger-step-over.png)
skin/classic/browser/devtools/debugger-blackbox.png (devtools/debugger-blackbox.png)
skin/classic/browser/devtools/responsive-se-resizer.png (devtools/responsive-se-resizer.png)
skin/classic/browser/devtools/responsive-vertical-resizer.png (devtools/responsive-vertical-resizer.png)
skin/classic/browser/devtools/responsive-horizontal-resizer.png (devtools/responsive-horizontal-resizer.png)

Двоичные данные
browser/themes/osx/devtools/debugger-blackbox.png Normal file

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

После

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

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

@ -24,52 +24,29 @@
font-weight: bold;
}
#sources .side-menu-widget-item-checkbox {
-moz-appearance: none;
opacity: 0;
transition: opacity .15s ease-out 0s;
#black-box {
list-style-image: url(debugger-blackbox.png);
-moz-image-region: rect(0px,16px,16px,0px);
}
/* Only show the checkbox when the source is hovered over, is selected, or if it
* is not checked. */
#sources .side-menu-widget-item:hover > .side-menu-widget-item-checkbox,
#sources .side-menu-widget-item.selected > .side-menu-widget-item-checkbox,
#sources .side-menu-widget-item-checkbox:not([checked]) {
opacity: 1;
transition: opacity .15s ease-out 0s;
#black-box[checked] {
-moz-image-region: rect(0px,32px,16px,16px);
}
#sources .side-menu-widget-item-checkbox > .checkbox-check {
-moz-appearance: none;
background: none;
background-image: url(itemToggle.png);
background-repeat: no-repeat;
background-clip: content-box;
background-size: 32px 16px;
background-position: -16px 0;
width: 16px;
height: 16px;
border: 0;
}
#sources .side-menu-widget-item-checkbox[checked] > .checkbox-check {
background-position: 0 0;
}
#sources .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-contents {
#sources .black-boxed {
color: #888;
}
#sources .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-contents > .dbg-breakpoint {
#sources .black-boxed > .dbg-breakpoint {
display: none;
}
#sources .side-menu-widget-item.selected > .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-arrow:-moz-locale-dir(ltr) {
#sources .black-boxed + .side-menu-widget-item-arrow:-moz-locale-dir(ltr) {
background-image: none;
box-shadow: inset -1px 0 0 #222426;
}
#sources .side-menu-widget-item.selected > .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-arrow:-moz-locale-dir(rtl) {
#sources .black-boxed + .side-menu-widget-item-arrow:-moz-locale-dir(rtl) {
background-image: none;
box-shadow: inset 1px 0 0 #222426;
}
@ -145,7 +122,7 @@
/* Sources and breakpoints view */
.dbg-breakpoint {
-moz-margin-start: -14px;
-moz-margin-start: 4px;
}
.dbg-breakpoint-line {
@ -400,7 +377,8 @@
list-style-image: url("chrome://browser/skin/devtools/debugger-step-out.png");
}
#debugger-controls > toolbarbutton {
#debugger-controls > toolbarbutton,
#sources-controls > toolbarbutton {
margin: 0;
box-shadow: none;
border-radius: 0;
@ -409,11 +387,13 @@
outline-offset: -3px;
}
#debugger-controls > toolbarbutton:last-of-type {
#debugger-controls > toolbarbutton:last-of-type,
#sources-controls > toolbarbutton:last-of-type {
-moz-border-end-width: 0;
}
#debugger-controls {
#debugger-controls,
#sources-controls {
box-shadow: 0 1px 0 hsla(210,16%,76%,.15) inset,
0 0 0 1px hsla(210,16%,76%,.15) inset,
0 1px 0 hsla(210,16%,76%,.15);

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

@ -287,6 +287,7 @@ browser.jar:
skin/classic/browser/devtools/debugger-step-in.png (devtools/debugger-step-in.png)
skin/classic/browser/devtools/debugger-step-out.png (devtools/debugger-step-out.png)
skin/classic/browser/devtools/debugger-step-over.png (devtools/debugger-step-over.png)
skin/classic/browser/devtools/debugger-blackbox.png (devtools/debugger-blackbox.png)
skin/classic/browser/devtools/floating-scrollbars.css (devtools/floating-scrollbars.css)
skin/classic/browser/devtools/floating-scrollbars-light.css (devtools/floating-scrollbars-light.css)
skin/classic/browser/devtools/responsive-se-resizer.png (devtools/responsive-se-resizer.png)

Двоичные данные
browser/themes/windows/devtools/debugger-blackbox.png Normal file

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

После

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

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

@ -22,54 +22,29 @@
font-weight: bold;
}
#sources .side-menu-widget-item-checkbox {
-moz-appearance: none;
-moz-margin-end: -6px;
padding: 0;
opacity: 0;
transition: opacity .15s ease 0s;
#black-box {
list-style-image: url(debugger-blackbox.png);
-moz-image-region: rect(0px,16px,16px,0px);
}
/* Only show the checkbox when the source is hovered over, is selected, or if it
* is not checked. */
#sources .side-menu-widget-item:hover > .side-menu-widget-item-checkbox,
#sources .side-menu-widget-item.selected > .side-menu-widget-item-checkbox,
#sources .side-menu-widget-item-checkbox:not([checked]) {
opacity: 1;
transition: opacity .15s ease-out 0s;
#black-box[checked] {
-moz-image-region: rect(0px,32px,16px,16px);
}
#sources .side-menu-widget-item-checkbox > .checkbox-check {
-moz-appearance: none;
background: none;
background-image: url(itemToggle.png);
background-repeat: no-repeat;
background-clip: content-box;
background-size: 32px 16px;
background-position: -16px 0;
width: 16px;
height: 16px;
border: 0;
}
#sources .side-menu-widget-item-checkbox[checked] > .checkbox-check {
background-position: 0 0;
}
#sources .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-contents {
#sources .black-boxed {
color: #888;
}
#sources .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-contents > .dbg-breakpoint {
#sources .black-boxed > .dbg-breakpoint {
display: none;
}
#sources .side-menu-widget-item.selected > .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-arrow:-moz-locale-dir(ltr) {
#sources .black-boxed + .side-menu-widget-item-arrow:-moz-locale-dir(ltr) {
background-image: none;
box-shadow: inset -1px 0 0 #222426;
}
#sources .side-menu-widget-item.selected > .side-menu-widget-item-checkbox:not([checked]) ~ .side-menu-widget-item-arrow:-moz-locale-dir(rtl) {
#sources .black-boxed + .side-menu-widget-item-arrow:-moz-locale-dir(rtl) {
background-image: none;
box-shadow: inset 1px 0 0 #222426;
}
@ -145,7 +120,7 @@
/* Sources and breakpoints view */
.dbg-breakpoint {
-moz-margin-start: -14px;
-moz-margin-start: 4px;
}
.dbg-breakpoint-line {
@ -400,7 +375,8 @@
list-style-image: url("chrome://browser/skin/devtools/debugger-step-out.png");
}
#debugger-controls > toolbarbutton {
#debugger-controls > toolbarbutton,
#sources-controls > toolbarbutton {
margin: 0;
box-shadow: none;
border-radius: 0;
@ -409,11 +385,13 @@
outline-offset: -3px;
}
#debugger-controls > toolbarbutton:last-of-type {
#debugger-controls > toolbarbutton:last-of-type,
#sources-controls > toolbarbutton:last-of-type {
-moz-border-end-width: 0;
}
#debugger-controls {
#debugger-controls,
#sources-controls {
box-shadow: 0 1px 0 hsla(209,29%,72%,.15) inset,
0 0 0 1px hsla(209,29%,72%,.1) inset,
0 0 0 1px hsla(209,29%,72%,.1),

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

@ -222,6 +222,7 @@ browser.jar:
skin/classic/browser/devtools/debugger-step-in.png (devtools/debugger-step-in.png)
skin/classic/browser/devtools/debugger-step-out.png (devtools/debugger-step-out.png)
skin/classic/browser/devtools/debugger-step-over.png (devtools/debugger-step-over.png)
skin/classic/browser/devtools/debugger-blackbox.png (devtools/debugger-blackbox.png)
skin/classic/browser/devtools/responsive-se-resizer.png (devtools/responsive-se-resizer.png)
skin/classic/browser/devtools/responsive-vertical-resizer.png (devtools/responsive-vertical-resizer.png)
skin/classic/browser/devtools/responsive-horizontal-resizer.png (devtools/responsive-horizontal-resizer.png)
@ -497,6 +498,7 @@ browser.jar:
skin/classic/aero/browser/devtools/debugger-step-in.png (devtools/debugger-step-in.png)
skin/classic/aero/browser/devtools/debugger-step-out.png (devtools/debugger-step-out.png)
skin/classic/aero/browser/devtools/debugger-step-over.png (devtools/debugger-step-over.png)
skin/classic/aero/browser/devtools/debugger-blackbox.png (devtools/debugger-blackbox.png)
skin/classic/aero/browser/devtools/responsive-se-resizer.png (devtools/responsive-se-resizer.png)
skin/classic/aero/browser/devtools/responsive-vertical-resizer.png (devtools/responsive-vertical-resizer.png)
skin/classic/aero/browser/devtools/responsive-horizontal-resizer.png (devtools/responsive-horizontal-resizer.png)

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

@ -14,6 +14,7 @@ MOZ_THUMB_INTERWORK=toolchain-default
MOZ_FPU=toolchain-default
MOZ_FLOAT_ABI=toolchain-default
MOZ_SOFT_FLOAT=toolchain-default
MOZ_ALIGN=toolchain-default
MOZ_ARG_WITH_STRING(arch,
[ --with-arch=[[type|toolchain-default]]
@ -32,6 +33,7 @@ if test -z "$MOZ_ARCH"; then
MOZ_ARCH=armv7-a
MOZ_FPU=vfp
MOZ_FLOAT_ABI=softfp
MOZ_ALIGN=no
;;
arm-Darwin)
MOZ_ARCH=toolchain-default
@ -159,8 +161,28 @@ no)
;;
esac
case "$MOZ_ALIGN" in
no)
align_flag="-mno-unaligned-access"
;;
yes)
align_flag="-munaligned-access"
;;
*)
align_flag=""
;;
esac
if test -n "$align_flag"; then
_SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $align_flag"
AC_MSG_CHECKING(whether alignment flag ($align_flag) is supported)
AC_TRY_COMPILE([],[],,align_flag="")
CFLAGS="$_SAVE_CFLAGS"
fi
dnl Use echo to avoid accumulating space characters
all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag`
all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag $align_flag`
if test -n "$all_flags"; then
_SAVE_CFLAGS="$CFLAGS"
CFLAGS="$all_flags"

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

@ -8342,6 +8342,11 @@ AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
AC_SUBST(MOZ_LINKER_EXTRACT)
AC_SUBST(MOZ_JSDOWNLOADS)
if test -n "$MOZ_JSDOWNLOADS"; then
AC_DEFINE(MOZ_JSDOWNLOADS)
fi
dnl ========================================================
dnl = Mac bundle name prefix
dnl ========================================================

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

@ -14,6 +14,7 @@ MOZ_THUMB_INTERWORK=toolchain-default
MOZ_FPU=toolchain-default
MOZ_FLOAT_ABI=toolchain-default
MOZ_SOFT_FLOAT=toolchain-default
MOZ_ALIGN=toolchain-default
MOZ_ARG_WITH_STRING(arch,
[ --with-arch=[[type|toolchain-default]]
@ -32,6 +33,7 @@ if test -z "$MOZ_ARCH"; then
MOZ_ARCH=armv7-a
MOZ_FPU=vfp
MOZ_FLOAT_ABI=softfp
MOZ_ALIGN=no
;;
arm-Darwin)
MOZ_ARCH=toolchain-default
@ -159,8 +161,28 @@ no)
;;
esac
case "$MOZ_ALIGN" in
no)
align_flag="-mno-unaligned-access"
;;
yes)
align_flag="-munaligned-access"
;;
*)
align_flag=""
;;
esac
if test -n "$align_flag"; then
_SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $align_flag"
AC_MSG_CHECKING(whether alignment flag ($align_flag) is supported)
AC_TRY_COMPILE([],[],,align_flag="")
CFLAGS="$_SAVE_CFLAGS"
fi
dnl Use echo to avoid accumulating space characters
all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag`
all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag $align_flag`
if test -n "$all_flags"; then
_SAVE_CFLAGS="$CFLAGS"
CFLAGS="$all_flags"

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

@ -13,8 +13,6 @@ public class testBookmark extends AboutHomeTest {
private static String BOOKMARK_URL;
private static int WAIT_FOR_BOOKMARKED_TIMEOUT = 10000;
Navigation nav;
@Override
protected int getTestType() {
return TEST_MOCHITEST;
@ -22,7 +20,6 @@ public class testBookmark extends AboutHomeTest {
public void testBookmark() {
BOOKMARK_URL = getAbsoluteUrl(StringHelper.ROBOCOP_BLANK_PAGE_01_URL);
nav = new Navigation(mDevice);
runAboutHomeTest();
runMenuTest();
}
@ -70,7 +67,7 @@ public class testBookmark extends AboutHomeTest {
// Bookmark a page for the test
loadUrl(BOOKMARK_URL);
waitForText(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE);
nav.bookmark();
toggleBookmark();
mAsserter.is(waitForText(StringHelper.BOOKMARK_ADDED_LABEL), true, "bookmark added successfully");
}
@ -78,7 +75,7 @@ public class testBookmark extends AboutHomeTest {
// Go back to the page we bookmarked
loadUrl(BOOKMARK_URL);
waitForText(StringHelper.ROBOCOP_BLANK_PAGE_01_TITLE);
nav.bookmark();
toggleBookmark();
mAsserter.is(waitForText(StringHelper.BOOKMARK_REMOVED_LABEL), true, "bookmark removed successfully");
}
}

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

@ -140,7 +140,7 @@ function onInstall(aEvent) {
return;
addApplication(aEvent.application);
document.getElementById("noapps").className = "hidden";
document.getElementById("main-container").classList.remove("hidden");
}
function onUninstall(aEvent) {
@ -149,6 +149,6 @@ function onUninstall(aEvent) {
let parent = node.parentNode;
parent.removeChild(node);
if (!parent.firstChild)
document.getElementById("noapps").className = "";
document.getElementById("main-container").classList.add("hidden");
}
}

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

@ -36,17 +36,22 @@
<div class="header">
<div>&aboutApps.header;</div>
<div id="header-button" role="button" aria-label="&aboutApps.noApps.middle3;" pref="app.marketplaceURL" onclick="openLink(this);"/>
<div id="header-button" role="button" aria-label="&aboutApps.browseMarketplace;" pref="app.marketplaceURL" onclick="openLink(this);"/>
</div>
<div id="main-container" class="list">
<div id="noapps" class="hidden">
&aboutApps.noApps.pre;<a id="marketplaceURL" pref="app.marketplaceURL">&aboutApps.noApps.middle3;</a>&aboutApps.noApps.post;
</div>
<div id="main-container" class="list hidden">
<div>
<div class="spacer" id="spacer1"> </div>
<div id="appgrid"/>
<div class="spacer" id="spacer1"> </div>
</div>
</div>
<div class="list-item" role="button" pref="app.marketplaceURL" onclick="openLink(this);">
<img class="icon" src="chrome://browser/skin/images/marketplace-logo.png" />
<div class="inner">
<div id="browse-title" class="title">&aboutApps.browseMarketplace;</div>
</div>
</div>
</body>
</html>

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

@ -5,11 +5,6 @@
<!ENTITY aboutApps.title2 "Apps">
<!ENTITY aboutApps.header "Your Apps">
<!-- LOCALIZATION NOTE (aboutApps.noApps.pre): include a trailing space as needed -->
<!-- LOCALIZATION NOTE (aboutApps.noApps.middle): avoid leading/trailing spaces, this text is a link -->
<!-- LOCALIZATION NOTE (aboutApps.noApps.post): include a starting space as needed -->
<!ENTITY aboutApps.noApps.pre "No web apps installed. Get some from the ">
<!ENTITY aboutApps.noApps.middle3 "Firefox Marketplace">
<!ENTITY aboutApps.noApps.post ".">
<!ENTITY aboutApps.browseMarketplace "Browse the Firefox Marketplace">
<!ENTITY aboutApps.uninstall "Uninstall">
<!ENTITY aboutApps.addToHomescreen "Add to Home Screen">

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

@ -2,15 +2,6 @@
* 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/. */
.inner {
background-color: #eef2f5;
min-height: 3.8em;
padding: 0.5em;
/* make room for the favicon */
-moz-margin-start: 4.5em;
}
.details {
width: 100%;
}
@ -33,14 +24,6 @@
bottom: -3px;
}
#browse-title {
margin-top: 1em;
background-image: url("chrome://browser/skin/images/chevron.png");
background-size: 8px 20px;
background-position: right;
background-repeat: no-repeat;
}
#header-button {
background-image: url("chrome://browser/skin/images/amo-logo.png"), url("chrome://browser/skin/images/chevron.png");
background-size: 20px 20px, 8px 20px;

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

@ -7,16 +7,20 @@
}
#header-button {
background-image: url("chrome://browser/skin/images/marketplace-logo.png");
background-image: url("chrome://browser/skin/images/marketplace-logo.png"), url("chrome://browser/skin/images/chevron.png");
background-size: 32px 32px, 8px 20px;
background-position: left, right 0.5em center;
-moz-padding-start: 2.5em;
}
#main-container {
margin: 1em;
padding: 1em;
border-radius: 10px;
border: 1px solid grey;
background-color: white;
width: calc(100% - 4em);
padding: 2em;
background-color: #EEF2F5;
border-bottom: 1px solid #BAC2AC;
}
.hidden {
display: none;
}
.spacer {
@ -44,12 +48,3 @@
.app div {
pointer-events: none;
}
#noapps {
padding: 1em;
text-align: center;
}
.hidden {
display: none;
}

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

@ -65,6 +65,15 @@ body {
background-image: none;
}
.inner {
background-color: #eef2f5;
min-height: 3.8em;
padding: 0.5em;
/* make room for the favicon */
-moz-margin-start: 4.5em;
}
/* Icons */
body[dir="ltr"] .icon {
left: 1.35em;
@ -132,3 +141,11 @@ body[dir="ltr"] .icon {
overflow: hidden;
flex: 1;
}
#browse-title {
margin-top: 1em;
background-image: url("chrome://browser/skin/images/chevron.png");
background-size: 8px 20px;
background-position: right;
background-repeat: no-repeat;
}

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

@ -11,7 +11,7 @@
<Url type="text/html" method="GET" template="http://search.yahoo.com/search">
<Param name="p" value="{searchTerms}" />
<Param name="ei" value="UTF-8" />
<Param name="fr" value="mozilla_mobile_search" />
<MozParam name="fr" condition="top2" trueValue="mozilla_mobile_search" falseValue="" />
</Url>
<SearchForm>http://search.yahoo.com/</SearchForm>
</SearchPlugin>

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

@ -46,8 +46,11 @@
var useJSTransfer = false;
try {
useJSTransfer = prefs.getBoolPref("useJSTransfer");
} catch (ex) { }
// This method throws an exception if the old Download Manager is disabled.
Services.downloads.activeDownloadCount;
} catch (ex) {
useJSTransfer = true;
}
if (useJSTransfer) {
var Downloads = SpecialPowers.Cu.import("resource://gre/modules/Downloads.jsm").Downloads;

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

@ -15,6 +15,12 @@
#include "mozilla/dom/quota/QuotaObject.h"
#include "mozilla/IOInterposer.h"
// The last VFS version for which this file has been updated.
#define LAST_KNOWN_VFS_VERSION 3
// The last io_methods version for which this file has been updated.
#define LAST_KNOWN_IOMETHODS_VERSION 3
/**
* This preference is a workaround to allow users/sysadmins to identify
* that the profile exists on an NFS share whose implementation
@ -400,10 +406,11 @@ xOpen(sqlite3_vfs* vfs, const char *zName, sqlite3_file* pFile,
sqlite3_io_methods *pNew = new sqlite3_io_methods;
const sqlite3_io_methods *pSub = p->pReal->pMethods;
memset(pNew, 0, sizeof(*pNew));
// If you update this version number, you must add appropriate IO methods
// for any methods added in the version change.
pNew->iVersion = 3;
MOZ_ASSERT(pNew->iVersion >= pSub->iVersion);
// If the io_methods version is higher than the last known one, you should
// update this VFS adding appropriate IO methods for any methods added in
// the version change.
pNew->iVersion = pSub->iVersion;
MOZ_ASSERT(pNew->iVersion <= LAST_KNOWN_IOMETHODS_VERSION);
pNew->xClose = xClose;
pNew->xRead = xRead;
pNew->xWrite = xWrite;
@ -416,19 +423,23 @@ xOpen(sqlite3_vfs* vfs, const char *zName, sqlite3_file* pFile,
pNew->xFileControl = xFileControl;
pNew->xSectorSize = xSectorSize;
pNew->xDeviceCharacteristics = xDeviceCharacteristics;
// Methods added in version 2.
pNew->xShmMap = pSub->xShmMap ? xShmMap : 0;
pNew->xShmLock = pSub->xShmLock ? xShmLock : 0;
pNew->xShmBarrier = pSub->xShmBarrier ? xShmBarrier : 0;
pNew->xShmUnmap = pSub->xShmUnmap ? xShmUnmap : 0;
// Methods added in version 3.
// SQLite 3.7.17 calls these methods without checking for nullptr first,
// so we always define them. Verify that we're not going to call
// nullptrs, though.
MOZ_ASSERT(pSub->xFetch);
pNew->xFetch = xFetch;
MOZ_ASSERT(pSub->xUnfetch);
pNew->xUnfetch = xUnfetch;
if (pNew->iVersion >= 2) {
// Methods added in version 2.
pNew->xShmMap = pSub->xShmMap ? xShmMap : 0;
pNew->xShmLock = pSub->xShmLock ? xShmLock : 0;
pNew->xShmBarrier = pSub->xShmBarrier ? xShmBarrier : 0;
pNew->xShmUnmap = pSub->xShmUnmap ? xShmUnmap : 0;
}
if (pNew->iVersion >= 3) {
// Methods added in version 3.
// SQLite 3.7.17 calls these methods without checking for nullptr first,
// so we always define them. Verify that we're not going to call
// nullptrs, though.
MOZ_ASSERT(pSub->xFetch);
pNew->xFetch = xFetch;
MOZ_ASSERT(pSub->xUnfetch);
pNew->xUnfetch = xUnfetch;
}
pFile->pMethods = pNew;
}
return rc;
@ -572,10 +583,11 @@ sqlite3_vfs* ConstructTelemetryVFS()
sqlite3_vfs *tvfs = new ::sqlite3_vfs;
memset(tvfs, 0, sizeof(::sqlite3_vfs));
// If you update this version number, you must add appropriate VFS methods
// for any methods added in the version change.
tvfs->iVersion = 3;
MOZ_ASSERT(vfs->iVersion == tvfs->iVersion);
// If the VFS version is higher than the last known one, you should update
// this VFS adding appropriate methods for any methods added in the version
// change.
tvfs->iVersion = vfs->iVersion;
MOZ_ASSERT(vfs->iVersion <= LAST_KNOWN_VFS_VERSION);
tvfs->szOsFile = sizeof(telemetry_file) - sizeof(sqlite3_file) + vfs->szOsFile;
tvfs->mxPathname = vfs->mxPathname;
tvfs->zName = "telemetry-vfs";
@ -592,13 +604,16 @@ sqlite3_vfs* ConstructTelemetryVFS()
tvfs->xSleep = xSleep;
tvfs->xCurrentTime = xCurrentTime;
tvfs->xGetLastError = xGetLastError;
// Methods added in version 2.
tvfs->xCurrentTimeInt64 = xCurrentTimeInt64;
// Methods added in version 3.
tvfs->xSetSystemCall = xSetSystemCall;
tvfs->xGetSystemCall = xGetSystemCall;
tvfs->xNextSystemCall = xNextSystemCall;
if (tvfs->iVersion >= 2) {
// Methods added in version 2.
tvfs->xCurrentTimeInt64 = xCurrentTimeInt64;
}
if (tvfs->iVersion >= 3) {
// Methods added in version 3.
tvfs->xSetSystemCall = xSetSystemCall;
tvfs->xGetSystemCall = xGetSystemCall;
tvfs->xNextSystemCall = xNextSystemCall;
}
return tvfs;
}

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

@ -40,6 +40,7 @@
#ifdef XP_WIN
#include <shlobj.h>
#include "nsWindowsHelpers.h"
#ifdef DOWNLOAD_SCANNER
#include "nsDownloadScanner.h"
#endif
@ -937,7 +938,25 @@ nsDownloadManager::Init()
getter_AddRefs(mBundle));
NS_ENSURE_SUCCESS(rv, rv);
#if defined(MOZ_JSDOWNLOADS) && !defined(XP_WIN)
// When MOZ_JSDOWNLOADS is defined on a non-Windows platform, this component
// is always disabled and we can safely omit the initialization code.
mUseJSTransfer = true;
#else
#if defined(MOZ_JSDOWNLOADS) && defined(XP_WIN)
// When MOZ_JSDOWNLOADS is defined on Windows, this component is disabled
// unless we are running in Windows Metro. The conversion of Windows Metro
// to use the JavaScript API for downloads is tracked in bug 906042.
mUseJSTransfer = !IsRunningInWindowsMetro();
#else
// When MOZ_JSDOWNLOADS is undefined, we still check the preference that can
// be used to enable the JavaScript API during the migration process.
mUseJSTransfer = Preferences::GetBool(PREF_BD_USEJSTRANSFER, false);
#endif
if (mUseJSTransfer)
return NS_OK;
@ -1008,6 +1027,8 @@ nsDownloadManager::Init()
if (history)
(void)history->AddObserver(this, true);
#endif // defined(MOZ_JSDOWNLOADS) && !defined(XP_WIN)
return NS_OK;
}

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

@ -4,8 +4,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/.
TEST_DIRS += ['browser']
MODULE = 'test_dm'
XPCSHELL_TESTS_MANIFESTS += ['schema_migration/xpcshell.ini', 'unit/xpcshell.ini']
if not CONFIG['MOZ_JSDOWNLOADS']:
TEST_DIRS += ['browser']
XPCSHELL_TESTS_MANIFESTS += ['schema_migration/xpcshell.ini']
XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']

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

@ -243,9 +243,10 @@ do_register_cleanup(function() {
function oldDownloadManagerDisabled() {
try {
if (Services.prefs.getBoolPref("browser.download.useJSTransfer")) {
return true;
}
} catch (ex) { }
// This method throws an exception if the old Download Manager is disabled.
Services.downloads.activeDownloadCount;
} catch (ex) {
return true;
}
return false;
}

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

@ -909,7 +909,33 @@ EngineURL.prototype = {
this.mozparams[aObj.name] = aObj;
},
reevalMozParams: function(engine) {
for (let param of this.params) {
let mozparam = this.mozparams[param.name];
if (mozparam && mozparam.positionDependent) {
// the condition is a string in the form of "topN", extract N as int
let positionStr = mozparam.condition.slice("top".length);
let position = parseInt(positionStr, 10);
let engines;
try {
// This will throw if we're not initialized yet (which shouldn't happen), just
// ignore and move on with the false Value (checking isInitialized also throws)
// XXX
engines = Services.search.getVisibleEngines({});
} catch (ex) {
LOG("reevalMozParams called before search service initialization!?");
break;
}
let index = engines.map((e) => e.wrappedJSObject).indexOf(engine.wrappedJSObject);
let isTopN = index > -1 && (index + 1) <= position;
param.value = isTopN ? mozparam.trueValue : mozparam.falseValue;
}
}
},
getSubmission: function SRCH_EURL_getSubmission(aSearchTerms, aEngine, aPurpose) {
this.reevalMozParams(aEngine);
var url = ParamSubstitution(this.template, aSearchTerms, aEngine);
// Default to an empty string if the purpose is not provided so that default purpose params
// (purpose="") work consistently rather than having to define "null" and "" purposes.
@ -1647,7 +1673,8 @@ Engine.prototype = {
// We only support MozParams for default search engines
this._isDefault) {
var value;
switch (param.getAttribute("condition")) {
let condition = param.getAttribute("condition");
switch (condition) {
case "purpose":
url.addParam(param.getAttribute("name"),
param.getAttribute("value"),
@ -1677,6 +1704,17 @@ Engine.prototype = {
"condition": "pref"});
} catch (e) { }
break;
default:
if (condition && condition.startsWith("top")) {
url.addParam(param.getAttribute("name"), param.getAttribute("falseValue"));
let mozparam = {"name": param.getAttribute("name"),
"falseValue": param.getAttribute("falseValue"),
"trueValue": param.getAttribute("trueValue"),
"condition": condition,
"positionDependent": true};
url._addMozParam(mozparam);
}
break;
}
}
}

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

@ -14,7 +14,9 @@ MOCHITEST_DATA_FILES = \
data/app-redirect.zip \
data/app-updated.zip \
data/app.zip \
data/app-certified.zip \
$(NULL)
MOCHITEST_DATA_DEST = $(MOCHITEST_DEST)/data
INSTALL_TARGETS += MOCHITEST_DATA
endif

Двоичные данные
toolkit/devtools/apps/tests/data/app-certified.zip Normal file

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

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

@ -154,6 +154,26 @@ var steps = [
}
);
},
function() {
ok(true, "== TEST == Install certified app");
let appId = "test-certified-id";
let url = SimpleTest.getTestFileURL("data/app-certified.zip");
installTestApp(url, appId,
function (aResponse, aApp) {
ok(true, "Installed");
is(aResponse.appId, appId, "Got same app id");
if ("error" in aResponse) {
ok(false, "Error: " + aResponse.error);
}
if ("message" in aResponse) {
ok(false, "Error message: " + aResponse.message);
}
ok(!("error" in aResponse), "app installed without any error");
is(aApp.manifest.name, "Certified app", "app name is correct");
next();
}
);
},
function() {
ok(true, "all done!\n");
mm.sendAsyncMessage("cleanup");

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

@ -221,7 +221,17 @@ Connection.prototype = {
if (!this.host) {
transport = DebuggerServer.connectPipe();
} else {
transport = debuggerSocketConnect(this.host, this.port);
try {
transport = debuggerSocketConnect(this.host, this.port);
} catch (e) {
// In some cases, especially on Mac, the openOutputStream call in
// debuggerSocketConnect may throw NS_ERROR_NOT_INITIALIZED.
// It occurs when we connect agressively to the simulator,
// and keep trying to open a socket to the server being started in
// the simulator.
this._onDisconnected();
return;
}
}
this._client = new DebuggerClient(transport);
this._client.addOneTimeListener("closed", this._onDisconnected);
@ -244,7 +254,7 @@ Connection.prototype = {
this._client = null;
if (this._status == Connection.Status.CONNECTING && this.keepConnecting) {
setTimeout(() => this._clientConnect(), 0);
setTimeout(() => this._clientConnect(), 100);
return;
}

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

@ -2200,8 +2200,24 @@ eventSource(EnvironmentClient.prototype);
this.debuggerSocketConnect = function debuggerSocketConnect(aHost, aPort)
{
let s = socketTransportService.createTransport(null, 0, aHost, aPort, null);
let transport = new DebuggerTransport(s.openInputStream(0, 0, 0),
s.openOutputStream(0, 0, 0));
// By default the CONNECT socket timeout is very long, 65535 seconds,
// so that if we race to be in CONNECT state while the server socket is still
// initializing, the connection is stuck in connecting state for 18.20 hours!
s.setTimeout(Ci.nsISocketTransport.TIMEOUT_CONNECT, 2);
// openOutputStream may throw NS_ERROR_NOT_INITIALIZED if we hit some race
// where the nsISocketTransport gets shutdown in between its instantiation and
// the call to this method.
let transport;
try {
transport = new DebuggerTransport(s.openInputStream(0, 0, 0),
s.openOutputStream(0, 0, 0));
} catch(e) {
let msg = e + ": " + e.stack;
Cu.reportError(msg);
dumpn(msg);
throw e;
}
return transport;
}

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

@ -389,13 +389,6 @@ WebappsActor.prototype = {
let appType = self._getAppType(manifest.type);
// In production builds, don't allow installation of certified apps.
if (!DOMApplicationRegistry.allowSideloadingCertified &&
appType == Ci.nsIPrincipal.APP_STATUS_CERTIFIED) {
self._sendError(deferred, "Installing certified apps is not allowed.", aId);
return;
}
// Privileged and certified packaged apps can setup a custom origin
// via `origin` manifest property
let id = aId;

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

@ -98,8 +98,11 @@ this.ForgetAboutSite = {
// Downloads
let useJSTransfer = false;
try {
useJSTransfer = Services.prefs.getBoolPref("browser.download.useJSTransfer");
} catch(ex) { }
// This method throws an exception if the old Download Manager is disabled.
Services.downloads.activeDownloadCount;
} catch (ex) {
useJSTransfer = true;
}
if (useJSTransfer) {
Task.spawn(function() {

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

@ -30,3 +30,14 @@ function cleanUp()
}
}
cleanUp();
function oldDownloadManagerDisabled()
{
try {
// This method throws an exception if the old Download Manager is disabled.
Services.downloads.activeDownloadCount;
} catch (ex) {
return true;
}
return false;
}

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

@ -445,6 +445,10 @@ function test_cookie_not_cleared_with_uri_contains_domain()
// Download Manager
function test_download_history_cleared_with_direct_match()
{
if (oldDownloadManagerDisabled()) {
return;
}
const TEST_URI = "http://mozilla.org/foo";
add_download(TEST_URI, false);
ForgetAboutSite.removeDataFromDomain("mozilla.org");
@ -453,6 +457,10 @@ function test_download_history_cleared_with_direct_match()
function test_download_history_cleared_with_subdomain()
{
if (oldDownloadManagerDisabled()) {
return;
}
const TEST_URI = "http://www.mozilla.org/foo";
add_download(TEST_URI, false);
ForgetAboutSite.removeDataFromDomain("mozilla.org");
@ -461,6 +469,10 @@ function test_download_history_cleared_with_subdomain()
function test_download_history_not_cleared_with_active_direct_match()
{
if (oldDownloadManagerDisabled()) {
return;
}
// Tests that downloads marked as active in the db are not deleted from the db
const TEST_URI = "http://mozilla.org/foo";
add_download(TEST_URI, true);

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

@ -82,6 +82,10 @@ function makeGUID() {
function run_test()
{
if (oldDownloadManagerDisabled()) {
return;
}
// We add this data to the database first, but we cannot instantiate the
// download manager service, otherwise these downloads will not be placed in
// the active downloads array.

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

@ -117,15 +117,6 @@ var DownloadTaskbarProgressUpdater =
}
this._initialized = true;
// Taskbar progress is disabled until this component is updated to use the
// asynchronous JavaScript API for downloads.
try {
if (Services.prefs.getBoolPref("browser.download.useJSTransfer")) {
DownloadTaskbarProgressUpdater = null;
return;
}
} catch (ex) { }
if (kTaskbarIDWin in Cc) {
this._taskbar = Cc[kTaskbarIDWin].getService(Ci.nsIWinTaskbar);
if (!this._taskbar.available) {

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

@ -29,6 +29,12 @@ let DownloadTaskbarProgress, TaskbarService, observerService, wwatch, chromeWind
let gGen = null;
function test() {
var dmui = getDMUI();
if (!dmui) {
todo(false, "skip test for toolkit download manager UI");
return;
}
let isWin7OrHigher = false;
try {
let version = Cc["@mozilla.org/system-info;1"]

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

@ -23,10 +23,11 @@ Components.utils.import("resource://gre/modules/Services.jsm");
function getDMUI()
{
try {
if (Services.prefs.getBoolPref("browser.download.useJSTransfer")) {
return false;
}
} catch (ex) { }
// This method throws an exception if the old Download Manager is disabled.
Services.downloads.activeDownloadCount;
} catch (ex) {
return false;
}
if (Components.classesByID["{7dfdf0d1-aff6-4a34-bad1-d0fe74601642}"])
return Components.classesByID["{7dfdf0d1-aff6-4a34-bad1-d0fe74601642}"].
getService(Ci.nsIDownloadManagerUI);

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

@ -14,7 +14,10 @@ XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
#FIXME/bug 575918: out-of-process xpcshell is broken on OS X
if CONFIG['OS_ARCH'] != 'Darwin':
XPCSHELL_TESTS_MANIFESTS += ['unit_ipc/xpcshell.ini']
# The encoding test is already implemented in the Downloads API by a set of
# test cases with the string "content_encoding" in their names.
if not CONFIG['MOZ_JSDOWNLOADS']:
XPCSHELL_TESTS_MANIFESTS += ['unit_ipc/xpcshell.ini']
sources = [
'WriteArgument',