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

Unified Diff: third_party/WebKit/LayoutTests/fast/history/scroll-restoration/scroll-restoration-scale-not-impacted.html

Issue 1424593002: Update layout tests to use internals.visualViewport APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: undo delete test that depends on "inert-visual-viewport" flag Created 5 years, 2 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: third_party/WebKit/LayoutTests/fast/history/scroll-restoration/scroll-restoration-scale-not-impacted.html
diff --git a/third_party/WebKit/LayoutTests/fast/history/scroll-restoration/scroll-restoration-scale-not-impacted.html b/third_party/WebKit/LayoutTests/fast/history/scroll-restoration/scroll-restoration-scale-not-impacted.html
index 6d076424005b5d67837681807debf6c4e8af1971..f85418934c9575b76045b0f7be5d6ff120ec1d65 100644
--- a/third_party/WebKit/LayoutTests/fast/history/scroll-restoration/scroll-restoration-scale-not-impacted.html
+++ b/third_party/WebKit/LayoutTests/fast/history/scroll-restoration/scroll-restoration-scale-not-impacted.html
@@ -17,9 +17,10 @@
document.body.offsetTop; // force layout
if (window.name != 'verification') {
assert_array_equals([window.innerWidth, window.innerHeight], [800, 600], 'initial page size is valid');
- if (window.internals)
+ if (window.internals) {
window.internals.setPageScaleFactor(2);
- assert_array_equals([window.innerWidth, window.innerHeight], [400, 300], 'page is scaled');
+ assert_array_equals([internals.visualViewportWidth(), internals.visualViewportHeight()], [400, 300], 'page is scaled');
+ }
history.scrollRestoration = 'manual';
window.scrollTo(100, 200);
@@ -31,7 +32,7 @@
window.location = "data:text/html,<script>history.back();</scr" + "ipt>";
}, 0);
} else {
- assert_array_equals([window.innerWidth, window.innerHeight], [400, 300], 'page scale is restored');
+ assert_array_equals([internals.visualViewportWidth(), internals.visualViewportHeight()], [400, 300], 'page scale is restored');
assert_array_equals([window.scrollX, window.scrollY], [0, 0], 'scroll position is not restored');
// clean up
window.name = '';
@@ -41,4 +42,4 @@
}
}));
}, 'Setting scrollRestoration to manual should not affect scale restoration');
-</script>
+</script>

Powered by Google App Engine
This is Rietveld 408576698