Bug 1936189. Move reftest layout/reftests/native-theme/470711-1.xhtml to be a browser chrome test. r=dshin
As it uses chrome features that we only want to support in the parent process. Differential Revision: https://phabricator.services.mozilla.com/D244576
This commit is contained in:
@@ -76,6 +76,12 @@ support-files = [
|
||||
"helper_oopif_reconstruct_nested_grandchild.html",
|
||||
]
|
||||
|
||||
["browser_test_tabpanels.js"]
|
||||
support-files = [
|
||||
"470711-1.xhtml",
|
||||
"470711-1-ref.xhtml"
|
||||
]
|
||||
|
||||
["browser_visual_viewport_iframe.js"]
|
||||
support-files = [
|
||||
"test_visual_viewport_in_oopif.html",
|
||||
|
||||
55
layout/base/tests/browser_test_tabpanels.js
Normal file
55
layout/base/tests/browser_test_tabpanels.js
Normal file
@@ -0,0 +1,55 @@
|
||||
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* vim: set sts=2 sw=2 et tw=80: */
|
||||
/* This test is based on
|
||||
https://searchfox.org/mozilla-central/rev/380b8fd795e7d96d8a5a3e6ec2b50a9f2b65854a/layout/base/tests/browser_test_oopif_reconstruct.js
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
Services.scriptloader.loadSubScript(
|
||||
"chrome://mochitests/content/browser/gfx/layers/apz/test/mochitest/apz_test_utils.js",
|
||||
this
|
||||
);
|
||||
|
||||
async function runOneTest(filename) {
|
||||
function chromeURL(sfilename) {
|
||||
let result = getRootDirectory(gTestPath) + sfilename;
|
||||
return result;
|
||||
}
|
||||
|
||||
const url = chromeURL(filename);
|
||||
const tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url);
|
||||
|
||||
const { rect } = await SpecialPowers.spawn(
|
||||
tab.linkedBrowser,
|
||||
[],
|
||||
async () => {
|
||||
const container = content.document.documentElement;
|
||||
|
||||
// Get the area in the screen coords of the tab.
|
||||
let containerRect = container.getBoundingClientRect();
|
||||
containerRect.x += content.window.mozInnerScreenX;
|
||||
containerRect.y += content.window.mozInnerScreenY;
|
||||
|
||||
return {
|
||||
rect: containerRect,
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
const reference = await getSnapshot({
|
||||
x: rect.x,
|
||||
y: rect.y,
|
||||
width: rect.width,
|
||||
height: rect.height,
|
||||
});
|
||||
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
return reference;
|
||||
}
|
||||
|
||||
add_task(async () => {
|
||||
let snapshot1 = await runOneTest("470711-1.xhtml");
|
||||
let snapshot2 = await runOneTest("470711-1-ref.xhtml");
|
||||
is(snapshot1, snapshot1, "should be same");
|
||||
});
|
||||
@@ -27,7 +27,6 @@ needs-focus == listbox-nonnative-when-styled.html listbox-nonnative-when-styled-
|
||||
|
||||
!= 427122-1.html 427122-1-ref.html
|
||||
|
||||
== chrome://reftest/content/native-theme/470711-1.xhtml chrome://reftest/content/native-theme/470711-1-ref.xhtml
|
||||
== chrome://reftest/content/native-theme/482955-1.xhtml chrome://reftest/content/native-theme/482955-1-ref.xhtml
|
||||
|
||||
== 492155-1.html about:blank
|
||||
|
||||
Reference in New Issue
Block a user