Bug 1255022 - Make the test_transformed_scrolling_repaints* tests mochitest-plain instead of mochitest-chrome. r=mstange
MozReview-Commit-ID: F0CiZlIrWuk
--- a/layout/base/tests/chrome/chrome.ini
+++ b/layout/base/tests/chrome/chrome.ini
@@ -11,17 +11,16 @@ support-files =
dialog_with_positioning_window.xul
no_clip_iframe_subdoc.html
no_clip_iframe_window.xul
passpointerevents_window.html
passpointerevents_dynamically_window.html
printpreview_bug396024_helper.xul
printpreview_bug482976_helper.xul
printpreview_helper.xul
- transformed_scrolling_repaints_3_window.html
file_bug1018265.xul
[test_bug370436.html]
skip-if = buildapp == 'b2g'
[test_bug396367-1.html]
[test_bug396367-2.html]
[test_bug420499.xul]
skip-if = buildapp == 'b2g'
@@ -68,16 +67,10 @@ skip-if = buildapp == 'b2g'
[test_printpreview.xul]
skip-if = buildapp == 'b2g'
[test_printpreview_bug396024.xul]
skip-if = buildapp == 'b2g'
[test_printpreview_bug482976.xul]
skip-if = buildapp == 'b2g'
[test_scrolling_repaints.html]
skip-if = buildapp == 'b2g'
-[test_transformed_scrolling_repaints.html]
-skip-if = buildapp == 'b2g'
-[test_transformed_scrolling_repaints_2.html]
-skip-if = buildapp == 'b2g'
-[test_transformed_scrolling_repaints_3.html]
-skip-if = buildapp == 'b2g'
[test_will_change.html]
skip-if = buildapp == 'b2g'
--- a/layout/base/tests/mochitest.ini
+++ b/layout/base/tests/mochitest.ini
@@ -47,16 +47,17 @@ support-files =
bug1259949-1-ref.html
bug1259949-2.html
bug1259949-2-ref.html
selection-utils.js
multi-range-user-select.html
multi-range-user-select-ref.html
multi-range-script-select.html
multi-range-script-select-ref.html
+ transformed_scrolling_repaints_3_window.html
[test_preserve3d_sorting_hit_testing.html]
[test_preserve3d_sorting_hit_testing2.html]
[test_after_paint_pref.html]
[test_bug993936.html]
skip-if = e10s
[test_border_radius_hit_testing.html]
[test_bug66619.html]
@@ -274,8 +275,14 @@ skip-if = buildapp == 'android' || build
support-files = bug1153130_inner.html
[test_bug1162990.html]
support-files =
bug1162990_inner_1.html
bug1162990_inner_2.html
[test_bug1226904.html]
support-files = bug1226904.html
[test_bug1246622.html]
+[test_transformed_scrolling_repaints.html]
+skip-if = buildapp == 'b2g'
+[test_transformed_scrolling_repaints_2.html]
+skip-if = buildapp == 'b2g'
+[test_transformed_scrolling_repaints_3.html]
+skip-if = buildapp == 'b2g'
rename from layout/base/tests/chrome/test_transformed_scrolling_repaints.html
rename to layout/base/tests/test_transformed_scrolling_repaints.html
--- a/layout/base/tests/chrome/test_transformed_scrolling_repaints.html
+++ b/layout/base/tests/test_transformed_scrolling_repaints.html
@@ -1,57 +1,43 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test that scaled elements with scrolled contents don't repaint unnecessarily when we scroll inside them</title>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/paint_listener.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
+ <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+ <script type="text/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="setPrefAndStartTest()">
<div id="t" style="-moz-transform: scale(1.2, 1.2); -moz-transform-origin:top left; width:200px; height:100px; background:yellow; overflow:hidden">
<div style="height:40px;">Hello</div>
<div id="e" style="height:30px; background:lime">Kitty</div>
<div style="height:300px; background:yellow">Kitty</div>
</div>
<pre id="test">
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
var t = document.getElementById("t");
var e = document.getElementById("e");
-var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
- getInterface(Components.interfaces.nsIDOMWindowUtils);
-const isLinux = navigator.platform.indexOf("Linux") >= 0;
-const is64 = navigator.platform.indexOf("x86_64") >= 0;
-var winLowerThanVista = navigator.platform.indexOf("Win") == 0;
-if (winLowerThanVista) {
- var version = Components.classes["@mozilla.org/system-info;1"]
- .getService(Components.interfaces.nsIPropertyBag2)
- .getProperty("version");
- winLowerThanVista = parseFloat(version) < 6.0;
-}
+var utils = SpecialPowers.getDOMWindowUtils(window);
function startTest() {
// Do a couple of scrolls to ensure we've triggered activity heuristics.
waitForAllPaintsFlushed(function () {
t.scrollTop = 5;
waitForAllPaintsFlushed(function () {
t.scrollTop = 10;
waitForAllPaintsFlushed(function () {
// Clear paint state now and scroll again.
utils.checkAndClearPaintedState(e);
t.scrollTop = 15;
waitForAllPaintsFlushed(function () {
var painted = utils.checkAndClearPaintedState(e);
- if ((isLinux && !is64) || winLowerThanVista) {
- todo(false, "Fully-visible scrolled element should not have been painted (random on Linux-32)");
- } else {
- is(painted, false, "Fully-visible scrolled element should not have been painted");
- }
+ is(painted, false, "Fully-visible scrolled element should not have been painted");
SimpleTest.finish();
});
});
});
});
}
function setPrefAndStartTest() {
SpecialPowers.pushPrefEnv(
rename from layout/base/tests/chrome/test_transformed_scrolling_repaints_2.html
rename to layout/base/tests/test_transformed_scrolling_repaints_2.html
--- a/layout/base/tests/chrome/test_transformed_scrolling_repaints_2.html
+++ b/layout/base/tests/test_transformed_scrolling_repaints_2.html
@@ -1,30 +1,29 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test that scaled elements with scrolled contents don't repaint unnecessarily when we scroll inside them (1.1 scale)</title>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/paint_listener.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
+ <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+ <script type="text/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body onload="setPrefAndStartTest()">
<div id="t" style="-moz-transform: scale(1.1, 1.1); -moz-transform-origin:top left; width:200px; height:100px; background:yellow; overflow:hidden">
<div style="height:40px;"></div>
<div id="e" style="height:30px; background:lime"></div>
<div style="height:300px; background:yellow"></div>
</div>
<pre id="test">
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
var t = document.getElementById("t");
var e = document.getElementById("e");
-var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
- getInterface(Components.interfaces.nsIDOMWindowUtils);
+var utils = SpecialPowers.getDOMWindowUtils(window);
function startTest() {
// Do a couple of scrolls to ensure we've triggered activity heuristics
waitForAllPaintsFlushed(function () {
t.scrollTop = 5;
waitForAllPaintsFlushed(function () {
t.scrollTop = 10;
waitForAllPaintsFlushed(function () {
rename from layout/base/tests/chrome/test_transformed_scrolling_repaints_3.html
rename to layout/base/tests/test_transformed_scrolling_repaints_3.html
--- a/layout/base/tests/chrome/test_transformed_scrolling_repaints_3.html
+++ b/layout/base/tests/test_transformed_scrolling_repaints_3.html
@@ -1,26 +1,24 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test that scaled elements with scrolled contents don't repaint unnecessarily when we scroll inside them</title>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/chrome-harness.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
+ <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<!-- Need a timeout here to allow paint unsuppression before we start the test -->
<body>
<pre id="test">
<script type="application/javascript">
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv(
{"set": [["layers.single-tile.enabled", false]]},
function() {
- var root = getRootDirectory(window.location.href);
- window.open(root + "transformed_scrolling_repaints_3_window.html", "transformed_scrolling_repaints_3",
+ window.open("transformed_scrolling_repaints_3_window.html", "transformed_scrolling_repaints_3",
"chrome,width=300,height=400");
}
);
</script>
</pre>
</body>
</html>
rename from layout/base/tests/chrome/transformed_scrolling_repaints_3_window.html
rename to layout/base/tests/transformed_scrolling_repaints_3_window.html
--- a/layout/base/tests/chrome/transformed_scrolling_repaints_3_window.html
+++ b/layout/base/tests/transformed_scrolling_repaints_3_window.html
@@ -1,13 +1,13 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test that scaled elements with scrolled contents don't repaint unnecessarily when we scroll inside them</title>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/paint_listener.js"></script>
+ <script type="text/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
</head>
<!-- Need a timeout here to allow paint unsuppression before we start the test -->
<body onload="setTimeout(startTest,0)" style="background:white;">
<iframe id="t" style="-moz-transform: scale(0.48979); -moz-transform-origin:top left; width:500px; height:300px;"
src="data:text/html,
<body style='background:yellow;'>
<p>My graduate adviser was the most patient, understanding, and helpful
person I've ever had the joy of dealing with. That doesn't change that
@@ -31,31 +31,30 @@ there are some real dicks out there, and
scientists.
<p>My graduate adviser was the most patient, understanding, and helpful
person I've ever had the joy of dealing with. That doesn't change that
there are some real dicks out there, and some of them happen to be
scientists.
</body>"></iframe>
<pre id="test">
<script type="application/javascript">
-var SimpleTest = window.opener.wrappedJSObject.SimpleTest;
-var SpecialPowers = window.opener.wrappedJSObject.SpecialPowers;
-var is = window.opener.wrappedJSObject.is;
+var SimpleTest = window.opener.SimpleTest;
+var SpecialPowers = window.opener.SpecialPowers;
+var is = window.opener.is;
var t, e, utils, iterations;
var smoothScrollPref = "general.smoothScroll";
function startTest() {
SpecialPowers.pushPrefEnv({"set":[[smoothScrollPref, false]]}, runTest);
}
function runTest() {
t = document.getElementById("t");
e = t.contentDocument.getElementById("e");
t.contentWindow.scrollTo(0,0);
- utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
- getInterface(Components.interfaces.nsIDOMWindowUtils);
+ utils = SpecialPowers.getDOMWindowUtils(window);
iterations = 0;
// Do a couple of scrolls to ensure we've triggered activity heuristics.
waitForAllPaintsFlushed(function () {
t.contentWindow.scrollByLines(1);
waitForAllPaintsFlushed(function () {
t.contentWindow.scrollByLines(1);
waitForAllPaintsFlushed(function () {