Add new SVGDOM SVGFEBLEND constants
[WebKit-https.git] / LayoutTests / swipe / wheel-event-initiated-back-navigation.html
1 <html>
2 <head>
3 <script>
4
5 function logResult(s) {
6     document.getElementById('result').textContent += s + "\n";
7 }
8
9 function backSwipe()
10 {
11     var divTarget = document.getElementById('content');
12     var documentBounds = divTarget.getBoundingClientRect();
13     
14     eventSender.mouseMoveTo(documentBounds.left + 10, documentBounds.top + 10);
15     eventSender.mouseScrollByWithWheelAndMomentumPhases(100, 0, 'began', 'none');
16     eventSender.mouseScrollByWithWheelAndMomentumPhases(100, 0, 'changed', 'none');
17     eventSender.mouseScrollByWithWheelAndMomentumPhases(100, 0, 'changed', 'none');
18     eventSender.mouseScrollByWithWheelAndMomentumPhases(100, 0, 'ended', 'none');
19 }
20
21 function startTest()
22 {
23     if (!window.eventSender) {
24         logResult('This test must be run in DumpRenderTree/WebKitTestRunner (no eventSender)');
25         return;
26     }
27
28     if (!window.testRunner) {
29         logResult('This test must be run in DumpRenderTree/WebKitTestRunner (no testRunner)');
30         return;
31     }
32
33     testRunner.dumpAsText();
34     testRunner.waitUntilDone();
35     testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
36     testRunner.setNavigationGesturesEnabled(true);
37
38     window.onpopstate = function(event) {
39         logResult('PASS: mouseWheel caused navigation');
40         if (event.state.name == "page1") {
41             logResult('PASS: navigated back to ' + event.state.name);
42         } else {
43             logResult('FAILED: navigated back to ' + event.state.name);
44         }
45         testRunner.notifyDone();
46     };
47
48     var stateObj = { name: "page1" };
49     history.replaceState(stateObj, "page1", "");
50
51     var stateObj = { name: "page2" };
52     history.pushState(stateObj, "page2", "");
53
54     backSwipe();
55 }
56
57 window.addEventListener('load', startTest, false);
58
59 </script>
60 </head>
61 <body id="content">
62
63 <h1>This is a swipe navigation test.</h1>
64
65 <pre id="result"></pre>
66
67 </body>
68 </html>