| OLD | NEW | 
| (Empty) |  | 
 |    1 <!DOCTYPE html> | 
 |    2 <html> | 
 |    3 <head> | 
 |    4 <title>Old Powerful Features on an Insecure Origin</title> | 
 |    5 </head> | 
 |    6 <script src="/resources/testharness.js"></script> | 
 |    7 <script src="/resources/testharnessreport.js"></script> | 
 |    8 <script src="/resources/get-host-info.js"></script> | 
 |    9  | 
 |   10 <body> | 
 |   11 <div id="target"></div> | 
 |   12 <script> | 
 |   13 if (window.location.origin != get_host_info().UNAUTHENTICATED_ORIGIN) { | 
 |   14     window.location = get_host_info().UNAUTHENTICATED_ORIGIN + window.location.p
     athname; | 
 |   15 } else { | 
 |   16     if (!window.internals) | 
 |   17         assert_unreached('window.internals is required for this test'); | 
 |   18  | 
 |   19     var mockLatitude = 51.478; | 
 |   20     var mockLongitude = -0.166; | 
 |   21     var mockAccuracy = 100.0; | 
 |   22  | 
 |   23     internals.setGeolocationClientMock(document); | 
 |   24     internals.setGeolocationPermission(document, true); | 
 |   25     internals.setGeolocationPosition(document, | 
 |   26                                      mockLatitude, | 
 |   27                                      mockLongitude, | 
 |   28                                      mockAccuracy); | 
 |   29  | 
 |   30     async_test(function() { | 
 |   31         navigator.geolocation.getCurrentPosition( | 
 |   32             this.step_func(function() { | 
 |   33                 this.done(); | 
 |   34             }), | 
 |   35             this.step_func(function(error) { | 
 |   36                 assert_unreached('getCurrentPosition should succeed, but failed.
     '); | 
 |   37                 this.done(); | 
 |   38             })); | 
 |   39     }, 'getCurrentPosition'); | 
 |   40  | 
 |   41     // Note that the deprecation message for watchPosition() will be supressed | 
 |   42     // because it is an exact duplicate of the getCurrentPosition() message. | 
 |   43     // Thus, this test is really to confirm that it still executes. | 
 |   44     async_test(function() { | 
 |   45         navigator.geolocation.watchPosition( | 
 |   46             this.step_func(function() { | 
 |   47                 this.done(); | 
 |   48             }), | 
 |   49             this.step_func(function(error) { | 
 |   50                 assert_unreached('watchPosition should succeed, but failed.'); | 
 |   51                 this.done(); | 
 |   52             })); | 
 |   53     }, 'watchPosition'); | 
 |   54  | 
 |   55     async_test(function() { | 
 |   56         var element = document.getElementById('target'); | 
 |   57         document.addEventListener('fullscreenerror', this.step_func(function(e) 
     { | 
 |   58             assert_unreached('requestFullscreen should succeed, but failed.'); | 
 |   59             this.done(); | 
 |   60         })); | 
 |   61         document.addEventListener('fullscreenchange', this.step_func(function() 
     { | 
 |   62             this.done(); | 
 |   63         })); | 
 |   64  | 
 |   65         var request = element.requestFullscreen.bind(element); | 
 |   66         document.addEventListener("click", request); | 
 |   67         eventSender.mouseDown(); | 
 |   68         eventSender.mouseUp(); | 
 |   69         document.removeEventListener("click", request); | 
 |   70     }, 'fullscreen'); | 
 |   71  | 
 |   72     async_test(function() { | 
 |   73         navigator.webkitGetUserMedia({ audio: true, video: true }, | 
 |   74                 this.step_func(function() { | 
 |   75                     this.done(); | 
 |   76                 }), | 
 |   77                 this.step_func(function() { | 
 |   78                     assert_unreached('getUserMedia should succeed, but failed.')
     ; | 
 |   79                     this.done(); | 
 |   80                 })); | 
 |   81     }, 'getUserMedia'); | 
 |   82  | 
 |   83     async_test(function() { | 
 |   84         testRunner.setMockDeviceMotion(true, 0, true, 0, true, 0, | 
 |   85                                        true, 0, true, 0, true, 0, | 
 |   86                                        true, 0, true, 0, true, 0, | 
 |   87                                        0); | 
 |   88  | 
 |   89         window.addEventListener('devicemotion', this.step_func(function() { | 
 |   90             this.done(); | 
 |   91         })); | 
 |   92     }, 'device motion'); | 
 |   93  | 
 |   94     async_test(function() { | 
 |   95         testRunner.setMockDeviceOrientation(11.1, 22.2, 33.3, true); | 
 |   96  | 
 |   97         window.addEventListener('deviceorientation', this.step_func(function() { | 
 |   98             this.done(); | 
 |   99         })); | 
 |  100     }, 'device orientation'); | 
 |  101 } | 
 |  102 </script> | 
 |  103 </body> | 
 |  104 </html> | 
| OLD | NEW |