зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1585121 Part 9: Fix and activate RDM tests browser_v* through browser_z*. r=mtigley
Differential Revision: https://phabricator.services.mozilla.com/D64694 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
70879323f1
Коммит
d331c0080c
|
@ -13,12 +13,9 @@ const TEST_URL =
|
|||
'<div style="width:100%;height:1100px;background-color:lightblue"></div>' +
|
||||
"</body>";
|
||||
|
||||
addRDMTask(TEST_URL, async function({ ui, manager }) {
|
||||
const store = ui.toolWindow.store;
|
||||
|
||||
// Wait until the viewport has been added.
|
||||
await waitUntilState(store, state => state.viewports.length == 1);
|
||||
|
||||
addRDMTask(
|
||||
TEST_URL,
|
||||
async function({ ui, manager }) {
|
||||
info("--- Starting viewport test output ---");
|
||||
|
||||
// We're going to take a 300,600 viewport (before), reload it,
|
||||
|
@ -49,7 +46,7 @@ addRDMTask(TEST_URL, async function({ ui, manager }) {
|
|||
await setTouchAndMetaViewportSupport(ui, e.metaSupport);
|
||||
|
||||
// Get to the initial size and check values.
|
||||
await setViewportSize(ui, manager, 300, 600);
|
||||
await setViewportSizeAndAwaitReflow(ui, manager, 300, 600);
|
||||
await testViewportZoomWidthAndHeight(
|
||||
message + " before resize",
|
||||
ui,
|
||||
|
@ -74,7 +71,7 @@ addRDMTask(TEST_URL, async function({ ui, manager }) {
|
|||
);
|
||||
|
||||
// Move to the smaller size.
|
||||
await setViewportSize(ui, manager, 600, 300);
|
||||
await setViewportSizeAndAwaitReflow(ui, manager, 600, 300);
|
||||
await testViewportZoomWidthAndHeight(
|
||||
message + " after resize",
|
||||
ui,
|
||||
|
@ -84,7 +81,7 @@ addRDMTask(TEST_URL, async function({ ui, manager }) {
|
|||
);
|
||||
|
||||
// Go back to the initial size and check again.
|
||||
await setViewportSize(ui, manager, 300, 600);
|
||||
await setViewportSizeAndAwaitReflow(ui, manager, 300, 600);
|
||||
await testViewportZoomWidthAndHeight(
|
||||
message + " return to initial size",
|
||||
ui,
|
||||
|
@ -93,4 +90,6 @@ addRDMTask(TEST_URL, async function({ ui, manager }) {
|
|||
b[2]
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
{ usingBrowserUI: true }
|
||||
);
|
||||
|
|
|
@ -9,12 +9,9 @@ const TEST_URL =
|
|||
"data:text/html;charset=utf-8," +
|
||||
'<head><meta name="viewport" content="width=300"/></head>' +
|
||||
"<body>meta viewport width 300</body>";
|
||||
addRDMTask(TEST_URL, async function({ ui, manager }) {
|
||||
const store = ui.toolWindow.store;
|
||||
|
||||
// Wait until the viewport has been added.
|
||||
await waitUntilState(store, state => state.viewports.length == 1);
|
||||
|
||||
addRDMTask(
|
||||
TEST_URL,
|
||||
async function({ ui, manager }) {
|
||||
info("--- Starting viewport test output ---");
|
||||
|
||||
// We're going to take a 600,300 viewport (before) and resize it
|
||||
|
@ -45,7 +42,7 @@ addRDMTask(TEST_URL, async function({ ui, manager }) {
|
|||
await setTouchAndMetaViewportSupport(ui, e.metaSupport);
|
||||
|
||||
// Get to the initial size and check values.
|
||||
await setViewportSize(ui, manager, 600, 300);
|
||||
await setViewportSizeAndAwaitReflow(ui, manager, 600, 300);
|
||||
await testViewportZoomWidthAndHeight(
|
||||
message + " before resize",
|
||||
ui,
|
||||
|
@ -55,7 +52,7 @@ addRDMTask(TEST_URL, async function({ ui, manager }) {
|
|||
);
|
||||
|
||||
// Move to the smaller size.
|
||||
await setViewportSize(ui, manager, 50, 50);
|
||||
await setViewportSizeAndAwaitReflow(ui, manager, 50, 50);
|
||||
await testViewportZoomWidthAndHeight(
|
||||
message + " after resize",
|
||||
ui,
|
||||
|
@ -65,7 +62,7 @@ addRDMTask(TEST_URL, async function({ ui, manager }) {
|
|||
);
|
||||
|
||||
// Go back to the initial size and check again.
|
||||
await setViewportSize(ui, manager, 600, 300);
|
||||
await setViewportSizeAndAwaitReflow(ui, manager, 600, 300);
|
||||
await testViewportZoomWidthAndHeight(
|
||||
message + " return to initial size",
|
||||
ui,
|
||||
|
@ -74,4 +71,6 @@ addRDMTask(TEST_URL, async function({ ui, manager }) {
|
|||
b[2]
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
{ usingBrowserUI: true }
|
||||
);
|
||||
|
|
|
@ -10,12 +10,9 @@ const TEST_URL =
|
|||
'<head><meta name="viewport" content="width=device-width, ' +
|
||||
'initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0"></head>' +
|
||||
"<body>meta viewport scaled locked at 1.0</body>";
|
||||
addRDMTask(TEST_URL, async function({ ui, manager }) {
|
||||
const store = ui.toolWindow.store;
|
||||
|
||||
// Wait until the viewport has been added.
|
||||
await waitUntilState(store, state => state.viewports.length == 1);
|
||||
|
||||
addRDMTask(
|
||||
TEST_URL,
|
||||
async function({ ui, manager }) {
|
||||
info("--- Starting viewport test output ---");
|
||||
|
||||
// We're going to take a 300,600 viewport (before) and resize it
|
||||
|
@ -62,7 +59,7 @@ addRDMTask(TEST_URL, async function({ ui, manager }) {
|
|||
await setTouchAndMetaViewportSupport(ui, e.metaSupport);
|
||||
|
||||
// Get to the initial size and check values.
|
||||
await setViewportSize(ui, manager, 300, 600);
|
||||
await setViewportSizeAndAwaitReflow(ui, manager, 300, 600);
|
||||
await testViewportZoomWidthAndHeight(
|
||||
message + " before resize",
|
||||
ui,
|
||||
|
@ -72,7 +69,7 @@ addRDMTask(TEST_URL, async function({ ui, manager }) {
|
|||
);
|
||||
|
||||
// Move to the smaller size.
|
||||
await setViewportSize(ui, manager, 600, 300);
|
||||
await setViewportSizeAndAwaitReflow(ui, manager, 600, 300);
|
||||
await testViewportZoomWidthAndHeight(
|
||||
message + " after resize",
|
||||
ui,
|
||||
|
@ -82,7 +79,7 @@ addRDMTask(TEST_URL, async function({ ui, manager }) {
|
|||
);
|
||||
|
||||
// Go back to the initial size and check again.
|
||||
await setViewportSize(ui, manager, 300, 600);
|
||||
await setViewportSizeAndAwaitReflow(ui, manager, 300, 600);
|
||||
await testViewportZoomWidthAndHeight(
|
||||
message + " return to initial size",
|
||||
ui,
|
||||
|
@ -91,4 +88,6 @@ addRDMTask(TEST_URL, async function({ ui, manager }) {
|
|||
b.height
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
{ usingBrowserUI: true }
|
||||
);
|
||||
|
|
|
@ -11,12 +11,9 @@ const TEST_URL =
|
|||
'minimum-scale=1.0, width=device-width"></head>' +
|
||||
'<div style="width:100%;background-color:green">test</div>' +
|
||||
"</body>";
|
||||
addRDMTask(TEST_URL, async function({ ui, manager }) {
|
||||
const store = ui.toolWindow.store;
|
||||
|
||||
// Wait until the viewport has been added.
|
||||
await waitUntilState(store, state => state.viewports.length == 1);
|
||||
|
||||
addRDMTask(
|
||||
TEST_URL,
|
||||
async function({ ui, manager }) {
|
||||
info("--- Starting viewport test output ---");
|
||||
|
||||
// We're going to take a 300,600 viewport (before) and resize it
|
||||
|
@ -78,4 +75,6 @@ addRDMTask(TEST_URL, async function({ ui, manager }) {
|
|||
b.height
|
||||
);
|
||||
}
|
||||
});
|
||||
},
|
||||
{ usingBrowserUI: true }
|
||||
);
|
||||
|
|
|
@ -48,7 +48,9 @@ const TEST_URL =
|
|||
"</head>" +
|
||||
'<body><div style="background:orange; width:1000px; height:1000px"></div></body>';
|
||||
|
||||
addRDMTask(TEST_URL, async function({ ui, manager }) {
|
||||
addRDMTask(
|
||||
TEST_URL,
|
||||
async function({ ui, manager }) {
|
||||
// Turn on the prefs that force overlay scrollbars to always be visible, and to allow
|
||||
// data URIs to be considered as same-origin.
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
|
@ -58,37 +60,24 @@ addRDMTask(TEST_URL, async function({ ui, manager }) {
|
|||
],
|
||||
});
|
||||
|
||||
const store = ui.toolWindow.store;
|
||||
|
||||
// Wait until the viewport has been added.
|
||||
await waitUntilState(store, state => state.viewports.length == 1);
|
||||
|
||||
info("--- Starting viewport test output ---");
|
||||
|
||||
const browser = ui.getViewportBrowser();
|
||||
|
||||
const expected = [
|
||||
{
|
||||
metaSupport: false,
|
||||
},
|
||||
{
|
||||
metaSupport: true,
|
||||
},
|
||||
];
|
||||
|
||||
const expected = [false, true];
|
||||
for (const e of expected) {
|
||||
const message = "Meta Viewport " + (e.metaSupport ? "ON" : "OFF");
|
||||
const message = "Meta Viewport " + (e ? "ON" : "OFF");
|
||||
|
||||
// Ensure meta viewport is set.
|
||||
info(message + " setting meta viewport support.");
|
||||
await setTouchAndMetaViewportSupport(ui, e.metaSupport);
|
||||
|
||||
// Get to the initial size and snapshot the window.
|
||||
await setViewportSize(ui, manager, 300, 600);
|
||||
const initialSnapshot = await snapshotWindow(browser.contentWindow);
|
||||
await setViewportSizeAndAwaitReflow(ui, manager, 300, 600);
|
||||
const initialSnapshot = await snapshotWindow(browser);
|
||||
|
||||
// Move to the rotated size.
|
||||
await setViewportSize(ui, manager, 600, 300);
|
||||
await setViewportSizeAndAwaitReflow(ui, manager, 600, 300);
|
||||
|
||||
// Reload the window.
|
||||
const reload = waitForViewportLoad(ui);
|
||||
|
@ -96,10 +85,12 @@ addRDMTask(TEST_URL, async function({ ui, manager }) {
|
|||
await reload;
|
||||
|
||||
// Go back to the initial size and take another snapshot.
|
||||
await setViewportSize(ui, manager, 300, 600);
|
||||
const finalSnapshot = await snapshotWindow(browser.contentWindow);
|
||||
await setViewportSizeAndAwaitReflow(ui, manager, 300, 600);
|
||||
const finalSnapshot = await snapshotWindow(browser);
|
||||
|
||||
const result = compareSnapshots(initialSnapshot, finalSnapshot, true);
|
||||
is(result[2], result[1], "Window snapshots should match.");
|
||||
}
|
||||
});
|
||||
},
|
||||
{ usingBrowserUI: true }
|
||||
);
|
||||
|
|
|
@ -59,6 +59,6 @@ for (const { content, res_restore } of TESTS) {
|
|||
`${content} resolution should be near ${res_target}, and we got ${resolution}.`
|
||||
);
|
||||
},
|
||||
true
|
||||
{ usingBrowserUI: true }
|
||||
);
|
||||
}
|
||||
|
|
|
@ -78,8 +78,7 @@ for (const { content, res_target } of TESTS) {
|
|||
`${content} zoom ${zoom} resolution should be near ${res_target}, and we got ${resolution}.`
|
||||
);
|
||||
}
|
||||
}
|
||||
// XXX: Enable testing against new browser UI.
|
||||
// true
|
||||
},
|
||||
{ usingBrowserUI: true }
|
||||
);
|
||||
}
|
||||
|
|
|
@ -15,7 +15,9 @@ function setZoomForBrowser(browser, zoom) {
|
|||
ZoomManager.setZoomForBrowser(browser, zoom);
|
||||
}
|
||||
|
||||
add_task(async function() {
|
||||
addRDMTask(
|
||||
null,
|
||||
async function({ message }) {
|
||||
const INITIAL_ZOOM_LEVEL = 1;
|
||||
const PRE_RDM_ZOOM_LEVEL = 1.5;
|
||||
const MID_RDM_ZOOM_LEVEL = 2;
|
||||
|
@ -47,6 +49,10 @@ add_task(async function() {
|
|||
// It will now pass all of its messages through to the RDM docshell, meaning that when
|
||||
// we request zoom level from it now, we are getting the RDM zoom level.
|
||||
const { ui } = await openRDM(tab);
|
||||
|
||||
// Always wait for the post-init message.
|
||||
await message.wait(ui.toolWindow, "post-init");
|
||||
|
||||
const uiDocShell = ui.toolWindow.docShell;
|
||||
|
||||
// Bug 1541692: openRDM behaves differently in the test harness than it does
|
||||
|
@ -67,7 +73,11 @@ add_task(async function() {
|
|||
|
||||
// The UI zoom should be unchanged by this.
|
||||
const postZoomUIZoom = uiDocShell.contentViewer.fullZoom;
|
||||
is(postZoomUIZoom, preZoomUIZoom, "UI zoom should be unchanged by RDM zoom.");
|
||||
is(
|
||||
postZoomUIZoom,
|
||||
preZoomUIZoom,
|
||||
"UI zoom should be unchanged by RDM zoom."
|
||||
);
|
||||
|
||||
// The RDM zoom should be changed.
|
||||
const finalRDMZoom = getZoomForBrowser(browser);
|
||||
|
@ -80,11 +90,14 @@ add_task(async function() {
|
|||
// Leave RDM. This should cause the outer pane to take on the full zoom of the RDM pane.
|
||||
await closeRDM(tab);
|
||||
|
||||
// Bug 1541692: the following todo_is check will become an is check when this bug lands.
|
||||
const finalOuterZoom = getZoomForBrowser(browser);
|
||||
todo_is(
|
||||
is(
|
||||
finalOuterZoom,
|
||||
finalRDMZoom,
|
||||
"Final outer zoom should match last RDM zoom."
|
||||
);
|
||||
});
|
||||
|
||||
await removeTab(tab);
|
||||
},
|
||||
{ usingBrowserUI: true, onlyPrefAndTask: true }
|
||||
);
|
||||
|
|
Загрузка…
Ссылка в новой задаче