mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Back out c578a05bb9d6 (bug 1243131) for browser_memory_keyboard-snapshot-list.js timeout threshold exceeded on Linux32 debug
This commit is contained in:
parent
fc71052fdc
commit
2892f20a13
@ -3,7 +3,6 @@
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
const { assert } = require("devtools/shared/DevToolsUtils");
|
||||
const { appinfo } = require("Services");
|
||||
const { DOM: dom, createClass, createFactory, PropTypes } = require("devtools/client/shared/vendor/react");
|
||||
const { connect } = require("devtools/client/shared/vendor/react-redux");
|
||||
const { breakdowns, diffingState, viewState } = require("./constants");
|
||||
@ -54,17 +53,6 @@ const MemoryApp = createClass({
|
||||
return {};
|
||||
},
|
||||
|
||||
componentDidMount() {
|
||||
// Attach the keydown listener directly to the window. When an element that
|
||||
// has the focus (such as a tree node) is removed from the DOM, the focus
|
||||
// falls back to the body.
|
||||
window.addEventListener("keydown", this.onKeyDown);
|
||||
},
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("keydown", this.onKeyDown);
|
||||
},
|
||||
|
||||
childContextTypes: {
|
||||
front: PropTypes.any,
|
||||
heapWorker: PropTypes.any,
|
||||
@ -79,27 +67,6 @@ const MemoryApp = createClass({
|
||||
};
|
||||
},
|
||||
|
||||
onKeyDown(e) {
|
||||
let { snapshots, dispatch, heapWorker } = this.props;
|
||||
const selectedSnapshot = snapshots.find(s => s.selected);
|
||||
const selectedIndex = snapshots.indexOf(selectedSnapshot);
|
||||
|
||||
let isOSX = appinfo.OS == "Darwin";
|
||||
let isAccelKey = (isOSX && e.metaKey) || (!isOSX && e.ctrlKey);
|
||||
// On ACCEL+UP, select previous snapshot.
|
||||
if (isAccelKey && e.key === "ArrowUp") {
|
||||
let previousIndex = Math.max(0, selectedIndex - 1);
|
||||
let previousSnapshotId = snapshots[previousIndex].id;
|
||||
dispatch(selectSnapshotAndRefresh(heapWorker, previousSnapshotId));
|
||||
}
|
||||
// On ACCEL+DOWN, select next snapshot.
|
||||
if (isAccelKey && e.key === "ArrowDown") {
|
||||
let nextIndex = Math.min(snapshots.length - 1, selectedIndex + 1);
|
||||
let nextSnapshotId = snapshots[nextIndex].id;
|
||||
dispatch(selectSnapshotAndRefresh(heapWorker, nextSnapshotId));
|
||||
}
|
||||
},
|
||||
|
||||
render() {
|
||||
let {
|
||||
dispatch,
|
||||
|
@ -15,7 +15,6 @@ support-files =
|
||||
[browser_memory_dominator_trees_02.js]
|
||||
[browser_memory_filter_01.js]
|
||||
[browser_memory_keyboard.js]
|
||||
[browser_memory_keyboard-snapshot-list.js]
|
||||
[browser_memory_no_allocation_stacks.js]
|
||||
[browser_memory_no_auto_expand.js]
|
||||
skip-if = debug # bug 1219554
|
||||
|
@ -1,91 +0,0 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Test that using ACCEL+UP/DOWN, the user can navigate between snapshots.
|
||||
|
||||
"use strict";
|
||||
|
||||
const {
|
||||
snapshotState
|
||||
} = require("devtools/client/memory/constants");
|
||||
const {
|
||||
takeSnapshotAndCensus
|
||||
} = require("devtools/client/memory/actions/snapshot");
|
||||
|
||||
const TEST_URL = "http://example.com/browser/devtools/client/memory/test/browser/doc_steady_allocation.html";
|
||||
|
||||
this.test = makeMemoryTest(TEST_URL, function* ({ panel }) {
|
||||
const heapWorker = panel.panelWin.gHeapAnalysesClient;
|
||||
const front = panel.panelWin.gFront;
|
||||
const store = panel.panelWin.gStore;
|
||||
const { dispatch } = store;
|
||||
const doc = panel.panelWin.document;
|
||||
|
||||
info("Take 3 snapshots");
|
||||
dispatch(takeSnapshotAndCensus(front, heapWorker));
|
||||
dispatch(takeSnapshotAndCensus(front, heapWorker));
|
||||
dispatch(takeSnapshotAndCensus(front, heapWorker));
|
||||
|
||||
yield waitUntilState(store, state =>
|
||||
state.snapshots.length == 3 &&
|
||||
state.snapshots.every(s => s.state === snapshotState.SAVED_CENSUS));
|
||||
ok(true, "All snapshots are in SAVED_CENSUS state");
|
||||
|
||||
yield waitUntilSnapshotSelected(store, 2);
|
||||
ok(true, "Third snapshot selected after creating all snapshots.");
|
||||
|
||||
info("Press ACCEL+UP key, expect second snapshot selected.");
|
||||
EventUtils.synthesizeKey("VK_UP", { accelKey: true }, panel.panelWin);
|
||||
yield waitUntilSnapshotSelected(store, 1);
|
||||
ok(true, "Second snapshot selected after alt+UP.");
|
||||
|
||||
info("Press ACCEL+UP key, expect first snapshot selected.");
|
||||
EventUtils.synthesizeKey("VK_UP", { accelKey: true }, panel.panelWin);
|
||||
yield waitUntilSnapshotSelected(store, 0);
|
||||
ok(true, "First snapshot is selected after ACCEL+UP");
|
||||
|
||||
info("Check ACCEL+UP is a noop when the first snapshot is selected.");
|
||||
EventUtils.synthesizeKey("VK_UP", { accelKey: true }, panel.panelWin);
|
||||
// We assume the snapshot selection should be synchronous here.
|
||||
is(getSelectedSnapshotIndex(store), 0, "First snapshot is still selected");
|
||||
|
||||
info("Press ACCEL+DOWN key, expect second snapshot selected.");
|
||||
EventUtils.synthesizeKey("VK_DOWN", { accelKey: true }, panel.panelWin);
|
||||
yield waitUntilSnapshotSelected(store, 1);
|
||||
ok(true, "Second snapshot is selected after ACCEL+DOWN");
|
||||
|
||||
info("Click on first node.");
|
||||
let firstNode = doc.querySelector(".tree .heap-tree-item-name");
|
||||
EventUtils.synthesizeMouseAtCenter(firstNode, {}, panel.panelWin);
|
||||
yield waitUntilState(store, state => state.snapshots[1].census.focused ===
|
||||
state.snapshots[1].census.report.children[0]
|
||||
);
|
||||
ok(true, "First root is selected after click.");
|
||||
|
||||
info("Press DOWN key, expect second root focused.");
|
||||
EventUtils.synthesizeKey("VK_DOWN", {}, panel.panelWin);
|
||||
yield waitUntilState(store, state => state.snapshots[1].census.focused ===
|
||||
state.snapshots[1].census.report.children[1]
|
||||
);
|
||||
ok(true, "Second root is selected after pressing DOWN.");
|
||||
is(getSelectedSnapshotIndex(store), 1, "Second snapshot is still selected");
|
||||
|
||||
info("Press UP key, expect second root focused.");
|
||||
EventUtils.synthesizeKey("VK_UP", {}, panel.panelWin);
|
||||
yield waitUntilState(store, state => state.snapshots[1].census.focused ===
|
||||
state.snapshots[1].census.report.children[0]
|
||||
);
|
||||
ok(true, "First root is selected after pressing UP.");
|
||||
is(getSelectedSnapshotIndex(store), 1, "Second snapshot is still selected");
|
||||
|
||||
info("Press ACCEL+DOWN key, expect third snapshot selected.");
|
||||
EventUtils.synthesizeKey("VK_DOWN", { accelKey: true }, panel.panelWin);
|
||||
yield waitUntilSnapshotSelected(store, 2);
|
||||
ok(true, "Thirdˆ snapshot is selected after ACCEL+DOWN");
|
||||
|
||||
info("Check ACCEL+DOWN is a noop when the last snapshot is selected.");
|
||||
EventUtils.synthesizeKey("VK_DOWN", { accelKey: true }, panel.panelWin);
|
||||
// We assume the snapshot selection should be synchronous here.
|
||||
is(getSelectedSnapshotIndex(store), 2, "Third snapshot is still selected");
|
||||
|
||||
});
|
@ -142,26 +142,3 @@ function getDisplayedSnapshotStatus(document) {
|
||||
const status = document.querySelector(".snapshot-status");
|
||||
return status ? status.textContent.trim() : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the index of the currently selected snapshot.
|
||||
*
|
||||
* @return {Number}
|
||||
*/
|
||||
function getSelectedSnapshotIndex(store) {
|
||||
let snapshots = store.getState().snapshots;
|
||||
let selectedSnapshot = snapshots.find(s => s.selected);
|
||||
return snapshots.indexOf(selectedSnapshot);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a promise that will resolve when the snapshot with provided index
|
||||
* becomes selected.
|
||||
*
|
||||
* @return {Promise}
|
||||
*/
|
||||
function waitUntilSnapshotSelected(store, snapshotIndex) {
|
||||
return waitUntilState(store, state =>
|
||||
state.snapshots[snapshotIndex] &&
|
||||
state.snapshots[snapshotIndex].selected === true);
|
||||
}
|
||||
|
@ -276,35 +276,6 @@ window.onload = Task.async(function* () {
|
||||
"-N:false",
|
||||
"--O:false",
|
||||
], "After the RIGHT, K should be focused.");
|
||||
|
||||
// Check that keys are ignored if any modifier is present.
|
||||
let keysWithModifier = [
|
||||
{ key: "ArrowDown", altKey: true },
|
||||
{ key: "ArrowDown", ctrlKey: true },
|
||||
{ key: "ArrowDown", metaKey: true },
|
||||
{ key: "ArrowDown", shiftKey: true },
|
||||
];
|
||||
for (let key of keysWithModifier) {
|
||||
Simulate.keyDown(document.querySelector(".tree"), key);
|
||||
yield forceRender(tree);
|
||||
isRenderedTree(document.body.textContent, [
|
||||
"A:false",
|
||||
"-B:false",
|
||||
"--E:false",
|
||||
"---K:true",
|
||||
"---L:false",
|
||||
"--F:false",
|
||||
"--G:false",
|
||||
"-C:false",
|
||||
"--H:false",
|
||||
"--I:false",
|
||||
"-D:false",
|
||||
"--J:false",
|
||||
"M:false",
|
||||
"-N:false",
|
||||
"--O:false",
|
||||
], "After DOWN + (alt|ctrl|meta|shift), K should remain focused.");
|
||||
}
|
||||
} catch(e) {
|
||||
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
|
||||
} finally {
|
||||
|
@ -405,11 +405,6 @@ const Tree = module.exports = createClass({
|
||||
return;
|
||||
}
|
||||
|
||||
// Allow parent nodes to use navigation arrows with modifiers.
|
||||
if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Prevent scrolling when pressing navigation keys. Guard against mocked
|
||||
// events received when testing.
|
||||
if (e.nativeEvent && e.nativeEvent.preventDefault) {
|
||||
|
Loading…
Reference in New Issue
Block a user