Index: chrome/test/data/extensions/platform_apps/web_view/geolocation/geolocation_access_iframe.html |
diff --git a/chrome/test/data/extensions/platform_apps/web_view/geolocation/geolocation_access_iframe.html b/chrome/test/data/extensions/platform_apps/web_view/geolocation/geolocation_access_iframe.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a46f7f3fbd392a1f1a589ee215506b8834ec4ca4 |
--- /dev/null |
+++ b/chrome/test/data/extensions/platform_apps/web_view/geolocation/geolocation_access_iframe.html |
@@ -0,0 +1,38 @@ |
+<!-- |
+ * Copyright 2013 The Chromium Authors. All rights reserved. Use of this |
+ * source code is governed by a BSD-style license that can be found in the |
+ * LICENSE file. |
+--> |
+<html> |
+ <head> |
+ <script type="text/javascript"> |
+ var onGeolocationSuccess = function(position) { |
+ console.log('iframe.onGeolocationSuccess'); |
+ window.top['onIframeGeolocationSuccess'](position); |
+ }; |
+ var onGeolocationFailure = function(err) { |
+ console.log('iframe.onGeolocationFailure'); |
+ window.top['onIframeGeolocationFailure'](); |
+ }; |
+ var startTest = function() { |
+ console.log('iframe.startTest'); |
+ // Ask for a cached geolocation, we already should have fetched |
+ // fresh geolocation for the top level frame (guest). Asking for fresh |
+ // location from <iframe> again makes Geolocation flaky and sad (b/c of |
+ // ui_test_utils::OverrideGeolocation()). |
+ navigator.geolocation.getCurrentPosition( |
+ onGeolocationSuccess, |
+ onGeolocationFailure, |
+ // maximumAge > test timeout. |
+ {maximumAge: 100000, timeout: 0}); |
+ }; |
+ </script> |
+ </head> |
+ <body bgcolor="red"> |
+ <div>An <iframe> that requests geolocation.</div> |
+ <script> |
+ console.log('<iframe> loaded'); |
+ startTest(); |
+ </script> |
+ </body> |
+</html> |