Backed out 2 changesets (bug 1541256) for failing browser_deck_has_out_of_process_iframe.js on a CLOSED TREE

Backed out changeset 691c50b5729a (bug 1541256)
Backed out changeset fc785139655e (bug 1541256)
This commit is contained in:
Andreea Pavel 2019-09-20 18:15:15 +03:00
Родитель 8a522eccdf
Коммит 1f18f66226
7 изменённых файлов: 6 добавлений и 153 удалений

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

@ -7,9 +7,5 @@ support-files =
[browser_test_link.js]
skip-if = verify
[browser_test_visibility.js]
[browser_deck_has_out_of_process_iframe.js]
support-files =
target.html
test_deck_has_out_of_process_iframe.xul
[browser_offscreen_element_in_out_of_process_iframe.js]
skip-if = (webrender && os == 'win') # bug 1580706

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

@ -1,120 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const DIRPATH = getRootDirectory(gTestPath).replace(
"chrome://mochitests/content/",
""
);
const parentPATH = DIRPATH + "test_deck_has_out_of_process_iframe.xul";
const iframePATH = DIRPATH + "target.html";
// XXX: Using external files here since using data URL breaks something, e.g. it
// makes querying the second iframe in a hidden deck failure for some reasons.
const parentURL = `http://example.com/${parentPATH}`;
const iframeURL = `http://example.org/${iframePATH}`;
add_task(async function() {
const win = await BrowserTestUtils.openNewBrowserWindow({
fission: true,
});
try {
const browser = win.gBrowser.selectedTab.linkedBrowser;
BrowserTestUtils.loadURI(browser, parentURL);
await BrowserTestUtils.browserLoaded(browser, false, parentURL);
async function setupIFrame(id, url) {
const iframe = content.document.getElementById(id);
iframe.contentWindow.location = url;
await new Promise(resolve => {
iframe.addEventListener("load", resolve, { once: true });
});
return iframe.browsingContext;
}
async function spawnSelectDeck(index) {
async function selectDeck(i) {
const deck = content.document.getElementById("deck");
deck.setAttribute("selectedIndex", i);
await new Promise(resolve => {
content.window.addEventListener("MozAfterPaint", resolve, {
once: true,
});
});
return deck.selectedIndex;
}
await SpecialPowers.spawn(browser, [index], selectDeck);
await waitForIFrameUpdates();
}
const firstIFrame = await SpecialPowers.spawn(
browser,
["first", iframeURL],
setupIFrame
);
const secondIFrame = await SpecialPowers.spawn(
browser,
["second", iframeURL],
setupIFrame
);
await waitForIFrameUpdates();
await spawnTestStates(
firstIFrame,
"target",
0,
nsIAccessibleStates.STATE_OFFSCREEN
);
// Disable the check for the target element in the unselected pane of the
// deck, this should be fixed by bug 1578932.
// Note: As of now we can't use todo in the script transfered into the
// out-of-process.
//await spawnTestStates(
// secondIFrame,
// "target",
// nsIAccessibleStates.STATE_OFFSCREEN,
// nsIAccessibleStates.STATE_INVISIBLE
//);
// Select the second panel.
await spawnSelectDeck(1);
await spawnTestStates(
firstIFrame,
"target",
nsIAccessibleStates.STATE_OFFSCREEN,
nsIAccessibleStates.STATE_INVISIBLE
);
await spawnTestStates(
secondIFrame,
"target",
0,
nsIAccessibleStates.STATE_OFFSCREEN
);
// Select the first panel again.
await spawnSelectDeck(0);
await spawnTestStates(
firstIFrame,
"target",
0,
nsIAccessibleStates.STATE_OFFSCREEN
);
await spawnTestStates(
secondIFrame,
"target",
nsIAccessibleStates.STATE_OFFSCREEN,
nsIAccessibleStates.STATE_INVISIBLE
);
} finally {
await BrowserTestUtils.closeWindow(win);
}
});

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

@ -61,8 +61,7 @@ add_task(async function() {
await spawnTestStates(
iframe,
"target",
nsIAccessibleStates.STATE_OFFSCREEN,
nsIAccessibleStates.STATE_INVISIBLE
nsIAccessibleStates.STATE_OFFSCREEN
);
// Scroll the iframe into view and the target element is also visible but
@ -71,26 +70,19 @@ add_task(async function() {
await spawnTestStates(
iframe,
"target",
nsIAccessibleStates.STATE_OFFSCREEN,
nsIAccessibleStates.STATE_INVISIBLE
nsIAccessibleStates.STATE_OFFSCREEN
);
// Scroll to a position where the visible height is 13px.
await scrollTo(0, 713);
await spawnTestStates(
iframe,
"target",
0,
nsIAccessibleStates.STATE_OFFSCREEN
);
await spawnTestStates(iframe, "target", 0);
// Scroll the iframe out again.
await scrollTo(0, 0);
await spawnTestStates(
iframe,
"target",
nsIAccessibleStates.STATE_OFFSCREEN,
nsIAccessibleStates.STATE_INVISIBLE
nsIAccessibleStates.STATE_OFFSCREEN
);
} finally {
await BrowserTestUtils.closeWindow(win);

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

@ -32,7 +32,7 @@ async function waitForIFrameUpdates() {
// A utility function to test the state of |elementId| element in out-of-process
// |browsingContext|.
async function spawnTestStates(browsingContext, elementId, expectedStates) {
function testStates(id, expected, unexpected) {
function testStates(id, expected) {
const acc = SpecialPowers.Cc[
"@mozilla.org/accessibilityService;1"
].getService(SpecialPowers.Ci.nsIAccessibilityService);
@ -44,7 +44,6 @@ async function spawnTestStates(browsingContext, elementId, expectedStates) {
} else {
Assert.ok(state.value & expected);
}
Assert.ok(!(state.value & unexpected));
}
await SpecialPowers.spawn(
browsingContext,

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

@ -1,3 +0,0 @@
<!DOCTYPE html>
<meta charset=utf-8>
<div id="target">target</div>

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

@ -1,10 +0,0 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
title="XUL elements visibility states testing">
<deck id="deck" selectedIndex="0">
<iframe id="first" flex="1"/>
<iframe id="second" flex="1"/>
</deck>
</window>

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

@ -10420,7 +10420,6 @@ Maybe<MotionPathData> nsLayoutUtils::ResolveMotionPath(const nsIFrame* aFrame) {
MotionPathData{point - anchorPoint.ToUnknownPoint(), angle, shift});
}
// NOTE: Returns Nothing() if |aFrame| is not in out-of-process.
static Maybe<ScreenRect> GetFrameVisibleRectOnScreen(const nsIFrame* aFrame) {
// We actually want the in-process top prescontext here.
nsPresContext* topContextInProcess =
@ -10444,7 +10443,7 @@ static Maybe<ScreenRect> GetFrameVisibleRectOnScreen(const nsIFrame* aFrame) {
if (!browserChild->GetEffectsInfo().IsVisible()) {
// There is no visible rect on this iframe at all.
return Some(ScreenRect());
return Nothing();
}
nsIFrame* rootFrame = topContextInProcess->PresShell()->GetRootFrame();