зеркало из https://github.com/mozilla/gecko-dev.git
Merge fx-team to m-c a=merge
This commit is contained in:
Коммит
7a1f50156b
|
@ -1011,6 +1011,12 @@
|
|||
label="&changeSearchSettings.button;"/>
|
||||
</content>
|
||||
<implementation>
|
||||
<!-- Popup rollup is triggered by native events before the mousedown event
|
||||
reaches the DOM. The will be set to true by the popuphiding event and
|
||||
false after the mousedown event has been triggered to detect what
|
||||
caused rollup. -->
|
||||
<field name="_isHiding">false</field>
|
||||
|
||||
<method name="updateHeader">
|
||||
<body><![CDATA[
|
||||
let currentEngine = Services.search.currentEngine;
|
||||
|
@ -1264,6 +1270,13 @@
|
|||
installCallback);
|
||||
}
|
||||
]]></handler>
|
||||
|
||||
<handler event="popuphiding"><![CDATA[
|
||||
this._isHiding = true;
|
||||
setTimeout(() => {
|
||||
this._isHiding = false;
|
||||
}, 0);
|
||||
]]></handler>
|
||||
</handlers>
|
||||
</binding>
|
||||
|
||||
|
|
|
@ -678,6 +678,7 @@
|
|||
]]></destructor>
|
||||
|
||||
<field name="_ignoreFocus">false</field>
|
||||
<field name="_clickClosedPopup">false</field>
|
||||
|
||||
<method name="rebuildPopup">
|
||||
<body><![CDATA[
|
||||
|
@ -749,6 +750,13 @@
|
|||
this.openSuggestionsPanel();
|
||||
]]></handler>
|
||||
|
||||
<handler event="mousedown" phase="capturing">
|
||||
<![CDATA[
|
||||
if (event.originalTarget.getAttribute("anonid") == "searchbar-search-button") {
|
||||
this._clickClosedPopup = this._textbox.popup._isHiding;
|
||||
}
|
||||
]]></handler>
|
||||
|
||||
<handler event="click" button="0">
|
||||
<![CDATA[
|
||||
// Ignore clicks on the search go button.
|
||||
|
@ -756,10 +764,16 @@
|
|||
return;
|
||||
}
|
||||
|
||||
let isIconClick = event.originalTarget.getAttribute("anonid") == "searchbar-search-button";
|
||||
|
||||
// Ignore clicks on the icon if they were made to close the popup
|
||||
if (isIconClick && this._clickClosedPopup) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Open the suggestions whenever clicking on the search icon or if there
|
||||
// is text in the textbox.
|
||||
if (event.originalTarget.getAttribute("anonid") == "searchbar-search-button" ||
|
||||
this._textbox.value) {
|
||||
if (isIconClick || this._textbox.value) {
|
||||
this.openSuggestionsPanel(true);
|
||||
}
|
||||
]]></handler>
|
||||
|
|
|
@ -7,6 +7,23 @@ const goButton = document.getAnonymousElementByAttribute(searchbar, "anonid", "s
|
|||
const textbox = searchbar._textbox;
|
||||
const searchPopup = document.getElementById("PopupSearchAutoComplete");
|
||||
|
||||
const isWindows = Services.appinfo.OS == "WINNT";
|
||||
const mouseDown = isWindows ? 2 : 1;
|
||||
const mouseUp = isWindows ? 4 : 2;
|
||||
const utils = window.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindowUtils);
|
||||
const scale = utils.screenPixelsPerCSSPixel;
|
||||
|
||||
function synthesizeNativeMouseClick(aElement) {
|
||||
let rect = aElement.getBoundingClientRect();
|
||||
let win = aElement.ownerDocument.defaultView;
|
||||
let x = win.mozInnerScreenX + (rect.left + rect.right) / 2;
|
||||
let y = win.mozInnerScreenY + (rect.top + rect.bottom) / 2;
|
||||
|
||||
utils.sendNativeMouseEvent(x * scale, y * scale, mouseDown, 0, null);
|
||||
utils.sendNativeMouseEvent(x * scale, y * scale, mouseUp, 0, null);
|
||||
}
|
||||
|
||||
function promiseNewEngine(basename) {
|
||||
return new Promise((resolve, reject) => {
|
||||
info("Waiting for engine to be added: " + basename);
|
||||
|
@ -77,6 +94,7 @@ add_no_popup_task(function* open_icon_context() {
|
|||
});
|
||||
|
||||
// With no text in the search box left clicking the icon should open the popup.
|
||||
// Clicking the icon again should hide the popup and not show it again.
|
||||
add_task(function* open_empty() {
|
||||
gURLBar.focus();
|
||||
|
||||
|
@ -85,11 +103,27 @@ add_task(function* open_empty() {
|
|||
EventUtils.synthesizeMouseAtCenter(searchIcon, {});
|
||||
yield promise;
|
||||
is(searchPopup.getAttribute("showonlysettings"), "true", "Should only show the settings");
|
||||
is(textbox.mController.searchString, "", "Should be an empty search string");
|
||||
|
||||
// By giving the textbox some text any next attempt to open the search popup
|
||||
// from the click handler will try to search for this text.
|
||||
textbox.value = "foo";
|
||||
|
||||
promise = promiseEvent(searchPopup, "popuphidden");
|
||||
let clickPromise = promiseEvent(searchIcon, "click");
|
||||
|
||||
info("Hiding popup");
|
||||
searchPopup.hidePopup();
|
||||
synthesizeNativeMouseClick(searchIcon);
|
||||
yield promise;
|
||||
|
||||
is(textbox.mController.searchString, "", "Should not have started to search for the new text");
|
||||
|
||||
// Cancel the search if it started.
|
||||
if (textbox.mController.searchString != "") {
|
||||
textbox.mController.stopSearch();
|
||||
}
|
||||
|
||||
textbox.value = "";
|
||||
});
|
||||
|
||||
// With no text in the search box left clicking it should not open the popup.
|
||||
|
@ -223,29 +257,6 @@ add_no_popup_task(function* tab_doesnt_open_popup() {
|
|||
textbox.value = "";
|
||||
});
|
||||
|
||||
// Clicks outside the search popup should close the popup but not consume the click.
|
||||
add_task(function* dont_consume_clicks() {
|
||||
gURLBar.focus();
|
||||
textbox.value = "foo";
|
||||
|
||||
let promise = promiseEvent(searchPopup, "popupshown");
|
||||
EventUtils.synthesizeMouseAtCenter(textbox, {});
|
||||
yield promise;
|
||||
isnot(searchPopup.getAttribute("showonlysettings"), "true", "Should show the full popup");
|
||||
|
||||
is(Services.focus.focusedElement, textbox.inputField, "Should have focused the search bar");
|
||||
is(textbox.selectionStart, 0, "Should have selected all of the text");
|
||||
is(textbox.selectionEnd, 3, "Should have selected all of the text");
|
||||
|
||||
promise = promiseEvent(searchPopup, "popuphidden");
|
||||
EventUtils.synthesizeMouseAtCenter(gURLBar, {});
|
||||
yield promise;
|
||||
|
||||
is(Services.focus.focusedElement, gURLBar.inputField, "Should have focused the URL bar");
|
||||
|
||||
textbox.value = "";
|
||||
});
|
||||
|
||||
// Switching back to the window when the search box has focus from mouse should not open the popup.
|
||||
add_task(function* refocus_window_doesnt_open_popup_mouse() {
|
||||
gURLBar.focus();
|
||||
|
@ -335,3 +346,26 @@ add_no_popup_task(function* search_go_doesnt_open_popup() {
|
|||
textbox.value = "";
|
||||
gBrowser.removeCurrentTab();
|
||||
});
|
||||
|
||||
// Clicks outside the search popup should close the popup but not consume the click.
|
||||
add_task(function* dont_consume_clicks() {
|
||||
gURLBar.focus();
|
||||
textbox.value = "foo";
|
||||
|
||||
let promise = promiseEvent(searchPopup, "popupshown");
|
||||
EventUtils.synthesizeMouseAtCenter(textbox, {});
|
||||
yield promise;
|
||||
isnot(searchPopup.getAttribute("showonlysettings"), "true", "Should show the full popup");
|
||||
|
||||
is(Services.focus.focusedElement, textbox.inputField, "Should have focused the search bar");
|
||||
is(textbox.selectionStart, 0, "Should have selected all of the text");
|
||||
is(textbox.selectionEnd, 3, "Should have selected all of the text");
|
||||
|
||||
promise = promiseEvent(searchPopup, "popuphidden");
|
||||
synthesizeNativeMouseClick(gURLBar);
|
||||
yield promise;
|
||||
|
||||
is(Services.focus.focusedElement, gURLBar.inputField, "Should have focused the URL bar");
|
||||
|
||||
textbox.value = "";
|
||||
});
|
||||
|
|
|
@ -28,29 +28,8 @@
|
|||
<toolbarbutton id="record-button"
|
||||
class="devtools-toolbarbutton"
|
||||
tooltiptext="&profilerUI.recordButton.tooltip;"/>
|
||||
<toolbarbutton id="clear-button"
|
||||
class="devtools-toolbarbutton"
|
||||
label="&profilerUI.clearButton;"/>
|
||||
</hbox>
|
||||
<spacer flex="1"></spacer>
|
||||
<hbox id="performance-toolbar-controls-storage" class="devtools-toolbarbutton-group">
|
||||
<toolbarbutton id="import-button"
|
||||
class="devtools-toolbarbutton"
|
||||
label="&profilerUI.importButton;"/>
|
||||
<toolbarbutton id="export-button"
|
||||
class="devtools-toolbarbutton"
|
||||
label="&profilerUI.exportButton;"/>
|
||||
</hbox>
|
||||
</toolbar>
|
||||
|
||||
<vbox id="overview-pane">
|
||||
<hbox id="markers-overview"/>
|
||||
<hbox id="memory-overview"/>
|
||||
<hbox id="time-framerate"/>
|
||||
</vbox>
|
||||
|
||||
<toolbar id="details-toolbar" class="devtools-toolbar">
|
||||
<hbox class="devtools-toolbarbutton-group">
|
||||
<hbox id="performance-toolbar-controls-detail-views" class="devtools-toolbarbutton-group">
|
||||
<toolbarbutton id="select-waterfall-view"
|
||||
class="devtools-toolbarbutton"
|
||||
data-view="waterfall" />
|
||||
|
@ -61,11 +40,30 @@
|
|||
class="devtools-toolbarbutton"
|
||||
data-view="flamegraph" />
|
||||
</hbox>
|
||||
<spacer flex="1"></spacer>
|
||||
<hbox id="performance-toolbar-controls-storage" class="devtools-toolbarbutton-group">
|
||||
<toolbarbutton id="import-button"
|
||||
class="devtools-toolbarbutton"
|
||||
label="&profilerUI.importButton;"/>
|
||||
<toolbarbutton id="export-button"
|
||||
class="devtools-toolbarbutton"
|
||||
label="&profilerUI.exportButton;"/>
|
||||
<toolbarbutton id="clear-button"
|
||||
class="devtools-toolbarbutton"
|
||||
label="&profilerUI.clearButton;"/>
|
||||
</hbox>
|
||||
</toolbar>
|
||||
|
||||
<vbox id="overview-pane">
|
||||
<hbox id="markers-overview"/>
|
||||
<hbox id="memory-overview"/>
|
||||
<hbox id="time-framerate"/>
|
||||
</vbox>
|
||||
|
||||
<deck id="details-pane" flex="1">
|
||||
|
||||
<hbox id="waterfall-view" flex="1">
|
||||
<vbox id="waterfall-graph" flex="1" />
|
||||
<vbox id="waterfall-breakdown" flex="1" />
|
||||
<splitter class="devtools-side-splitter"/>
|
||||
<vbox id="waterfall-details"
|
||||
class="theme-sidebar"
|
||||
|
|
|
@ -16,26 +16,26 @@ let WaterfallView = {
|
|||
this._onMarkerSelected = this._onMarkerSelected.bind(this);
|
||||
this._onResize = this._onResize.bind(this);
|
||||
|
||||
this.graph = new Waterfall($("#waterfall-graph"), $("#details-pane"), TIMELINE_BLUEPRINT);
|
||||
this.markerDetails = new MarkerDetails($("#waterfall-details"), $("#waterfall-view > splitter"));
|
||||
this.waterfall = new Waterfall($("#waterfall-breakdown"), $("#details-pane"), TIMELINE_BLUEPRINT);
|
||||
this.details = new MarkerDetails($("#waterfall-details"), $("#waterfall-view > splitter"));
|
||||
|
||||
this.graph.on("selected", this._onMarkerSelected);
|
||||
this.graph.on("unselected", this._onMarkerSelected);
|
||||
this.markerDetails.on("resize", this._onResize);
|
||||
this.waterfall.on("selected", this._onMarkerSelected);
|
||||
this.waterfall.on("unselected", this._onMarkerSelected);
|
||||
this.details.on("resize", this._onResize);
|
||||
|
||||
PerformanceController.on(EVENTS.RECORDING_STARTED, this._onRecordingStarted);
|
||||
PerformanceController.on(EVENTS.RECORDING_STOPPED, this._onRecordingStopped);
|
||||
|
||||
this.graph.recalculateBounds();
|
||||
this.waterfall.recalculateBounds();
|
||||
}),
|
||||
|
||||
/**
|
||||
* Unbinds events.
|
||||
*/
|
||||
destroy: function () {
|
||||
this.graph.off("selected", this._onMarkerSelected);
|
||||
this.graph.off("unselected", this._onMarkerSelected);
|
||||
this.markerDetails.off("resize", this._onResize);
|
||||
this.waterfall.off("selected", this._onMarkerSelected);
|
||||
this.waterfall.off("unselected", this._onMarkerSelected);
|
||||
this.details.off("resize", this._onResize);
|
||||
|
||||
PerformanceController.off(EVENTS.RECORDING_STARTED, this._onRecordingStarted);
|
||||
PerformanceController.off(EVENTS.RECORDING_STOPPED, this._onRecordingStopped);
|
||||
|
@ -48,7 +48,8 @@ let WaterfallView = {
|
|||
let { startTime, endTime } = PerformanceController.getInterval();
|
||||
let markers = PerformanceController.getMarkers();
|
||||
|
||||
this.graph.setData(markers, startTime, startTime, endTime);
|
||||
this.waterfall.setData(markers, startTime, startTime, endTime);
|
||||
|
||||
this.emit(EVENTS.WATERFALL_RENDERED);
|
||||
},
|
||||
|
||||
|
@ -56,7 +57,7 @@ let WaterfallView = {
|
|||
* Called when recording starts.
|
||||
*/
|
||||
_onRecordingStarted: function () {
|
||||
this.graph.clearView();
|
||||
this.waterfall.clearView();
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -72,14 +73,14 @@ let WaterfallView = {
|
|||
*/
|
||||
_onMarkerSelected: function (event, marker) {
|
||||
if (event === "selected") {
|
||||
this.markerDetails.render({
|
||||
this.details.render({
|
||||
toolbox: gToolbox,
|
||||
marker: marker,
|
||||
frames: PerformanceController.getFrames()
|
||||
});
|
||||
}
|
||||
if (event === "unselected") {
|
||||
this.markerDetails.empty();
|
||||
this.details.empty();
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -87,7 +88,7 @@ let WaterfallView = {
|
|||
* Called when the marker details view is resized.
|
||||
*/
|
||||
_onResize: function () {
|
||||
this.graph.recalculateBounds();
|
||||
this.waterfall.recalculateBounds();
|
||||
this.render();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -24,10 +24,11 @@ let DetailsView = {
|
|||
*/
|
||||
initialize: Task.async(function *() {
|
||||
this.el = $("#details-pane");
|
||||
this.toolbar = $("#performance-toolbar-controls-detail-views");
|
||||
|
||||
this._onViewToggle = this._onViewToggle.bind(this);
|
||||
|
||||
for (let button of $$("toolbarbutton[data-view]", $("#details-toolbar"))) {
|
||||
for (let button of $$("toolbarbutton[data-view]", this.toolbar)) {
|
||||
button.addEventListener("command", this._onViewToggle);
|
||||
}
|
||||
|
||||
|
@ -42,7 +43,7 @@ let DetailsView = {
|
|||
* Unbinds events, destroys subviews.
|
||||
*/
|
||||
destroy: Task.async(function *() {
|
||||
for (let button of $$("toolbarbutton[data-view]", $("#details-toolbar"))) {
|
||||
for (let button of $$("toolbarbutton[data-view]", this.toolbar)) {
|
||||
button.removeEventListener("command", this._onViewToggle);
|
||||
}
|
||||
|
||||
|
@ -61,7 +62,7 @@ let DetailsView = {
|
|||
selectView: function (selectedView) {
|
||||
this.el.selectedIndex = this.viewIndexes[selectedView];
|
||||
|
||||
for (let button of $$("toolbarbutton[data-view]", $("#details-toolbar"))) {
|
||||
for (let button of $$("toolbarbutton[data-view]", this.toolbar)) {
|
||||
if (button.getAttribute("data-view") === selectedView) {
|
||||
button.setAttribute("checked", true);
|
||||
} else {
|
||||
|
|
|
@ -11,10 +11,10 @@ const OVERVIEW_UPDATE_INTERVAL = 200; // ms
|
|||
const FRAMERATE_GRAPH_LOW_RES_INTERVAL = 100; // ms
|
||||
const FRAMERATE_GRAPH_HIGH_RES_INTERVAL = 16; // ms
|
||||
|
||||
const FRAMERATE_GRAPH_HEIGHT = 45; // px
|
||||
const FRAMERATE_GRAPH_HEIGHT = 40; // px
|
||||
const MARKERS_GRAPH_HEADER_HEIGHT = 14; // px
|
||||
const MARKERS_GRAPH_ROW_HEIGHT = 11; // px
|
||||
const MARKERS_GROUP_VERTICAL_PADDING = 5; // px
|
||||
const MARKERS_GRAPH_ROW_HEIGHT = 10; // px
|
||||
const MARKERS_GROUP_VERTICAL_PADDING = 4; // px
|
||||
const MEMORY_GRAPH_HEIGHT = 30; // px
|
||||
|
||||
const GRAPH_SCROLL_EVENTS_DRAIN = 50; // ms
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
// Tests that text metrics in the flame graph widget work properly.
|
||||
|
||||
let HTML_NS = "http://www.w3.org/1999/xhtml";
|
||||
let FLAME_GRAPH_BLOCK_TEXT_FONT_SIZE = 9; // px
|
||||
let FLAME_GRAPH_BLOCK_TEXT_FONT_SIZE = 8; // px
|
||||
let FLAME_GRAPH_BLOCK_TEXT_FONT_FAMILY = "sans-serif";
|
||||
let {ViewHelpers} = Cu.import("resource:///modules/devtools/ViewHelpers.jsm", {});
|
||||
let {FlameGraph} = Cu.import("resource:///modules/devtools/FlameGraph.jsm", {});
|
||||
|
@ -38,28 +38,33 @@ function testGraph(graph) {
|
|||
is(graph._overflowCharWidth, getCharWidth(L10N.ellipsis),
|
||||
"The ellipsis char width was calculated correctly.");
|
||||
|
||||
is(graph._getTextWidthApprox("This text is maybe overflowing"),
|
||||
getAverageCharWidth() * 30,
|
||||
let text = "This text is maybe overflowing";
|
||||
let text1000px = graph._getFittedText(text, 1000);
|
||||
let text50px = graph._getFittedText(text, 50);
|
||||
let text10px = graph._getFittedText(text, 10);
|
||||
let text1px = graph._getFittedText(text, 1);
|
||||
|
||||
is(graph._getTextWidthApprox(text), getAverageCharWidth() * text.length,
|
||||
"The approximate width was calculated correctly.");
|
||||
|
||||
is(graph._getFittedText("This text is maybe overflowing", 1000),
|
||||
"This text is maybe overflowing",
|
||||
info("Text at 1000px width: " + text1000px);
|
||||
info("Text at 50px width : " + text50px);
|
||||
info("Text at 10px width : " + text10px);
|
||||
info("Text at 1px width : " + text1px);
|
||||
|
||||
is(text1000px, text,
|
||||
"The fitted text for 1000px width is correct.");
|
||||
|
||||
isnot(graph._getFittedText("This text is maybe overflowing", 100),
|
||||
"This text is maybe overflowing",
|
||||
"The fitted text for 100px width is correct (1).");
|
||||
isnot(text50px, text,
|
||||
"The fitted text for 50px width is correct (1).");
|
||||
|
||||
ok(graph._getFittedText("This text is maybe overflowing", 100)
|
||||
.contains(L10N.ellipsis),
|
||||
"The fitted text for 100px width is correct (2).");
|
||||
ok(text50px.contains(L10N.ellipsis),
|
||||
"The fitted text for 50px width is correct (2).");
|
||||
|
||||
is(graph._getFittedText("This text is maybe overflowing", 10),
|
||||
L10N.ellipsis,
|
||||
is(graph._getFittedText(text, 10), L10N.ellipsis,
|
||||
"The fitted text for 10px width is correct.");
|
||||
|
||||
is(graph._getFittedText("This text is maybe overflowing", 1),
|
||||
"",
|
||||
is(graph._getFittedText(text, 1), "",
|
||||
"The fitted text for 1px width is correct.");
|
||||
}
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ let EXPECTED_OUTPUT = [{
|
|||
x: 50,
|
||||
y: 0,
|
||||
width: 410,
|
||||
height: 12,
|
||||
height: 11,
|
||||
text: "A"
|
||||
}]
|
||||
}, {
|
||||
|
@ -121,9 +121,9 @@ let EXPECTED_OUTPUT = [{
|
|||
rawLocation: "B"
|
||||
},
|
||||
x: 50,
|
||||
y: 12,
|
||||
y: 11,
|
||||
width: 160,
|
||||
height: 12,
|
||||
height: 11,
|
||||
text: "B"
|
||||
}, {
|
||||
srcData: {
|
||||
|
@ -131,9 +131,9 @@ let EXPECTED_OUTPUT = [{
|
|||
rawLocation: "B"
|
||||
},
|
||||
x: 330,
|
||||
y: 12,
|
||||
y: 11,
|
||||
width: 130,
|
||||
height: 12,
|
||||
height: 11,
|
||||
text: "B"
|
||||
}]
|
||||
}, {
|
||||
|
@ -145,7 +145,7 @@ let EXPECTED_OUTPUT = [{
|
|||
x: 0,
|
||||
y: 0,
|
||||
width: 50,
|
||||
height: 12,
|
||||
height: 11,
|
||||
text: "M"
|
||||
}, {
|
||||
srcData: {
|
||||
|
@ -153,9 +153,9 @@ let EXPECTED_OUTPUT = [{
|
|||
rawLocation: "C"
|
||||
},
|
||||
x: 50,
|
||||
y: 24,
|
||||
y: 22,
|
||||
width: 50,
|
||||
height: 12,
|
||||
height: 11,
|
||||
text: "C"
|
||||
}, {
|
||||
srcData: {
|
||||
|
@ -163,9 +163,9 @@ let EXPECTED_OUTPUT = [{
|
|||
rawLocation: "C"
|
||||
},
|
||||
x: 330,
|
||||
y: 24,
|
||||
y: 22,
|
||||
width: 130,
|
||||
height: 12,
|
||||
height: 11,
|
||||
text: "C"
|
||||
}]
|
||||
}, {
|
||||
|
@ -175,9 +175,9 @@ let EXPECTED_OUTPUT = [{
|
|||
rawLocation: "N"
|
||||
},
|
||||
x: 0,
|
||||
y: 12,
|
||||
y: 11,
|
||||
width: 50,
|
||||
height: 12,
|
||||
height: 11,
|
||||
text: "N"
|
||||
}, {
|
||||
srcData: {
|
||||
|
@ -185,9 +185,9 @@ let EXPECTED_OUTPUT = [{
|
|||
rawLocation: "D"
|
||||
},
|
||||
x: 100,
|
||||
y: 24,
|
||||
y: 22,
|
||||
width: 110,
|
||||
height: 12,
|
||||
height: 11,
|
||||
text: "D"
|
||||
}, {
|
||||
srcData: {
|
||||
|
@ -197,7 +197,7 @@ let EXPECTED_OUTPUT = [{
|
|||
x: 460,
|
||||
y: 0,
|
||||
width: 40,
|
||||
height: 12,
|
||||
height: 11,
|
||||
text: "X"
|
||||
}]
|
||||
}, {
|
||||
|
@ -207,9 +207,9 @@ let EXPECTED_OUTPUT = [{
|
|||
rawLocation: "E"
|
||||
},
|
||||
x: 210,
|
||||
y: 12,
|
||||
y: 11,
|
||||
width: 120,
|
||||
height: 12,
|
||||
height: 11,
|
||||
text: "E"
|
||||
}, {
|
||||
srcData: {
|
||||
|
@ -217,9 +217,9 @@ let EXPECTED_OUTPUT = [{
|
|||
rawLocation: "Y"
|
||||
},
|
||||
x: 460,
|
||||
y: 12,
|
||||
y: 11,
|
||||
width: 40,
|
||||
height: 12,
|
||||
height: 11,
|
||||
text: "Y"
|
||||
}]
|
||||
}, {
|
||||
|
@ -229,9 +229,9 @@ let EXPECTED_OUTPUT = [{
|
|||
rawLocation: "P"
|
||||
},
|
||||
x: 0,
|
||||
y: 24,
|
||||
y: 22,
|
||||
width: 50,
|
||||
height: 12,
|
||||
height: 11,
|
||||
text: "P"
|
||||
}, {
|
||||
srcData: {
|
||||
|
@ -239,9 +239,9 @@ let EXPECTED_OUTPUT = [{
|
|||
rawLocation: "F"
|
||||
},
|
||||
x: 210,
|
||||
y: 24,
|
||||
y: 22,
|
||||
width: 120,
|
||||
height: 12,
|
||||
height: 11,
|
||||
text: "F"
|
||||
}, {
|
||||
srcData: {
|
||||
|
@ -249,9 +249,9 @@ let EXPECTED_OUTPUT = [{
|
|||
rawLocation: "Z"
|
||||
},
|
||||
x: 460,
|
||||
y: 24,
|
||||
y: 22,
|
||||
width: 40,
|
||||
height: 12,
|
||||
height: 11,
|
||||
text: "Z"
|
||||
}]
|
||||
}, {
|
||||
|
|
|
@ -29,7 +29,7 @@ const GRAPH_MIN_SELECTION_WIDTH = 10; // ms
|
|||
const TIMELINE_TICKS_MULTIPLE = 5; // ms
|
||||
const TIMELINE_TICKS_SPACING_MIN = 75; // px
|
||||
|
||||
const OVERVIEW_HEADER_HEIGHT = 18; // px
|
||||
const OVERVIEW_HEADER_HEIGHT = 16; // px
|
||||
const OVERVIEW_HEADER_SAFE_BOUNDS = 50; // px
|
||||
const OVERVIEW_HEADER_TEXT_COLOR = "#18191a";
|
||||
const OVERVIEW_HEADER_TEXT_FONT_SIZE = 9; // px
|
||||
|
@ -40,9 +40,9 @@ const OVERVIEW_TIMELINE_STROKES = "#ddd";
|
|||
|
||||
const FLAME_GRAPH_BLOCK_BORDER = 1; // px
|
||||
const FLAME_GRAPH_BLOCK_TEXT_COLOR = "#000";
|
||||
const FLAME_GRAPH_BLOCK_TEXT_FONT_SIZE = 9; // px
|
||||
const FLAME_GRAPH_BLOCK_TEXT_FONT_SIZE = 8; // px
|
||||
const FLAME_GRAPH_BLOCK_TEXT_FONT_FAMILY = "sans-serif";
|
||||
const FLAME_GRAPH_BLOCK_TEXT_PADDING_TOP = 1; // px
|
||||
const FLAME_GRAPH_BLOCK_TEXT_PADDING_TOP = 0; // px
|
||||
const FLAME_GRAPH_BLOCK_TEXT_PADDING_LEFT = 3; // px
|
||||
const FLAME_GRAPH_BLOCK_TEXT_PADDING_RIGHT = 3; // px
|
||||
|
||||
|
@ -799,7 +799,7 @@ FlameGraph.prototype = {
|
|||
}
|
||||
};
|
||||
|
||||
const FLAME_GRAPH_BLOCK_HEIGHT = 12; // px
|
||||
const FLAME_GRAPH_BLOCK_HEIGHT = 11; // px
|
||||
|
||||
const PALLETTE_SIZE = 10;
|
||||
const PALLETTE_HUE_OFFSET = Math.random() * 90;
|
||||
|
|
|
@ -240,7 +240,7 @@ MarkersOverview.prototype = Heritage.extend(AbstractCanvasGraph.prototype, {
|
|||
this.selectionStripesColor = setAlpha("#fff", 0.1);
|
||||
this.headerBackgroundColor = getColor("body-background", theme);
|
||||
this.headerTextColor = getColor("body-color", theme);
|
||||
this.headerTimelineStrokeColor = setAlpha(getColor("body-color-alt", theme), 0.1);
|
||||
this.headerTimelineStrokeColor = setAlpha(getColor("body-color-alt", theme), 0.25);
|
||||
this.alternatingBackgroundColor = setAlpha(getColor("body-color", theme), 0.05);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -276,7 +276,8 @@
|
|||
}
|
||||
|
||||
.waterfall-header-name {
|
||||
padding: 4px;
|
||||
padding: 2px 4px;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
.waterfall-header-tick {
|
||||
|
|
|
@ -59,6 +59,8 @@ import org.mozilla.gecko.home.SearchEngine;
|
|||
import org.mozilla.gecko.menu.GeckoMenu;
|
||||
import org.mozilla.gecko.menu.GeckoMenuItem;
|
||||
import org.mozilla.gecko.mozglue.ContextUtils;
|
||||
import org.mozilla.gecko.mozglue.ContextUtils.SafeIntent;
|
||||
import org.mozilla.gecko.mozglue.RobocopTarget;
|
||||
import org.mozilla.gecko.preferences.ClearOnShutdownPref;
|
||||
import org.mozilla.gecko.preferences.GeckoPreferences;
|
||||
import org.mozilla.gecko.prompts.Prompt;
|
||||
|
@ -170,6 +172,9 @@ public class BrowserApp extends GeckoApp
|
|||
// Request ID for startActivityForResult.
|
||||
private static final int ACTIVITY_REQUEST_PREFERENCES = 1001;
|
||||
|
||||
@RobocopTarget
|
||||
public static final String EXTRA_SKIP_STARTPANE = "skipstartpane";
|
||||
|
||||
public static final String PREF_STARTPANE_ENABLED = "startpane_enabled";
|
||||
|
||||
private BrowserSearch mBrowserSearch;
|
||||
|
@ -682,20 +687,26 @@ public class BrowserApp extends GeckoApp
|
|||
}
|
||||
|
||||
/**
|
||||
* Check and show Onboarding start pane if Firefox has never been launched and
|
||||
* Check and show onboarding start pane if the browser has never been launched and
|
||||
* is not opening an external link from another application.
|
||||
*
|
||||
* @param context Context of application; used to show Start Pane if appropriate
|
||||
* @param intentAction Intent that launched this activity
|
||||
* @param intent Intent that launched this activity
|
||||
*/
|
||||
private void checkStartPane(Context context, String intentAction) {
|
||||
private void checkStartPane(Context context, SafeIntent intent) {
|
||||
if (intent.getBooleanExtra(EXTRA_SKIP_STARTPANE, false)) {
|
||||
// Note that we don't set the pref, so subsequent launches can result
|
||||
// in the start pane being shown.
|
||||
return;
|
||||
}
|
||||
|
||||
final StrictMode.ThreadPolicy savedPolicy = StrictMode.allowThreadDiskReads();
|
||||
|
||||
try {
|
||||
final SharedPreferences prefs = GeckoSharedPrefs.forProfile(this);
|
||||
|
||||
if (prefs.getBoolean(PREF_STARTPANE_ENABLED, false)) {
|
||||
if (!Intent.ACTION_VIEW.equals(intentAction)) {
|
||||
if (!Intent.ACTION_VIEW.equals(intent.getAction())) {
|
||||
final DialogFragment dialog = new StartPane();
|
||||
dialog.show(getSupportFragmentManager(), ONBOARD_STARTPANE_TAG);
|
||||
}
|
||||
|
@ -741,8 +752,8 @@ public class BrowserApp extends GeckoApp
|
|||
|
||||
@Override
|
||||
public void onAttachedToWindow() {
|
||||
// We can't show Onboarding until Gecko has finished initialization (bug 1077583).
|
||||
checkStartPane(this, getIntent().getAction());
|
||||
// We can't show the first run experience until Gecko has finished initialization (bug 1077583).
|
||||
checkStartPane(this, new SafeIntent(getIntent()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -16,6 +16,7 @@ import org.json.JSONArray;
|
|||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.mozilla.gecko.Actions;
|
||||
import org.mozilla.gecko.BrowserApp;
|
||||
import org.mozilla.gecko.Driver;
|
||||
import org.mozilla.gecko.Element;
|
||||
import org.mozilla.gecko.FennecNativeActions;
|
||||
|
@ -25,7 +26,6 @@ import org.mozilla.gecko.GeckoEvent;
|
|||
import org.mozilla.gecko.GeckoProfile;
|
||||
import org.mozilla.gecko.GeckoThread;
|
||||
import org.mozilla.gecko.GeckoThread.LaunchState;
|
||||
import org.mozilla.gecko.NewTabletUI;
|
||||
import org.mozilla.gecko.R;
|
||||
import org.mozilla.gecko.RobocopUtils;
|
||||
import org.mozilla.gecko.Tab;
|
||||
|
@ -113,7 +113,12 @@ abstract class BaseTest extends BaseRobocopTest {
|
|||
// Create the intent to be used with all the important arguments.
|
||||
Intent i = new Intent(Intent.ACTION_MAIN);
|
||||
mProfile = mConfig.get("profile");
|
||||
|
||||
// Don't show the first run experience.
|
||||
i.putExtra(BrowserApp.EXTRA_SKIP_STARTPANE, true);
|
||||
|
||||
i.putExtra("args", "-no-remote -profile " + mProfile);
|
||||
|
||||
String envString = mConfig.get("envvars");
|
||||
if (envString != "") {
|
||||
String[] envStrings = envString.split(",");
|
||||
|
|
|
@ -8,6 +8,7 @@ import java.util.Map;
|
|||
|
||||
import org.mozilla.gecko.Actions;
|
||||
import org.mozilla.gecko.Assert;
|
||||
import org.mozilla.gecko.BrowserApp;
|
||||
import org.mozilla.gecko.Driver;
|
||||
import org.mozilla.gecko.FennecNativeActions;
|
||||
import org.mozilla.gecko.FennecNativeDriver;
|
||||
|
@ -193,6 +194,9 @@ abstract class UITest extends BaseRobocopTest
|
|||
private static Intent createActivityIntent(final Map<String, String> config) {
|
||||
final Intent intent = new Intent(Intent.ACTION_MAIN);
|
||||
|
||||
// Don't show the first run experience.
|
||||
intent.putExtra(BrowserApp.EXTRA_SKIP_STARTPANE, true);
|
||||
|
||||
final String profile = config.get("profile");
|
||||
intent.putExtra("args", "-no-remote -profile " + profile);
|
||||
|
||||
|
|
|
@ -353,7 +353,7 @@ class OSXBootstrapper(BaseBootstrapper):
|
|||
def suggest_homebrew_mobile_android_mozconfig(self):
|
||||
import android
|
||||
# We could probably fish this path from |brew info android-sdk|.
|
||||
sdk_path = '/usr/local/opt/android-sdk/platform/%s' % android.ANDROID_PLATFORM
|
||||
sdk_path = '/usr/local/opt/android-sdk/platforms/%s' % android.ANDROID_PLATFORM
|
||||
ndk_path = '/usr/local/opt/android-ndk'
|
||||
android.suggest_mozconfig(sdk_path=sdk_path, ndk_path=ndk_path)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче