Add @page margin support
[WebKit-https.git] / LayoutTests / swipe / pushstate-with-manual-scrollrestoration.html
1 <head>
2 <style>
3 html {
4     font-size: 32pt;
5 }
6 </style>
7 <script src="resources/swipe-test.js"></script>
8 <script>
9 history.scrollRestoration = "manual";
10
11 function didBeginSwipeCallback()
12 {
13     log("didBeginSwipe");
14
15     completeSwipeGesture();
16 }
17
18 function didEndSwipeCallback()
19 {
20     log("didEndSwipe");
21
22     startMeasuringDuration("snapshotRemoval");
23 }
24
25 function didRemoveSwipeSnapshotCallback()
26 {
27     log("didRemoveSwipeSnapshot");
28
29     measuredDurationShouldBeLessThan("snapshotRemoval", 1000, "Because we're using the page cache, it shouldn't be long between the gesture completing and the snapshot being removed.")
30
31     testComplete();
32 }
33
34 window.onload = function () {
35     if (!window.eventSender || !window.testRunner) {
36         document.body.innerHTML = "This test must be run in WebKitTestRunner.";
37         return;
38     }
39
40     initializeSwipeTest();
41
42     testRunner.installDidBeginSwipeCallback(didBeginSwipeCallback);
43     testRunner.installDidEndSwipeCallback(didEndSwipeCallback);
44     testRunner.installDidRemoveSwipeSnapshotCallback(didRemoveSwipeSnapshotCallback);
45
46     testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
47     testRunner.dumpAsText();
48     testRunner.waitUntilDone();
49
50     setTimeout(function () {
51         history.pushState({page: "second"}, "second", "?second");
52         document.body.innerHTML = "second";
53         startSwipeGesture();
54     }, 0);
55 };
56 </script>
57 </head>
58 <body>
59 first
60 </body>