[WPE] run-qt-wpe-minibrowser needlessly expects a --wpe argument
[WebKit-https.git] / LayoutTests / fast / events / touch / ios / iphone7 / force-press-on-link.html
1 <!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
2
3 <html>
4 <head>
5     <script>
6         if (window.testRunner) {
7             testRunner.dumpAsText();
8             testRunner.waitUntilDone();
9         }
10
11         function getUIScript()
12         {
13             return `
14             (function() {
15                 var eventStream = {
16                     events : [
17                         {
18                             interpolate : "linear",
19                             timestep: 0.025,
20                             startEvent : {
21                                 inputType : "hand",
22                                 timeOffset : 0,
23                                 touches : [
24                                     {
25                                         inputType : "finger",
26                                         phase : "began",
27                                         id : 1,
28                                         x : 20,
29                                         y : 40,
30                                         pressure : 0
31                                     }
32                                 ]
33                             },
34                             endEvent : {
35                                 inputType : "hand",
36                                 timeOffset : 3.0,
37                                 touches : [
38                                     {
39                                         inputType : "finger",
40                                         phase : "stationary",
41                                         id : 1,
42                                         x : 20,
43                                         y : 40,
44                                         pressure : 500
45                                     }
46                                 ]
47                             }
48                         }
49                     ]
50                 };
51
52                 uiController.sendEventStream(JSON.stringify(eventStream), function() {});
53              
54                 uiController.didShowForcePressPreviewCallback = function() {
55                     uiController.uiScriptComplete(JSON.stringify(uiController.contentsOfUserInterfaceItem('linkPreviewPopoverContents')));
56                 };
57              
58             })();`
59         }
60     
61         function getUIFinishScript()
62         {
63             return `
64             (function() {
65                 uiController.liftUpAtPoint(20, 40, 1, function() {
66                    uiController.uiScriptComplete();
67                 });
68             })();`
69         }
70
71         function runTest()
72         {
73             if (!testRunner.runUIScript)
74                 return;
75
76             var output = '';
77             var target = document.getElementById('target');
78             
79             if (testRunner.runUIScript) {
80                 testRunner.runUIScript(getUIScript(), function(result) {
81                     var uiContentsDictionary = JSON.parse(result);
82                     var pageURL = uiContentsDictionary.linkPreviewPopoverContents.pageURL;
83                     if (pageURL = 'http://localhost:54321')
84                         output += 'PASS: correct page loaded in popover';
85                     document.getElementById('target').innerHTML = output;
86                                        
87                     testRunner.runUIScript(getUIFinishScript(), function() {
88                         testRunner.notifyDone();
89                     });
90                });
91             }
92         }
93
94         window.addEventListener('load', runTest, false);
95     </script>
96     <style>
97         #target {
98             height: 100px;
99             width: 200px;
100             background-color: silver;
101         }
102     </style>
103     <meta name="viewport" content="initial-scale=1">
104 </head>
105 <body>
106 <div id="target">
107     <a href="http://localhost:54321">Link Test</a>
108     This test requires UIScriptController to run.
109 </div>
110 </body>
111 </html>