diff options
author | dyu@chromium.org <dyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-31 02:15:41 +0000 |
---|---|---|
committer | dyu@chromium.org <dyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-31 02:15:41 +0000 |
commit | 23b95dc052caad716cc07db46919e288de05232e (patch) | |
tree | 229215195d8c9e54d1f9278608aaf6f87ff6e0fe /chrome/test/data/geolocation/geolocation_on_load.html | |
parent | 9ebb367f4f25f184784a06dfaad810832d332ff8 (diff) | |
download | chromium_src-23b95dc052caad716cc07db46919e288de05232e.zip chromium_src-23b95dc052caad716cc07db46919e288de05232e.tar.gz chromium_src-23b95dc052caad716cc07db46919e288de05232e.tar.bz2 |
Added page objects for various content settings pages and generalized tests for specefic exceptions pages.
BUG=102892
TEST=none
Review URL: https://chromiumcodereview.appspot.com/9147048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119818 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/data/geolocation/geolocation_on_load.html')
-rw-r--r-- | chrome/test/data/geolocation/geolocation_on_load.html | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/chrome/test/data/geolocation/geolocation_on_load.html b/chrome/test/data/geolocation/geolocation_on_load.html index f646a34a0..69b0bb5 100644 --- a/chrome/test/data/geolocation/geolocation_on_load.html +++ b/chrome/test/data/geolocation/geolocation_on_load.html @@ -5,9 +5,9 @@ <title>Show Geolocation on page load</title> <script> -function triggerGeo() { +function triggerGeo(onSuccess, onError) { if (navigator.geolocation) { - navigator.geolocation.getCurrentPosition(showPosition, onError); + navigator.geolocation.getCurrentPosition(onSuccess, onError); } else { document.getElementById('lat').innerHTML = 'Error: navigator.geolocation is false'; @@ -15,6 +15,15 @@ function triggerGeo() { } } + +function triggerGeoWithCallback(callback){ + triggerGeo(function (position){ + callback("allow"); + }, function(positionError){ + callback("block"); + }); +} + function showPosition(position) { var lat = position.coords.latitude; var lng = position.coords.longitude; @@ -22,7 +31,7 @@ function showPosition(position) { document.getElementById('lng').innerHTML = lng; } -function onError(positionError) { +function showError(positionError) { document.getElementById('lat').innerHTML = positionError.message; document.getElementById('lng').innerHTML = ''; @@ -31,7 +40,7 @@ function onError(positionError) { </script> </head> -<body onload="triggerGeo()"> +<body onload="triggerGeo(showPosition, showError)"> <b id=lat>-1</b>, <b id=lng>-1</b> </body> |