Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/scrolling/same-page-navigate.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/scrolling/same-page-navigate.html b/third_party/WebKit/LayoutTests/fast/scrolling/same-page-navigate.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6ec3ee8f22d154bc8b4a8c5471662c5359a8798a |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/scrolling/same-page-navigate.html |
| @@ -0,0 +1,235 @@ |
| +<!DOCTYPE html> |
| + |
| +<style> |
| + |
| +body { |
| + height: 800px; |
| + width: 600px; |
|
bokan
2016/09/14 21:38:11
Nit: unnecessary tab
|
| +} |
| +</style> |
| + |
| +<pre> |
| +<a href="./same-page-navigate.html" id="same-page-0">link to self html</a> |
| +<a href="#1">goto 1</a> <a href="#2">goto 2</a> <a href="#3">goto 3</a> <a href="#4">goto 4</a> <a href="#5">goto 5</a> <a href="#6">goto 6</a> |
| + |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
|
bokan
2016/09/14 21:38:11
All this space and other links are just adding unn
|
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +<a name="1">1 |
| +<a href="./same-page-navigate.html" id="same-page-1">link to self html</a> |
| +<a href="#1">goto 1</a> <a href="#2">goto 2</a> <a href="#3">goto 3</a> <a href="#4">goto 4</a> <a href="#5">goto 5</a> <a href="#6">goto 6</a> |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +<a name="2">2 |
| +<a href="./same-page-navigate.html" id="same-page-2">link to self html</a> |
| +<a href="#1">goto 1</a> <a href="#2">goto 2</a> <a href="#3">goto 3</a> <a href="#4">goto 4</a> <a href="#5">goto 5</a> <a href="#6">goto 6</a> |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +<a name="3">3 |
| +<a href="./same-page-navigate.html" id="same-page-3">link to self html</a> |
| +<a href="#1">goto 1</a> <a href="#2">goto 2</a> <a href="#3">goto 3</a> <a href="#4">goto 4</a> <a href="#5">goto 5</a> <a href="#6">goto 6</a> |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +<a name="4">4 |
| +<a href="./same-page-navigate.html" id="same-page-4">link to self html</a> |
| +<a href="#1">goto 1</a> <a href="#2">goto 2</a> <a href="#3">goto 3</a> <a href="#4">goto 4</a> <a href="#5">goto 5</a> <a href="#6">goto 6</a> |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +<a name="5">5 |
| +<a href="./same-page-navigate.html" id="same-page-5">link to self html</a> |
| +<a href="#1">goto 1</a> <a href="#2">goto 2</a> <a href="#3">goto 3</a> <a href="#4">goto 4</a> <a href="#5">goto 5</a> <a href="#6">goto 6</a> |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +. |
| +<a name="6">6 |
| +<a href="./same-page-navigate.html" id="same-page-6">link to self html</a> |
| +<a href="#1">goto 1</a> <a href="#2">goto 2</a> <a href="#3">goto 3</a> <a href="#4">goto 4</a> <a href="#5">goto 5</a> <a href="#6">goto 6</a> |
| + |
| + |
| + |
| + |
| +<a href="./same-page-navigate.html" id="same-page-bottom">link to self html</a> |
| +</pre> |
| + |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| + |
| +<script> |
| + |
| +// Ensure that the scroll position is correct when we navigate to same page after scale(zoom-in/zoom-out) |
| +// crbug.com/642279 |
| +test(function() { |
| + |
| + console.log(innerWidth); |
| + |
| + // exit in second load, using innerWidth to detect scale |
| + if (innerWidth < 800) { |
| + assert_equals(scrollX, 0); |
| + assert_equals(scrollY, 0); |
| + return; |
|
bokan
2016/09/14 21:38:11
Did the `waitUntilDone` and `notifyDone` methods n
chaopeng
2016/09/15 00:15:21
Yes, async test will give "missing actual" but I c
|
| + } |
| + |
| + window.internals.setPageScaleFactor(2); |
| + scrollTo(0, 10000); |
| + |
| + var atag = document.getElementById('same-page-bottom'); |
| + |
| + var x = (atag.offsetLeft - scrollX + 1) * 2; |
| + var y = (atag.offsetTop - scrollY + 1) * 2; |
| + eventSender.mouseMoveTo(x, y); |
| + eventSender.mouseDown(); |
| + eventSender.mouseUp(); |
| +}, 'Ensure that the scroll position is correct when we navigate to same page after scale(zoom-in/zoom-out)'); |
| + |
| +</script> |
| + |
| + |
| + |