зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1675349: Update tests under layout/base for the removal of plugins. r=jmathies
UPDATED ------- layout/base/tests/test_bug629838.html bug 629838 Make sure MozPaintCount and MozAfterPaint are in sync, even with empty transactions Switch to a <div> and use CSS. MozPaintCount is otherwise largely untested. layout/base/tests/test_mozPaintCount.html bug 563864 Test MozPaintCount. Switch to a <div> and use CSS. REMOVED ------- layout/base/tests/chrome/test_chrome_over_plugin.xhtml Test that plugins are properly clipped wrt translucent chrome elements and not by translucent content elements. Differential Revision: https://phabricator.services.mozilla.com/D95913
This commit is contained in:
Родитель
b29b36b6cf
Коммит
8c7f8843d1
|
@ -73,10 +73,6 @@ support-files =
|
|||
bug1041200_frame.html
|
||||
bug1041200_window.html
|
||||
[test_chrome_content_integration.xhtml]
|
||||
[test_chrome_over_plugin.xhtml]
|
||||
support-files =
|
||||
chrome_over_plugin_window.xhtml
|
||||
chrome_over_plugin_window_frame.html
|
||||
[test_default_background.xhtml]
|
||||
[test_dialog_with_positioning.html]
|
||||
tags = openwindow
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
|
||||
<window title="Content/chrome integration subwindow"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="runTests()">\
|
||||
<!-- We're mainly testing that a) translucent chrome elements cause the plugin to be clipped away and
|
||||
b) translucent content elements do NOT cause the plugin to be clipped away -->
|
||||
<stack style="height:100px; width:150px;">
|
||||
<iframe type="content" style="border:none;" id="f"
|
||||
src="http://example.org/chrome/layout/base/tests/chrome/chrome_over_plugin_window_frame.html"/>
|
||||
<vbox>
|
||||
<vbox style="height:25px; background:yellow;"/> <!-- plugin should be covered here -->
|
||||
<vbox style="height:25px; background:rgba(0,128,0,0.5);"/> <!-- plugin should be covered here -->
|
||||
<vbox style="height:50px;"/> <!-- plugin should be visible here -->
|
||||
</vbox>
|
||||
</stack>
|
||||
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
var imports = [ "SimpleTest", "is", "isnot", "ok", "todo" ];
|
||||
for (var name of imports) {
|
||||
window[name] = window.arguments[0][name];
|
||||
}
|
||||
|
||||
var plugin;
|
||||
function waitForPaint() {
|
||||
if (plugin.getPaintCount() < 1) {
|
||||
setTimeout(waitForPaint, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (plugin.hasWidget()) {
|
||||
is(plugin.getClipRegionRectCount(), 1, "plugin clip rect count");
|
||||
var left = plugin.getEdge(0);
|
||||
var top = plugin.getEdge(1);
|
||||
is(plugin.getClipRegionRectEdge(0,0) - left, 0, "plugin clip rect left");
|
||||
// our two vboxes with backgrounds should cause the top of the plugin to be clipped
|
||||
is(plugin.getClipRegionRectEdge(0,1) - top, 50, "plugin clip rect top");
|
||||
is(plugin.getClipRegionRectEdge(0,2) - left, 100, "plugin clip rect right");
|
||||
// of the two content DIVs, the first one should not cause the plugin to be clipped because
|
||||
// it's transparent. The second one should cause the plugin to be clipped.
|
||||
is(plugin.getClipRegionRectEdge(0,3) - top, 90, "plugin clip rect bottom");
|
||||
} else {
|
||||
todo(false, "Test only tests windowed plugins");
|
||||
}
|
||||
|
||||
var tester = window.SimpleTest;
|
||||
window.close();
|
||||
tester.finish();
|
||||
}
|
||||
|
||||
function runTests() {
|
||||
plugin = document.getElementById("f").contentDocument.getElementById("e").wrappedJSObject;
|
||||
waitForPaint();
|
||||
}
|
||||
]]>
|
||||
</script>
|
||||
</window>
|
|
@ -1,4 +0,0 @@
|
|||
<embed id="e" type="application/x-test" wmode="window"
|
||||
style="position:absolute;left:0;top:0;width:100px;height:100px"></embed>
|
||||
<div style="position:absolute;left:0;top:80px;width:100px;height:10px;background:rgba(0,0,128,0.5)"></div>
|
||||
<div style="position:absolute;left:0;top:90px;width:100px;height:10px;background:blue"></div>
|
|
@ -1,24 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
|
||||
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
|
||||
type="text/css"?>
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
|
||||
<!-- test results are displayed in the html:body -->
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
</body>
|
||||
|
||||
<!-- test code goes here -->
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
// Run the test in a separate window so that the test runs as a chrome
|
||||
// window
|
||||
SpecialPowers.setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
|
||||
var w = window.openDialog("chrome_over_plugin_window.xhtml", "chrome_over_plugin",
|
||||
"chrome,width=200,height=300,noopener", window);
|
||||
]]>
|
||||
</script>
|
||||
</window>
|
|
@ -3,16 +3,11 @@
|
|||
<head>
|
||||
<title>Tests for MozAfterPaint</title>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="plugin-utils.js"></script>
|
||||
<script type="application/javascript">
|
||||
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
|
||||
</script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<p id="display">
|
||||
<embed type="application/x-test" width="100" height="100" id="p"
|
||||
drawmode="solid" color="FF00FF00"></embed>
|
||||
<div width="100" height="100" id="p" style="background-color: rgb(0,0,0)"/>
|
||||
</p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
@ -46,24 +41,19 @@ document.addEventListener("DOMContentLoaded", startTest, true);
|
|||
// Instead, wait for a minimum number of afterPaint events to at least ensure that they are being fired.
|
||||
const minimumAfterPaintsToPass = 10;
|
||||
|
||||
function doPluginFlicker() {
|
||||
ok(true, "Plugin color iteration " + color +
|
||||
function doElementFlicker() {
|
||||
ok(true, "Element color iteration " + color +
|
||||
", afterpaint count: " + afterPaintCount +
|
||||
", mozpaint count: " + SpecialPowers.DOMWindowUtils.paintCount);
|
||||
if (afterPaintCount >= minimumAfterPaintsToPass) {
|
||||
ok(true, "afterPaintCount incremented enough from plugin color changes.");
|
||||
ok(true, "afterPaintCount incremented enough from color changes.");
|
||||
SimpleTest.finish();
|
||||
return;
|
||||
}
|
||||
|
||||
color = (color + 1) % 256;
|
||||
var str = color.toString(16);
|
||||
if (str.length < 2) {
|
||||
str = "0" + str;
|
||||
}
|
||||
str = "FF" + str + str + str;
|
||||
document.getElementById("p").setColor(str);
|
||||
setTimeout(doPluginFlicker, 0);
|
||||
document.getElementById("p").style.backgroundColor = "rgb(" + color + "," + color + "," + color + ")";
|
||||
setTimeout(doElementFlicker, 0);
|
||||
}
|
||||
|
||||
function doBackgroundFlicker() {
|
||||
|
@ -74,7 +64,7 @@ function doBackgroundFlicker() {
|
|||
ok(true, "afterPaintCount incremented enough from background color changes.");
|
||||
afterPaintCount = 0;
|
||||
initialPaintCount = SpecialPowers.DOMWindowUtils.paintCount;
|
||||
doPluginFlicker();
|
||||
doElementFlicker();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,16 +3,11 @@
|
|||
<head>
|
||||
<title>Tests for DOMWindowUtils.paintCount</title>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="plugin-utils.js"></script>
|
||||
<script type="application/javascript">
|
||||
setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
|
||||
</script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body onload="doBackgroundFlicker()">
|
||||
<p id="display">
|
||||
<embed type="application/x-test" width="100" height="100" id="p"
|
||||
drawmode="solid" color="FF00FF00"></embed>
|
||||
<div width="100" height="100" id="p" style="background-color: rgb(0,0,0)"/>
|
||||
</p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
@ -26,7 +21,7 @@ var startPaintCount = SpecialPowers.DOMWindowUtils.paintCount;
|
|||
ok(true, "Got to initial paint count: " + startPaintCount);
|
||||
var color = 0;
|
||||
|
||||
function doPluginFlicker() {
|
||||
function doElementFlicker() {
|
||||
ok(true, "Plugin color iteration " + color + ", paint count: " + SpecialPowers.DOMWindowUtils.paintCount);
|
||||
if (SpecialPowers.DOMWindowUtils.paintCount - startPaintCount > 20) {
|
||||
ok(true, "Got enough paints from plugin color changes");
|
||||
|
@ -35,13 +30,8 @@ function doPluginFlicker() {
|
|||
}
|
||||
|
||||
color = (color + 1) % 256;
|
||||
var str = color.toString(16);
|
||||
if (str.length < 2) {
|
||||
str = "0" + str;
|
||||
}
|
||||
str = "FF" + str + str + str;
|
||||
document.getElementById("p").setColor(str);
|
||||
setTimeout(doPluginFlicker, 0);
|
||||
document.getElementById("p").style.backgroundColor = "rgb(" + color + "," + color + "," + color + ")";
|
||||
setTimeout(doElementFlicker, 0);
|
||||
}
|
||||
|
||||
function doBackgroundFlicker() {
|
||||
|
@ -49,7 +39,7 @@ function doBackgroundFlicker() {
|
|||
if (SpecialPowers.DOMWindowUtils.paintCount - startPaintCount > 20) {
|
||||
ok(true, "Got enough paints from background color changes");
|
||||
startPaintCount = SpecialPowers.DOMWindowUtils.paintCount;
|
||||
doPluginFlicker();
|
||||
doElementFlicker();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче