- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / extensions / platform_apps / web_view / geolocation / geolocation_access_iframe.html
1 <!--
2  * Copyright 2013 The Chromium Authors. All rights reserved.  Use of this
3  * source code is governed by a BSD-style license that can be found in the
4  * LICENSE file.
5 -->
6 <html>
7   <head>
8     <script type="text/javascript">
9       var onGeolocationSuccess = function(position) {
10         console.log('iframe.onGeolocationSuccess');
11         window.top['onIframeGeolocationSuccess'](position);
12       };
13       var onGeolocationFailure = function(err) {
14         console.log('iframe.onGeolocationFailure');
15         window.top['onIframeGeolocationFailure']();
16       };
17       var startTest = function() {
18         console.log('iframe.startTest');
19         // Ask for a cached geolocation, we already should have fetched
20         // fresh geolocation for the top level frame (guest). Asking for fresh
21         // location from <iframe> again makes Geolocation flaky and sad (b/c of
22         // ui_test_utils::OverrideGeolocation()).
23         navigator.geolocation.getCurrentPosition(
24             onGeolocationSuccess,
25             onGeolocationFailure,
26             // maximumAge > test timeout.
27             {maximumAge: 100000, timeout: 0});
28       };
29     </script>
30   </head>
31   <body bgcolor="red">
32     <div>An &lt;iframe&gt; that requests geolocation.</div>
33     <script>
34       console.log('<iframe> loaded');
35       startTest();
36     </script>
37   </body>
38 </html>