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> |