Skip to content

Commit

Permalink
Merge autoland to mozilla-central. a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
SV-ACiure committed Apr 11, 2018
2 parents 873d562 + 686d95c commit cc3eafe
Show file tree
Hide file tree
Showing 262 changed files with 11,301 additions and 8,867 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ skip-if = (os == 'win' && !debug) # bug 1352668
[browser_ext_commands_getAll.js]
[browser_ext_commands_onCommand.js]
[browser_ext_commands_update.js]
[browser_ext_connect_and_move_tabs.js]
[browser_ext_contentscript_connect.js]
[browser_ext_contextMenus.js]
[browser_ext_contextMenus_checkboxes.js]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";

// Tests that the Port object created by browser.runtime.connect is not
// prematurely disconnected as the underlying message managers change when a
// tab is moved between windows.

function loadExtension() {
return ExtensionTestUtils.loadExtension({
manifest: {
"content_scripts": [{
"js": ["script.js"],
"matches": ["http://mochi.test/"],
}],
},
background() {
browser.runtime.onConnect.addListener((port) => {
port.onDisconnect.addListener(() => {
browser.test.fail("onDisconnect should not fire because the port is to be closed from this side");
browser.test.sendMessage("port_disconnected");
});
port.onMessage.addListener(async msg => {
browser.test.assertEq("connect_from_contentscript", msg, "expected message");
// Move a tab to a new window and back. Regression test for bugzil.la/1448674
let {windowId, id: tabId, index} = port.sender.tab;
await browser.windows.create({tabId});
await browser.tabs.move(tabId, {index, windowId});
await browser.windows.create({tabId});
await browser.tabs.move(tabId, {index, windowId});
try {
// When the port is unexpectedly disconnected, postMessage will throw an error.
port.postMessage("ping");
} catch (e) {
browser.test.fail(`Error: ${e} :: ${e.stack}`);
browser.test.sendMessage("port_ping_ponged_before_disconnect");
}
});

browser.runtime.onMessage.addListener((msg, sender) => {
browser.test.assertEq("disconnect-me", msg, "expected message");
port.disconnect();
// Now port.onDisconnect should fire in the content script.
});
});

browser.test.onMessage.addListener(msg => {
browser.test.assertEq("open_extension_tab", msg, "expected message");
browser.tabs.create({url: "tab.html"});
});
},

files: {
"tab.html": `
<!DOCTYPE html><meta charset="utf-8">
<script src="script.js"></script>
`,
"script.js": function() {
let port = browser.runtime.connect();
port.onMessage.addListener(msg => {
browser.test.assertEq("ping", msg, "expected message");
browser.test.sendMessage("port_ping_ponged_before_disconnect");
port.onDisconnect.addListener(() => {
browser.test.sendMessage("port_disconnected");
});
browser.runtime.sendMessage("disconnect-me");
});
port.postMessage("connect_from_contentscript");
},
},
});
}

add_task(async function contentscript_connect_and_move_tabs() {
let extension = loadExtension();
await extension.startup();
await BrowserTestUtils.openNewForegroundTab(gBrowser, "http://mochi.test:8888/");
await extension.awaitMessage("port_ping_ponged_before_disconnect");
await extension.awaitMessage("port_disconnected");
// Must use gBrowser.selectedTab instead of the return value of
// BrowserTestUtils.openNewForegroundTab because the latter does not refer to
// the tab because the tab is moved between windows during the test.
await BrowserTestUtils.removeTab(gBrowser.selectedTab);
await extension.unload();
});

