Bug 1304700 - Fix tests. r=jdescottes

This commit is contained in:
Jan Odvarko 2016-09-27 09:27:32 +02:00
Родитель f3ebc27146
Коммит 649d027b8e
2 изменённых файлов: 23 добавлений и 9 удалений

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

@ -13,11 +13,14 @@ var gTab, gPanel, gDebugger;
var gPrefs, gOptions;
function test() {
let options = {
source: TAB_URL,
line: 1
};
initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
Task.spawn(function* () {
let options = {
source: TAB_URL,
line: 1
};
let [aTab,, aPanel] = yield initDebugger(TAB_URL, options);
gTab = aTab;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
@ -28,7 +31,7 @@ function test() {
gDebugger.DebuggerView.toggleInstrumentsPane({ visible: true, animated: false });
testInstrumentsPaneCollapse();
yield testInstrumentsPaneCollapse();
testPanesStartupPref();
closeDebuggerAndFinish(gPanel);
@ -50,7 +53,7 @@ function testPanesState() {
"The options menu item should not be checked.");
}
function testInstrumentsPaneCollapse() {
function* testInstrumentsPaneCollapse () {
let instrumentsPane =
gDebugger.document.getElementById("instruments-pane");
let instrumentsPaneToggleButton =
@ -69,8 +72,13 @@ function testInstrumentsPaneCollapse() {
!instrumentsPaneToggleButton.classList.contains("pane-collapsed"),
"The instruments pane should at this point be visible.");
// Trigger reflow to make sure the UI is in required state.
gDebugger.document.documentElement.getBoundingClientRect();
gDebugger.DebuggerView.toggleInstrumentsPane({ visible: false, animated: true });
yield once(instrumentsPane, "transitionend");
is(gPrefs.panesVisibleOnStartup, false,
"The debugger view panes should still initially be preffed as hidden.");
isnot(gOptions._showPanesOnStartupItem.getAttribute("checked"), "true",
@ -83,7 +91,8 @@ function testInstrumentsPaneCollapse() {
"The instruments pane has an incorrect left margin after collapsing.");
is(instrumentsPane.style.marginRight, margin,
"The instruments pane has an incorrect right margin after collapsing.");
ok(instrumentsPane.hasAttribute("animated"),
ok(!instrumentsPane.hasAttribute("animated"),
"The instruments pane has an incorrect attribute after an animated collapsing.");
ok(instrumentsPane.classList.contains("pane-collapsed") &&
instrumentsPaneToggleButton.classList.contains("pane-collapsed"),

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

@ -34,8 +34,13 @@ add_task(function* () {
!detailsPaneToggleButton.classList.contains("pane-collapsed"),
"The details pane should at this point be visible.");
// Trigger reflow to make sure the UI is in required state.
document.documentElement.getBoundingClientRect();
NetMonitorView.toggleDetailsPane({ visible: false, animated: true });
yield once(detailsPane, "transitionend");
let margin = -(width + 1) + "px";
is(width, Prefs.networkDetailsWidth,
"The details pane has an incorrect width after collapsing.");
@ -43,7 +48,7 @@ add_task(function* () {
"The details pane has an incorrect left margin after collapsing.");
is(detailsPane.style.marginRight, margin,
"The details pane has an incorrect right margin after collapsing.");
ok(detailsPane.hasAttribute("animated"),
ok(!detailsPane.hasAttribute("animated"),
"The details pane has an incorrect attribute after an animated collapsing.");
ok(detailsPane.classList.contains("pane-collapsed") &&
detailsPaneToggleButton.classList.contains("pane-collapsed"),