merge fx-team to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2015-07-22 13:56:49 +02:00
commit 38a6b2c1d7
27 changed files with 327 additions and 106 deletions

View File

@ -432,6 +432,9 @@ pref("browser.search.redirectWindowsSearch", true);
pref("browser.search.redirectWindowsSearch", false);
#endif
pref("browser.usedOnWindows10", false);
pref("browser.usedOnWindows10.introURL", "https://www.mozilla.org/%LOCALE%/firefox/windows-10/welcome/?utm_source=firefox-browser&utm_medium=firefox-browser");
pref("browser.sessionhistory.max_entries", 50);
// Built-in default permissions.

View File

@ -465,8 +465,6 @@ input[type=button] {
position: absolute;
top: 100%;
right: -25px;
background-color: white;
border-radius: 6px;
filter: drop-shadow(0 0 1px rgba(0,0,0,0.4)) drop-shadow(0 3px 4px rgba(0,0,0,0.4));
transition: all 200ms ease-in-out;
transform-origin: top right;
@ -512,6 +510,12 @@ input[type=button] {
border-top: none;
}
#newtab-customize-panel-inner-wrapper {
background-color: #FFFFFF;
border-radius: 6px;
overflow: hidden;
}
#newtab-customize-title > label {
cursor: default;
}

View File

@ -23,11 +23,12 @@
<div class="newtab-customize-panel-container">
<div id="newtab-customize-panel" orient="vertical">
<div id="newtab-customize-panel-anchor"></div>
<div id="newtab-customize-title" class="newtab-customize-panel-item">
<div id="newtab-customize-panel-inner-wrapper">
<div id="newtab-customize-title" class="newtab-customize-panel-item">
<label>&newtab.customize.cog.title2;</label>
</div>
</div>
<div class="newtab-customize-complex-option">
<div class="newtab-customize-complex-option">
<div id="newtab-customize-classic" class="newtab-customize-panel-superitem newtab-customize-panel-item selectable">
<label>&newtab.customize.classic;</label>
</div>
@ -35,12 +36,13 @@
<label class="checkbox"></label>
<label>&newtab.customize.cog.enhanced;</label>
</div>
</div>
<div id="newtab-customize-blank" class="newtab-customize-panel-item selectable">
</div>
<div id="newtab-customize-blank" class="newtab-customize-panel-item selectable">
<label>&newtab.customize.blank2;</label>
</div>
<div id="newtab-customize-learn" class="newtab-customize-panel-item">
</div>
<div id="newtab-customize-learn" class="newtab-customize-panel-item">
<label>&newtab.customize.cog.learn;</label>
</div>
</div>
</div>
</div>

View File