add_task(async function extension_tab_connect_and_move_tabs() {
let extension = loadExtension();
await extension.startup();
extension.sendMessage("open_extension_tab");
await extension.awaitMessage("port_ping_ponged_before_disconnect");
await extension.awaitMessage("port_disconnected");
// Upon unloading the extension, the extension tab is automatically removed.
await extension.unload();
});
18 changes: 15 additions & 3 deletions build/unix/build-gcc/build-gcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,15 @@ prepare() {
tar() { :; }
sed() { :; }
wget() {
echo $1
# Get last argument given to wget.
eval echo \$$# >&3
}

# In GCC >= 7, the download_prerequisites script tried to do its own
# verification, but we have ours, so disable it.
set -- --no-verify
. ./contrib/download_prerequisites
) | while read url; do
) 3>&1 > /dev/null | while read url; do
file=$(basename $url)
case "$file" in
gmp-*.tar.*)
Expand All @@ -49,7 +53,15 @@ prepare() {
mpc-*.tar.*)
# If download_prerequisites wants 0.8.1, use 0.8.2 instead.
file=${file/0.8.1/0.8.2}
download_and_check http://www.multiprecision.org/downloads $file.asc
case "$file" in
*-0.8.2.tar*|*-0.9.tar*|*-1.0.tar*)
ext=asc
;;
*)
ext=sig
;;
esac
download_and_check http://www.multiprecision.org/downloads $file.$ext
;;
*)
download $(dirname $url) $file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ class AnimatedPropertyListContainer extends PureComponent {
timeScale,
}
),
dom.div(
{
className: "animated-property-list-background",
},
dom.span()
),
AnimatedPropertyList(
{
animation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,13 @@ class AnimatedPropertyListHeader extends PureComponent {

return dom.div(
{
className: "animated-property-list-header devtools-toolbar"
className: "animated-property-list-header"
},
dom.div(
{
className: "devtools-toolbar"
}
),
KeyframesProgressTickList(),
KeyframesProgressBar(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ class AnimationListHeader extends PureComponent {

return dom.div(
{
className: "animation-list-header devtools-toolbar"
className: "animation-list-header"
},
dom.div(
{
className: "devtools-toolbar"
}
),
AnimationTimelineTickList(
{
timeScale
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class CurrentTimeScrubberController extends PureComponent {
}

componentDidMount() {
const parentEl = ReactDOM.findDOMNode(this).parentElement;
parentEl.addEventListener("mousedown", this.onMouseDown);
const el = ReactDOM.findDOMNode(this);
el.addEventListener("mousedown", this.onMouseDown);
}

componentWillUnmount() {
Expand Down Expand Up @@ -127,7 +127,7 @@ class CurrentTimeScrubberController extends PureComponent {

return dom.div(
{
className: "current-time-scrubber-controller devtools-toolbar",
className: "current-time-scrubber-controller",
},
CurrentTimeScrubber(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,38 +28,38 @@ add_task(async function() {
ok(listHeaderEl, "The header element should be in animation list container element");

info("Checking time tick item elements existence");
assertTimelineTickItems(timeScale, listHeaderEl);
assertTimelineTickItems(timeScale, listContainerEl);
const timelineTickItemLength =
listHeaderEl.querySelectorAll(".animation-timeline-tick-item").length;
listContainerEl.querySelectorAll(".animation-timeline-tick-item").length;

info("Checking timeline tick item elements after enlarge sidebar width");
await setSidebarWidth("100%", inspector);
assertTimelineTickItems(timeScale, listHeaderEl);
assertTimelineTickItems(timeScale, listContainerEl);
ok(timelineTickItemLength <
listHeaderEl.querySelectorAll(".animation-timeline-tick-item").length,
listContainerEl.querySelectorAll(".animation-timeline-tick-item").length,
"The timeline tick item elements should increase");
});

/**
* Assert timeline tick item's position and label.
*
* @param {TimeScale} - timeScale
* @param {Element} - listHeaderEl which is header element
* @param {Element} - listContainerEl
*/
function assertTimelineTickItems(timeScale, listHeaderEl) {
const animationTimelineTickListEl =
listHeaderEl.querySelector(".animation-timeline-tick-list");
ok(animationTimelineTickListEl,
function assertTimelineTickItems(timeScale, listContainerEl) {
const timelineTickListEl =
listContainerEl.querySelector(".animation-timeline-tick-list");
ok(timelineTickListEl,
"The animation timeline tick list element should be in header");

const width = animationTimelineTickListEl.offsetWidth;
const width = timelineTickListEl.offsetWidth;
const animationDuration = timeScale.getDuration();
const minTimeInterval = TIME_GRADUATION_MIN_SPACING * animationDuration / width;
const interval = findOptimalTimeInterval(minTimeInterval);
const expectedTickItem = Math.ceil(animationDuration / interval);

const timelineTickItemEls =
listHeaderEl.querySelectorAll(".animation-timeline-tick-item");
timelineTickListEl.querySelectorAll(".animation-timeline-tick-item");
is(timelineTickItemEls.length, expectedTickItem,
"The expected number of timeline ticks were found");

Expand Down
14 changes: 11 additions & 3 deletions devtools/client/netmonitor/src/actions/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,23 @@ const {
WATERFALL_RESIZE,
} = require("../constants");

const { getDisplayedRequests } = require("../selectors/index");

/**
* Change network details panel.
*
* @param {boolean} open - expected network details panel open state
*/
function openNetworkDetails(open) {
return {
type: OPEN_NETWORK_DETAILS,
open,
return (dispatch, getState) => {
const visibleRequestItems = getDisplayedRequests(getState());
let defaultSelectedId = visibleRequestItems.length ? visibleRequestItems[0].id : null;

return dispatch({
type: OPEN_NETWORK_DETAILS,
open,
defaultSelectedId,
});
};
}

Expand Down
4 changes: 2 additions & 2 deletions devtools/client/netmonitor/src/reducers/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ function requestsReducer(state = Requests(), action) {
return nextState;
}

if (!state.selectedId && state.requests.size > 0) {
nextState.selectedId = [...state.requests.values()][0].id;
if (!state.selectedId && action.defaultSelectedId) {
nextState.selectedId = action.defaultSelectedId;
return nextState;
}

Expand Down
1 change: 1 addition & 0 deletions devtools/client/netmonitor/test/browser.ini
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ skip-if = (os == 'linux' && debug && bits == 32) # Bug 1303439
[browser_net_open_in_style_editor.js]
[browser_net_open_request_in_tab.js]
[browser_net_pane-collapse.js]
[browser_net_pane-network-details.js]
[browser_net_pane-toggle.js]
[browser_net_pause.js]
[browser_net_params_sorted.js]
Expand Down
Loading

0 comments on commit cc3eafe

Please sign in to comment.