Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Unified Diff: LayoutTests/scrollingcoordinator/non-fast-scrollable-region-scaled-iframe.html

Issue 878573004: Increase reliablity of scorllingcoordinator layout tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update test expectation Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/scrollingcoordinator/non-fast-scrollable-region-scaled-iframe.html
diff --git a/LayoutTests/scrollingcoordinator/non-fast-scrollable-region-scaled-iframe.html b/LayoutTests/scrollingcoordinator/non-fast-scrollable-region-scaled-iframe.html
index b70bdcc79fb4c42902e7b588a670010f7ba8df50..0ae1f19b4017182c24ab798c11557964e9327284 100644
--- a/LayoutTests/scrollingcoordinator/non-fast-scrollable-region-scaled-iframe.html
+++ b/LayoutTests/scrollingcoordinator/non-fast-scrollable-region-scaled-iframe.html
@@ -1,10 +1,40 @@
<!DOCTYPE html>
-<html>
-<head>
+<style>
+ iframe {
+ position: absolute;
+ left: 100px;
+ top: 100px;
+ height: 120px;
+ width: 120px;
+ padding: 10px;
+ border: none;
+ }
+</style>
+
+<iframe src="data:text/html;charset=utf-8,<html><body style='width:1000px;height:1000px;'>Should be covered by a green overlay.</body></html>"></iframe>
+<div id="console"></div>
+
+<script src="../resources/js-test.js"></script>
<script src="resources/non-fast-scrollable-region-testing.js"></script>
-</head>
-<body onload="runNonFastScrollableRegionTest(2);">
-<iframe src="data:text/html;charset=utf-8,<html><body style='width:1000px;height:1000px;'></body></html>" style="position:absolute;left:50px;top:50px;width;150px;height:200px;padding:10px;"></iframe>
-</body>
-</html>
+<script>
+ window.jsTestIsAsync = true;
+ description('This test ensures non-fast scrollable areas are calculated ' +
+ 'correctly when page is scaled.');
+
+ onload = function() {
+ if (window.eventSender)
+ window.eventSender.setPageScaleFactor(2, 0, 0);
+ else
+ testFailed('This test requires window.eventSender.setPageScaleFactor to be available.');
+
+ awaitCompsitingUpdate(function(){
+ nonFastScrollableRects = window.internals.nonFastScrollableRects(document);
+ shouldBe('nonFastScrollableRects.length', '1');
+ shouldBeEqualToString('rectToString(nonFastScrollableRects[0])', '[110, 110, 120, 120]');
+
+ drawNonFastScrollableRegionOverlays();
+ finishJSTest();
+ });
+ };
+</script>

Powered by Google App Engine
This is Rietveld 408576698