@ -552,10 +552,9 @@ nsBrowserContentHandler.prototype = {
let platformVersion = Services.sysinfo.getProperty("version");
if (AppConstants.platform == "win" &&
Services.vc.compare(platformVersion, "10") == 0 &&
Services.prefs.getPrefType("browser.usedOnWindows10") == Services.prefs.PREF_BOOL &&
!Services.prefs.getBoolPref("browser.usedOnWindows10")) {
Services.prefs.setBoolPref("browser.usedOnWindows10", true);
let firstUseOnWindows10URL = Services.urlFormatter.formatURL("https://www.mozilla.org/%LOCALE%/firefox/windows10/");
let firstUseOnWindows10URL = Services.urlFormatter.formatURLPref("browser.usedOnWindows10.introURL");
if (firstUseOnWindows10URL && firstUseOnWindows10URL.length) {
if (overridePage) {

View File

@ -2186,7 +2186,8 @@ let Prefs = new ViewHelpers.Prefs("devtools", {
autoPrettyPrint: ["Bool", "debugger.auto-pretty-print"],
workersEnabled: ["Bool", "debugger.workers"],
editorTabSize: ["Int", "editor.tabsize"],
autoBlackBox: ["Bool", "debugger.auto-black-box"]
autoBlackBox: ["Bool", "debugger.auto-black-box"],
promiseDebuggerEnabled: ["Bool", "debugger.promise"]
});
/**

View File

@ -110,6 +110,7 @@ let DebuggerView = {
this._workersAndSourcesPane = document.getElementById("workers-and-sources-pane");
this._instrumentsPane = document.getElementById("instruments-pane");
this._instrumentsPaneToggleButton = document.getElementById("instruments-pane-toggle");
this._promisePane = document.getElementById("promise-debugger-pane");
this.showEditor = this.showEditor.bind(this);
this.showBlackBoxMessage = this.showBlackBoxMessage.bind(this);
@ -146,6 +147,7 @@ let DebuggerView = {
this._workersAndSourcesPane = null;
this._instrumentsPane = null;
this._instrumentsPaneToggleButton = null;
this._promisePane = null;
},
/**
@ -601,7 +603,6 @@ let DebuggerView = {
* Switches the debugger widgets to a horizontal layout.
*/
_enterVerticalLayout: function() {
let normContainer = document.getElementById("debugger-widgets");
let vertContainer = document.getElementById("vertical-layout-panes-container");
// Move the soruces and instruments panes in a different container.
@ -620,13 +621,13 @@ let DebuggerView = {
*/
_enterHorizontalLayout: function() {
let normContainer = document.getElementById("debugger-widgets");
let vertContainer = document.getElementById("vertical-layout-panes-container");
let editorPane = document.getElementById("editor-and-instruments-pane");
// The sources and instruments pane need to be inserted at their
// previous locations in their normal container.
let splitter = document.getElementById("sources-and-editor-splitter");
normContainer.insertBefore(this._workersAndSourcesPane, splitter);
normContainer.appendChild(this._instrumentsPane);
editorPane.appendChild(this._instrumentsPane);
// Revert to the preferred sources and instruments widths, because
// they flexed in the vertical layout.

View File

@ -341,6 +341,11 @@
<toolbarbutton id="toggle-pause-exceptions"
class="devtools-toolbarbutton"
command="togglePauseOnExceptionsCommand"/>
<toolbarbutton id="toggle-promise-debugger"
class="devtools-toolbarbutton"
tooltiptext="&debuggerUI.sources.togglePromiseDebugger;"
command="togglePromiseDebuggerCommand"
hidden="true"/>
</toolbar>
</tabpanel>
<tabpanel id="callstack-tabpanel">
@ -351,46 +356,56 @@
</vbox>
<splitter id="sources-and-editor-splitter"
class="devtools-side-splitter"/>
<deck id="editor-deck" flex="1" class="devtools-main-content">
<vbox id="editor"/>
<vbox id="black-boxed-message"
align="center"
pack="center">
<description id="black-boxed-message-label">
&debuggerUI.blackBoxMessage.label;
</description>
<button id="black-boxed-message-button"
class="devtools-toolbarbutton"
label="&debuggerUI.blackBoxMessage.unBlackBoxButton;"
command="unBlackBoxCommand"/>
</vbox>
<html:div id="source-progress-container"
align="center">
<html:div id="hbox">
<html:progress id="source-progress"></html:progress>
</html:div>
</html:div>
</deck>
<splitter id="editor-and-instruments-splitter"
class="devtools-side-splitter"/>
<tabbox id="instruments-pane"
class="devtools-sidebar-tabs"
<vbox id="debugger-content" flex="1">
<hbox id="editor-and-instruments-pane" flex="1">
<deck id="editor-deck" flex="1" class="devtools-main-content">
<vbox id="editor"/>
<vbox id="black-boxed-message"
align="center"
pack="center">
<description id="black-boxed-message-label">
&debuggerUI.blackBoxMessage.label;
</description>
<button id="black-boxed-message-button"
class="devtools-toolbarbutton"
label="&debuggerUI.blackBoxMessage.unBlackBoxButton;"
command="unBlackBoxCommand"/>
</vbox>
<html:div id="source-progress-container"
align="center">
<html:div id="hbox">
<html:progress id="source-progress"></html:progress>
</html:div>
</html:div>
</deck>
<splitter id="editor-and-instruments-splitter"
class="devtools-side-splitter"/>
<tabbox id="instruments-pane"
class="devtools-sidebar-tabs"
hidden="true">
<tabs>
<tab id="variables-tab" label="&debuggerUI.tabs.variables;"/>
<tab id="events-tab" label="&debuggerUI.tabs.events;"/>
</tabs>
<tabpanels flex="1">
<tabpanel id="variables-tabpanel">
<vbox id="expressions"/>
<splitter class="devtools-horizontal-splitter"/>
<vbox id="variables" flex="1"/>
</tabpanel>
<tabpanel id="events-tabpanel">
<vbox id="event-listeners" flex="1"/>
</tabpanel>
</tabpanels>
</tabbox>
</hbox>
<splitter id="editor-and-promise-splitter"
class="devtools-horizontal-splitter"/>
<vbox id="promise-debugger-pane"
flex="1"
hidden="true">
<tabs>
<tab id="variables-tab" label="&debuggerUI.tabs.variables;"/>
<tab id="events-tab" label="&debuggerUI.tabs.events;"/>
</tabs>
<tabpanels flex="1">
<tabpanel id="variables-tabpanel">
<vbox id="expressions"/>
<splitter class="devtools-horizontal-splitter"/>
<vbox id="variables" flex="1"/>
</tabpanel>
<tabpanel id="events-tabpanel">
<vbox id="event-listeners" flex="1"/>
</tabpanel>
</tabpanels>
</tabbox>
</vbox>
</vbox>
<splitter id="vertical-layout-splitter"
class="devtools-horizontal-splitter"/>
<hbox id="vertical-layout-panes-container">

View File

@ -73,27 +73,45 @@ function testHost(aTab, aPanel, aHostType, aLayoutType) {
if (aLayoutType == "horizontal") {
is(gView._workersAndSourcesPane.parentNode.id, "debugger-widgets",
"The workers and sources pane's parent is correct for the horizontal layout.");
is(gView._instrumentsPane.parentNode.id, "debugger-widgets",
is(gView._instrumentsPane.parentNode.id, "editor-and-instruments-pane",
"The instruments pane's parent is correct for the horizontal layout.");
is(gDebugger.document.getElementById("promise-debugger-pane").parentNode.id,
"debugger-content",
"The promise pane's parent is correct for the horizontal layout.");
} else {
is(gView._workersAndSourcesPane.parentNode.id, "vertical-layout-panes-container",
"The workers and sources pane's parent is correct for the vertical layout.");
is(gView._instrumentsPane.parentNode.id, "vertical-layout-panes-container",
"The instruments pane's parent is correct for the vertical layout.");
is(gDebugger.document.getElementById("promise-debugger-pane").parentNode.id,
"debugger-content",
"The promise pane's parent is correct for the horizontal layout.");
}
let widgets = gDebugger.document.getElementById("debugger-widgets").childNodes;
let panes = gDebugger.document.getElementById("vertical-layout-panes-container").childNodes;
let content = gDebugger.document.getElementById("debugger-content").childNodes;
let editorPane =
gDebugger.document.getElementById("editor-and-instruments-pane").childNodes;
let verticalPane =
gDebugger.document.getElementById("vertical-layout-panes-container").childNodes;
if (aLayoutType == "horizontal") {
is(widgets.length, 7, // 2 panes, 1 editor, 3 splitters and a phantom box.
is(widgets.length, 5, // 1 pane, 1 content box, 2 splitters and a phantom box.
"Found the correct number of debugger widgets.");
is(panes.length, 1, // 1 lonely splitter in the phantom box.
is(content.length, 3, // 2 panes, 1 splitter.
"Found the correct number of debugger content.");
is(editorPane.length, 3, // 2 panes, 1 splitter
"Found the correct number of debugger panes.");
is(verticalPane.length, 1, // 1 lonely splitter in the phantom box.
"Found the correct number of debugger panes.");
} else {
is(widgets.length, 5, // 1 editor, 3 splitters and a phantom box.
is(widgets.length, 4, // 1 content box, 2 splitters and a phantom box.
"Found the correct number of debugger widgets.");
is(panes.length, 3, // 2 panes and 1 splitter in the phantom box.
is(content.length, 3, // 2 panes, 1 splitter.
"Found the correct number of debugger content.");
is(editorPane.length, 2, // 1 pane, 1 splitter
"Found the correct number of debugger panes.");
is(verticalPane.length, 3, // 2 panes and 1 splitter in the phantom box.
"Found the correct number of debugger panes.");
}
}

View File

@ -2,7 +2,7 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that creating, collpasing and expanding variables in the
* Tests that creating, collapsing and expanding variables in the
* variables view works as expected.
*/
@ -22,7 +22,7 @@ function test() {
ok(testScope,
"Should have created a scope.");
is(duplVar, null,
is(duplVar, testVar,
"Shouldn't be able to duplicate variables in the same scope.");
ok(testVar,

View File

@ -96,8 +96,10 @@ function testVariablesAndPropertiesFiltering() {
}
function firstFilter() {
let expanded = once(gVariables, "fetched");
typeText(gSearchBox, "constructor");
testFiltered();
gSearchBox.doCommand();
return expanded.then(testFiltered);
}
function secondFilter() {
@ -128,13 +130,13 @@ function testVariablesAndPropertiesFiltering() {
is(constr2Var.expanded, false,
"The constr2Var should not be expanded.");
let expanded = once(gVariables, "fetched");
clearText(gSearchBox);
typeText(gSearchBox, "constructor");
testFiltered();
expanded.then(testFiltered);
}
firstFilter();
secondFilter();
firstFilter().then(secondFilter);
}
function prepareVariablesAndProperties() {

View File

@ -103,8 +103,10 @@ function testVariablesAndPropertiesFiltering() {
}
function firstFilter() {
let expanded = once(gVariables, "fetched");
typeText(gSearchBox, "\"Function\"");
testFiltered();
gSearchBox.doCommand();
return expanded.then(testFiltered);
}
function secondFilter() {
@ -136,12 +138,13 @@ function testVariablesAndPropertiesFiltering() {
"The constr2Var should not be expanded.");
backspaceText(gSearchBox, 10);
let expanded = once(gVariables, "fetched");
typeText(gSearchBox, "\"Function\"");
testFiltered();
gSearchBox.doCommand();
expanded.then(testFiltered);
}
firstFilter();
secondFilter();
firstFilter().then(secondFilter);
}
function prepareVariablesAndProperties() {

View File

@ -151,6 +151,7 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
prettyPrintCommand: () => this.togglePrettyPrint(),
toggleBreakpointsCommand: () =>this.toggleBreakpoints(),
togglePauseOnExceptionsCommand: () => this.togglePauseOnExceptions(),
togglePromiseDebuggerCommand: () => this.togglePromiseDebugger(),
nextSourceCommand: () => this.selectNextItem(),
prevSourceCommand: () => this.selectPrevItem()
});
@ -659,6 +660,13 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
this._togglePauseOnExceptionsButton.setAttribute("state", state);
},
togglePromiseDebugger: function() {
if (Prefs.promiseDebuggerEnabled) {
let promisePane = this.DebuggerView._promisePane;
promisePane.hidden = !promisePane.hidden;
}
},
hidePrettyPrinting: function() {
this._prettyPrintButton.style.display = 'none';

View File

@ -453,7 +453,7 @@ VariablesView.prototype = {
searchbox.setAttribute("placeholder", this._searchboxPlaceholder);
searchbox.setAttribute("type", "search");
searchbox.setAttribute("flex", "1");
searchbox.addEventListener("input", this._onSearchboxInput, false);
searchbox.addEventListener("command", this._onSearchboxInput, false);
searchbox.addEventListener("keypress", this._onSearchboxKeyPress, false);
container.appendChild(searchbox);
@ -470,7 +470,7 @@ VariablesView.prototype = {
return;
}
this._searchboxContainer.remove();
this._searchboxNode.removeEventListener("input", this._onSearchboxInput, false);
this._searchboxNode.removeEventListener("command", this._onSearchboxInput, false);
this._searchboxNode.removeEventListener("keypress", this._onSearchboxKeyPress, false);
this._searchboxContainer = null;
@ -550,11 +550,22 @@ VariablesView.prototype = {
*/
_doSearch: function(aToken) {
if (this.controller.supportsSearch()) {
this.empty();
let scope = this.addScope(aToken);
scope.expanded = true; // Expand the scope by default.
scope.locked = true; // Prevent collapsing the scope.
// Retrieve the main Scope in which we add attributes
let scope = this._store[0]._store.get("");
if (!aToken) {
// Prune the view from old previous content
// so that we delete the intermediate search results
// we created in previous searches
for (let property of scope._store.values()) {
property.remove();
}
}
// Retrieve new attributes eventually hidden in splits
this.controller.performSearch(scope, aToken);
// Filter already displayed attributes
if (aToken) {
scope._performSearch(aToken.toLowerCase());
}
return;
}
for (let scope of this._store) {
@ -1288,7 +1299,7 @@ Scope.prototype = {
*/
addItem: function(aName = "", aDescriptor = {}, aRelaxed = false) {
if (this._store.has(aName) && !aRelaxed) {
return null;
return this._store.get(aName);
}
let child = this._createChild(aName, aDescriptor);

View File

@ -637,7 +637,10 @@ VariablesViewController.prototype = {
* The query string
*/
performSearch: function(aScope, aToken) {
this._populateFromObjectWithIterator(aScope, this.objectActor, aToken);
this._populateFromObjectWithIterator(aScope, this.objectActor, aToken)
.then(() => {
this.view.emit("fetched", "search", aScope);
});
},
/**

View File

@ -173,6 +173,7 @@ skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s
skip-if = buildapp == 'mulet' || e10s # Bug 1042253 - webconsole e10s tests
[browser_console_variables_view.js]
skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s
[browser_console_variables_view_filter.js]
[browser_console_variables_view_dom_nodes.js]
[browser_console_variables_view_dont_sort_non_sortable_classes_properties.js]
skip-if = buildapp == 'mulet'

View File

@ -0,0 +1,76 @@
/*
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
// Check that variables view filter feature works fine in the console.
function props(view, prefix = "") {
// First match only the visible one, not hidden by a search
let visible = [...view].filter(([id, prop]) => prop._isMatch);
// Then flatten the list into a list of strings
// being the jsonpath of each attribute being visible in the view
return visible.reduce((list, [id, prop]) => {
list.push(prefix + id);
return list.concat(props(prop, prefix + id + "."));
}, []);
}
function assertAttrs(view, expected, message) {
is(props(view).join(","), expected, message);
}
let test = asyncTest(function* () {
yield loadTab("data:text/html;charset=utf-8,webconsole-filter");
let hud = yield openConsole();
let jsterm = hud.jsterm;
let fetched = jsterm.once("variablesview-fetched");
yield jsterm.execute("inspect({ foo: { bar : \"baz\" } })");
let view = yield fetched;
let variablesView = view._variablesView;
let searchbox = variablesView._searchboxNode;
assertAttrs(view, "foo,__proto__", "To start with, we just see the top level foo attr");
fetched = jsterm.once("variablesview-fetched");
searchbox.value = "bar";
searchbox.doCommand();
view = yield fetched;
assertAttrs(view, "", "If we don't manually expand nested attr, we don't see them in search");
fetched = jsterm.once("variablesview-fetched");
searchbox.value = "";
searchbox.doCommand();
view = yield fetched;
assertAttrs(view, "foo", "If we reset the search, we get back to original state");
yield [...view][0][1].expand();
fetched = jsterm.once("variablesview-fetched");
searchbox.value = "bar";
searchbox.doCommand();
view = yield fetched;
assertAttrs(view, "foo,foo.bar", "Now if we expand, we see the nested attr");
fetched = jsterm.once("variablesview-fetched");
searchbox.value = "baz";
searchbox.doCommand();
view = yield fetched;
assertAttrs(view, "foo,foo.bar", "We can also search for attr values");
fetched = jsterm.once("variablesview-fetched");
searchbox.value = "";
searchbox.doCommand();
view = yield fetched;
assertAttrs(view, "foo", "If we reset again, we get back to original state again");
});

View File

@ -50,6 +50,10 @@
- button that toggles all breakpoints for all sources. -->
<!ENTITY debuggerUI.sources.toggleBreakpoints "Enable/disable all breakpoints">
<!-- LOCALIZATION NOTE (debuggerUI.sources.togglePromiseDebugger): This is the
- tooltip for the button that toggles the promise debugger. -->
<!ENTITY debuggerUI.sources.togglePromiseDebugger "Toggle Promise Debugger">
<!-- LOCALIZATION NOTE (debuggerUI.startTracing): This is the text displayed in
- the button to start execution tracing. -->
<!ENTITY debuggerUI.startTracing "Start Tracing">

View File

@ -580,12 +580,12 @@ PluginContent.prototype = {
}
let runID = plugin.runID;
let submitURLOptIn = this.getPluginUI(plugin, "submitURLOptIn");
let submitURLOptIn = this.getPluginUI(plugin, "submitURLOptIn").checked;
let keyVals = {};
let userComment = this.getPluginUI(plugin, "submitComment").value.trim();
if (userComment)
keyVals.PluginUserComment = userComment;
if (this.getPluginUI(plugin, "submitURLOptIn").checked)
if (submitURLOptIn)
keyVals.PluginContentURL = plugin.ownerDocument.URL;
this.global.sendAsyncMessage("PluginContent:SubmitReport",

View File

@ -122,6 +122,10 @@
}
}
#toggle-promise-debugger {
/* TODO Bug 1186119: Add a toggle promise debugger image */
}
#sources-toolbar .devtools-toolbarbutton:not([label]) {
-moz-image-region: rect(0px,16px,16px,0px);
}

View File

@ -311,15 +311,22 @@
}
#nav-bar {
border-top: 1px solid @toolbarShadowColor@ !important;
background-clip: padding-box;
background-image: linear-gradient(@toolbarHighlight@, transparent);
box-shadow: 0 1px 0 @toolbarHighlight@ inset;
}
@media not all and (-moz-windows-compositor) {
#TabsToolbar[collapsed="true"] + #nav-bar {
border-top-style: none !important;
@media (-moz-os-version: windows-xp),
(-moz-os-version: windows-vista),
(-moz-os-version: windows-win7),
(-moz-os-version: windows-win8) {
#nav-bar {
border-top: 1px solid @toolbarShadowColor@ !important;
}
@media not all and (-moz-windows-compositor) {
#TabsToolbar[collapsed="true"] + #nav-bar {
border-top-style: none !important;
}
}
}
@ -2067,6 +2074,30 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
}
}
/* Remove border between tab strip and navigation toolbar on Windows 10+ */
@media not all and (-moz-os-version: windows-xp) {
@media not all and (-moz-os-version: windows-vista) {
@media not all and (-moz-os-version: windows-win7) {
@media not all and (-moz-os-version: windows-win8) {
.tab-background-end[visuallyselected=true]::after,
.tab-background-start[visuallyselected=true]::after {
content: none;
}
.tab-background-middle[visuallyselected=true] {
/* Setting background-size to "0 0" for the first
background-image to remove the stroke. */
background-size: 0 0, auto 100%, auto 100%;
}
:root {
--tab-toolbar-navbar-overlap: 0;
}
}
}
}
}
/* Use solid tab separators for Windows 8+ */
@media not all and (-moz-os-version: windows-xp) {
@media not all and (-moz-os-version: windows-vista) {

View File

@ -266,9 +266,7 @@ pref("browser.search.order.2", "chrome://browser/locale/region.properties");
pref("browser.search.order.3", "chrome://browser/locale/region.properties");
// Market-specific search defaults
// This is disabled globally, and then enabled for individual locales
// in firefox-l10n.js (eg. it's enabled for en-US).
pref("browser.search.geoSpecificDefaults", false);
pref("browser.search.geoSpecificDefaults", true);
pref("browser.search.geoSpecificDefaults.url", "https://search.services.mozilla.com/1/%APP%/%VERSION%/%CHANNEL%/%LOCALE%/%REGION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%");
// US specific default (used as a fallback if the geoSpecificDefaults request fails).

View File

@ -263,6 +263,12 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
*/
@Override
public synchronized void onEnvironmentChanged(final boolean startNewSession, final String sessionEndReason) {
if (!(state == State.INITIALIZING ||
state == State.INITIALIZED)) {
Log.w(LOG_TAG, "Not initialized. Ignoring environment change. State is " + state);
return;
}
final int previousEnv = this.env;
this.env = -1;
try {
@ -295,7 +301,7 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
protected synchronized int ensureEnvironment() {
if (!(state == State.INITIALIZING ||
state == State.INITIALIZED)) {
throw new IllegalStateException("Not initialized.");
throw new IllegalStateException("Not initialized. State is " + state);
}
if (this.env != -1) {
@ -566,10 +572,18 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
try {
profileCache.completeInitialization();
if (state == State.INITIALIZING) {
initializeStorage();
} else {
onEnvironmentChanged();
synchronized (BrowserHealthRecorder.this) {
switch (state) {
case INITIALIZING:
initializeStorage();
break;
case INITIALIZED:
onEnvironmentChanged();
break;
default:
Log.e(LOG_TAG, "Unexpected state " + state + " when handling late distribution.");
return;
}
}
} catch (Exception e) {
// Well, we tried.

View File

@ -4,8 +4,4 @@
#filter substitution
# LOCALIZATION NOTE: this preference is set to true for en-US specifically,
# locales without this line have the setting set to false by default.
pref("browser.search.geoSpecificDefaults", true);
pref("general.useragent.locale", "@AB_CD@");

View File

@ -269,11 +269,24 @@ BookmarksEngine.prototype = {
id, SMART_BOOKMARKS_ANNO);
} catch(ex) {}
if (queryId)
if (queryId) {
key = "q" + queryId;
else
key = "b" + PlacesUtils.bookmarks.getBookmarkURI(id).spec + ":" +
PlacesUtils.bookmarks.getItemTitle(id);
} else {
let uri;
try {
uri = PlacesUtils.bookmarks.getBookmarkURI(id);
} catch (ex) {
// Bug 1182366 - NS_ERROR_MALFORMED_URI here stops bookmarks sync.
this._log.warn("Deleting bookmark with invalid URI. id: " + id);
try {
PlacesUtils.bookmarks.removeItem(id);
} catch (ex) {
this._log.warn("Failed to delete invalid bookmark", ex);
}
continue;
}
key = "b" + uri.spec + ":" + PlacesUtils.bookmarks.getItemTitle(id);
}
break;
case PlacesUtils.bookmarks.TYPE_FOLDER:
key = "f" + PlacesUtils.bookmarks.getItemTitle(id);

View File

@ -4910,7 +4910,7 @@ SearchService.prototype = {
// For privacy, we only collect the submission URL for engines
// from the application or distribution folder...
let sendSubmissionURL =
/^(?:jar:|\[app\]|\[distribution\])/.test(result.loadPath);
/^(?:jar:)?(?:\[app\]|\[distribution\])/.test(result.loadPath);
// ... or engines sorted by default near the top of the list.
if (!sendSubmissionURL) {

View File

@ -1033,8 +1033,7 @@ add_task(function* test_defaultSearchEngine() {
Assert.equal(data.settings.defaultSearchEngine, "telemetrySearchIdentifier");
let expectedSearchEngineData = {
name: "telemetrySearchIdentifier",
loadPath: "jar:[other]/searchTest.jar!testsearchplugin/telemetrySearchIdentifier.xml",
submissionURL: "http://ar.wikipedia.org/wiki/%D8%AE%D8%A7%D8%B5:%D8%A8%D8%AD%D8%AB?search=&sourceid=Mozilla-search"
loadPath: "jar:[other]/searchTest.jar!testsearchplugin/telemetrySearchIdentifier.xml"
};
Assert.deepEqual(data.settings.defaultSearchEngineData, expectedSearchEngineData);

View File

@ -648,8 +648,10 @@ ObjectActor.prototype.requestTypes = {
* If true, the iterator will sort the properties by name
* before dispatching them.
* - query String
* If non-empty, will filter the properties by names containing
* this query string. The match is not case-sensitive.
* If non-empty, will filter the properties by names and values
* containing this query string. The match is not case-sensitive.
* Regarding value filtering it just compare to the stringification
* of the property value.
*/
function PropertyIteratorActor(objectActor, options){
this.objectActor = objectActor;
@ -708,7 +710,20 @@ function PropertyIteratorActor(objectActor, options){
let { query } = options;
query = query.toLowerCase();
names = names.filter(name => {
return name.toLowerCase().includes(query);
// Filter on attribute names
if (name.toLowerCase().includes(query)) {
return true;
}
// and then on attribute values
let desc;
try {
desc = this.obj.getOwnPropertyDescriptor(name);
} catch(e) {}
if (desc && desc.value &&
String(desc.value).includes(query)) {
return true;
}
return false;
});
}