Commit 3e90d7df authored by Reilly Grant's avatar Reilly Grant Committed by Commit Bot

[geolocation] Rename interfaces and remove [NoInterfaceObject]

This change renames the following interfaces and removes the
[NoInterfaceObject] annotation so that these types are now exposed to
script:

  Coordinates   -> GeolocationCoordinates
  Position      -> GeolocationPosition
  PositionError -> GeolocationPositionError

This is done in response to an effort to remove this annotation from
WebIDL.

Spec pull requests (merged):
https://github.com/w3c/geolocation-api/pull/20
https://github.com/w3c/geolocation-api/pull/23

Intent to Ship:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/Xig9oewsQMA/eyC7dbtiAAAJ

Bug: 931847
Change-Id: I38d0172afc33d5757b664e2807356d8727e82d7f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1471230
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarYoav Weiss <yoavweiss@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695573}
parent 25f5ad74
......@@ -6,18 +6,18 @@ import("//third_party/blink/renderer/modules/modules.gni")
blink_modules_sources("geolocation") {
sources = [
"coordinates.cc",
"coordinates.h",
"geo_notifier.cc",
"geo_notifier.h",
"geolocation.cc",
"geolocation.h",
"geolocation_coordinates.cc",
"geolocation_coordinates.h",
"geolocation_error.h",
"geolocation_position_error.h",
"geolocation_watchers.cc",
"geolocation_watchers.h",
"geoposition.h",
"navigator_geolocation.cc",
"navigator_geolocation.h",
"position_error.h",
]
}
......@@ -7,7 +7,7 @@
#include "third_party/blink/public/platform/task_type.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/modules/geolocation/geolocation.h"
#include "third_party/blink/renderer/modules/geolocation/position_error.h"
#include "third_party/blink/renderer/modules/geolocation/geolocation_position_error.h"
#include "third_party/blink/renderer/modules/geolocation/position_options.h"
#include "third_party/blink/renderer/platform/instrumentation/histogram.h"
#include "third_party/blink/renderer/platform/wtf/assertions.h"
......@@ -45,7 +45,7 @@ void GeoNotifier::Trace(blink::Visitor* visitor) {
visitor->Trace(fatal_error_);
}
void GeoNotifier::SetFatalError(PositionError* error) {
void GeoNotifier::SetFatalError(GeolocationPositionError* error) {
// If a fatal error has already been set, stick with it. This makes sure that
// when permission is denied, this is the error reported, as required by the
// spec.
......@@ -67,7 +67,7 @@ void GeoNotifier::RunSuccessCallback(Geoposition* position) {
success_callback_->InvokeAndReportException(nullptr, position);
}
void GeoNotifier::RunErrorCallback(PositionError* error) {
void GeoNotifier::RunErrorCallback(GeolocationPositionError* error) {
if (error_callback_)
error_callback_->InvokeAndReportException(nullptr, error);
}
......@@ -132,8 +132,8 @@ void GeoNotifier::TimerFired(TimerBase*) {
if (error_callback_) {
error_callback_->InvokeAndReportException(
nullptr, MakeGarbageCollected<PositionError>(PositionError::kTimeout,
"Timeout expired"));
nullptr, MakeGarbageCollected<GeolocationPositionError>(
GeolocationPositionError::kTimeout, "Timeout expired"));
}
DEFINE_STATIC_LOCAL(CustomCountHistogram, timeout_expired_histogram,
......
......@@ -16,8 +16,8 @@
namespace blink {
class Geolocation;
class GeolocationPositionError;
class Geoposition;
class PositionError;
class GeoNotifier final : public GarbageCollectedFinalized<GeoNotifier>,
public NameClient {
......@@ -34,7 +34,7 @@ class GeoNotifier final : public GarbageCollectedFinalized<GeoNotifier>,
// Sets the given error as the fatal error if there isn't one yet.
// Starts the timer with an interval of 0.
void SetFatalError(PositionError*);
void SetFatalError(GeolocationPositionError*);
bool UseCachedPosition() const { return use_cached_position_; }
......@@ -43,7 +43,7 @@ class GeoNotifier final : public GarbageCollectedFinalized<GeoNotifier>,
void SetUseCachedPosition();
void RunSuccessCallback(Geoposition*);
void RunErrorCallback(PositionError*);
void RunErrorCallback(GeolocationPositionError*);
void StartTimer();
void StopTimer();
......@@ -83,7 +83,7 @@ class GeoNotifier final : public GarbageCollectedFinalized<GeoNotifier>,
Member<V8PositionErrorCallback> error_callback_;
Member<const PositionOptions> options_;
Member<Timer> timer_;
Member<PositionError> fatal_error_;
Member<GeolocationPositionError> fatal_error_;
bool use_cached_position_;
};
......
......@@ -39,7 +39,7 @@
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/core/probe/core_probes.h"
#include "third_party/blink/renderer/modules/geolocation/coordinates.h"
#include "third_party/blink/renderer/modules/geolocation/geolocation_coordinates.h"
#include "third_party/blink/renderer/modules/geolocation/geolocation_error.h"
#include "third_party/blink/renderer/platform/wtf/assertions.h"
......@@ -55,7 +55,7 @@ const char kFeaturePolicyConsoleWarning[] =
Geoposition* CreateGeoposition(
const device::mojom::blink::Geoposition& position) {
auto* coordinates = MakeGarbageCollected<Coordinates>(
auto* coordinates = MakeGarbageCollected<GeolocationCoordinates>(
position.latitude, position.longitude,
// Lowest point on land is at approximately -400 meters.
position.altitude > -10000., position.altitude, position.accuracy,
......@@ -67,23 +67,24 @@ Geoposition* CreateGeoposition(
ConvertSecondsToDOMTimeStamp(position.timestamp.ToDoubleT()));
}
PositionError* CreatePositionError(
GeolocationPositionError* CreatePositionError(
device::mojom::blink::Geoposition::ErrorCode mojom_error_code,
const String& error) {
PositionError::ErrorCode error_code = PositionError::kPositionUnavailable;
GeolocationPositionError::ErrorCode error_code =
GeolocationPositionError::kPositionUnavailable;
switch (mojom_error_code) {
case device::mojom::blink::Geoposition::ErrorCode::PERMISSION_DENIED:
error_code = PositionError::kPermissionDenied;
error_code = GeolocationPositionError::kPermissionDenied;
break;
case device::mojom::blink::Geoposition::ErrorCode::POSITION_UNAVAILABLE:
error_code = PositionError::kPositionUnavailable;
error_code = GeolocationPositionError::kPositionUnavailable;
break;
case device::mojom::blink::Geoposition::ErrorCode::NONE:
case device::mojom::blink::Geoposition::ErrorCode::TIMEOUT:
NOTREACHED();
break;
}
return MakeGarbageCollected<PositionError>(error_code, error);
return MakeGarbageCollected<GeolocationPositionError>(error_code, error);
}
static void ReportGeolocationViolation(Document* doc) {
......@@ -100,8 +101,7 @@ static void ReportGeolocationViolation(Document* doc) {
} // namespace
Geolocation* Geolocation::Create(ExecutionContext* context) {
Geolocation* geolocation = MakeGarbageCollected<Geolocation>(context);
return geolocation;
return MakeGarbageCollected<Geolocation>(context);
}
Geolocation::Geolocation(ExecutionContext* context)
......@@ -221,8 +221,8 @@ void Geolocation::StartRequest(GeoNotifier* notifier) {
String error_message;
if (!GetFrame()->GetSettings()->GetAllowGeolocationOnInsecureOrigins() &&
!GetExecutionContext()->IsSecureContext(error_message)) {
notifier->SetFatalError(MakeGarbageCollected<PositionError>(
PositionError::kPermissionDenied, error_message));
notifier->SetFatalError(MakeGarbageCollected<GeolocationPositionError>(
GeolocationPositionError::kPermissionDenied, error_message));
return;
}
......@@ -231,8 +231,9 @@ void Geolocation::StartRequest(GeoNotifier* notifier) {
ReportOptions::kReportOnFailure, kFeaturePolicyConsoleWarning)) {
UseCounter::Count(GetDocument(),
WebFeature::kGeolocationDisabledByFeaturePolicy);
notifier->SetFatalError(MakeGarbageCollected<PositionError>(
PositionError::kPermissionDenied, kFeaturePolicyErrorMessage));
notifier->SetFatalError(MakeGarbageCollected<GeolocationPositionError>(
GeolocationPositionError::kPermissionDenied,
kFeaturePolicyErrorMessage));
return;
}
......@@ -326,7 +327,7 @@ void Geolocation::StopTimers() {
}
}
void Geolocation::HandleError(PositionError* error) {
void Geolocation::HandleError(GeolocationPositionError* error) {
DCHECK(error);
DCHECK(one_shots_being_invoked_.IsEmpty());
......@@ -509,8 +510,9 @@ void Geolocation::OnGeolocationConnectionError() {
StopUpdating();
// The only reason that we would fail to get a ConnectionError is if we lack
// sufficient permission.
auto* error = MakeGarbageCollected<PositionError>(
PositionError::kPermissionDenied, kPermissionDeniedErrorMessage);
auto* error = MakeGarbageCollected<GeolocationPositionError>(
GeolocationPositionError::kPermissionDenied,
kPermissionDeniedErrorMessage);
error->SetIsFatal(true);
HandleError(error);
}
......
......@@ -35,9 +35,9 @@
#include "third_party/blink/renderer/core/execution_context/context_lifecycle_observer.h"
#include "third_party/blink/renderer/core/page/page_visibility_observer.h"
#include "third_party/blink/renderer/modules/geolocation/geo_notifier.h"
#include "third_party/blink/renderer/modules/geolocation/geolocation_position_error.h"
#include "third_party/blink/renderer/modules/geolocation/geolocation_watchers.h"
#include "third_party/blink/renderer/modules/geolocation/geoposition.h"
#include "third_party/blink/renderer/modules/geolocation/position_error.h"
#include "third_party/blink/renderer/modules/geolocation/position_options.h"
#include "third_party/blink/renderer/modules/modules_export.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
......@@ -173,7 +173,7 @@ class MODULES_EXPORT Geolocation final
// Sends the given error to all notifiers, unless the error is not fatal and
// the notifier is due to receive a cached position. Clears the oneshots,
// and also clears the watchers if the error is fatal.
void HandleError(PositionError*);
void HandleError(GeolocationPositionError*);
// Connects to the Geolocation mojo service and starts polling for updates.
void StartUpdating(GeoNotifier*);
......@@ -184,15 +184,15 @@ class MODULES_EXPORT Geolocation final
void QueryNextPosition();
// Attempts to obtain a position for the given notifier, either by using
// the cached position or by requesting one from the Geolocation.
// the cached position or by requesting one from the Geolocation service.
// Sets a fatal error if permission is denied or no position can be
// obtained.
void StartRequest(GeoNotifier*);
bool HaveSuitableCachedPosition(const PositionOptions*);
// Record whether the origin trying to access Geolocation would be allowed
// to access a feature that can only be accessed by secure origins.
// Record whether the origin trying to access Geolocation would be
// allowed to access a feature that can only be accessed by secure origins.
// See https://goo.gl/Y0ZkNV
void RecordOriginTypeAccess() const;
......@@ -209,10 +209,10 @@ class MODULES_EXPORT Geolocation final
//
// |HandleError(error)| and |MakeSuccessCallbacks| need to clear |one_shots_|
// (and optionally |watchers_|) before invoking the callbacks, in order to
// avoid clearing notifiers added by calls to Geolocation methods from the
// callbacks. Thus, something else needs to make the notifiers being invoked
// alive with wrapper-tracing because V8 GC may run during the callbacks.
// |one_shots_being_invoked_| and |watchers_being_invoked_| perform
// avoid clearing notifiers added by calls to Geolocation methods
// from the callbacks. Thus, something else needs to make the notifiers being
// invoked alive with wrapper-tracing because V8 GC may run during the
// callbacks. |one_shots_being_invoked_| and |watchers_being_invoked_| perform
// wrapper-tracing.
// TODO(https://crbug.com/796145): Remove this hack once on-stack objects
// get supported by either of wrapper-tracing or unified GC.
......
......@@ -26,8 +26,7 @@
// https://www.w3.org/TR/geolocation-API/#geolocation_interface
[
ActiveScriptWrappable,
Exposed=Window,
NoInterfaceObject
Exposed=Window
] interface Geolocation {
[
LogActivity,
......@@ -51,7 +50,8 @@
};
// https://www.w3.org/TR/geolocation-API/#position-callback
callback PositionCallback = void(Position position);
callback PositionCallback = void(GeolocationPosition position);
// https://www.w3.org/TR/geolocation-API/#error-callback
callback PositionErrorCallback = void (PositionError positionError);
callback PositionErrorCallback =
void (GeolocationPositionError positionError);
......@@ -23,11 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "third_party/blink/renderer/modules/geolocation/coordinates.h"
#include "third_party/blink/renderer/modules/geolocation/geolocation_coordinates.h"
namespace blink {
double Coordinates::altitude(bool& is_null) const {
double GeolocationCoordinates::altitude(bool& is_null) const {
if (can_provide_altitude_)
return altitude_;
......@@ -35,7 +35,7 @@ double Coordinates::altitude(bool& is_null) const {
return 0;
}
double Coordinates::altitudeAccuracy(bool& is_null) const {
double GeolocationCoordinates::altitudeAccuracy(bool& is_null) const {
if (can_provide_altitude_accuracy_)
return altitude_accuracy_;
......@@ -43,7 +43,7 @@ double Coordinates::altitudeAccuracy(bool& is_null) const {
return 0;
}
double Coordinates::heading(bool& is_null) const {
double GeolocationCoordinates::heading(bool& is_null) const {
if (can_provide_heading_)
return heading_;
......@@ -51,7 +51,7 @@ double Coordinates::heading(bool& is_null) const {
return 0;
}
double Coordinates::speed(bool& is_null) const {
double GeolocationCoordinates::speed(bool& is_null) const {
if (can_provide_speed_)
return speed_;
......
......@@ -23,8 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_GEOLOCATION_COORDINATES_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_GEOLOCATION_COORDINATES_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_GEOLOCATION_GEOLOCATION_COORDINATES_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_GEOLOCATION_GEOLOCATION_COORDINATES_H_
#include "third_party/blink/renderer/modules/event_modules.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
......@@ -32,21 +32,21 @@
namespace blink {
class Coordinates : public ScriptWrappable {
class GeolocationCoordinates : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
Coordinates(double latitude,
double longitude,
bool provides_altitude,
double altitude,
double accuracy,
bool provides_altitude_accuracy,
double altitude_accuracy,
bool provides_heading,
double heading,
bool provides_speed,
double speed)
GeolocationCoordinates(double latitude,
double longitude,
bool provides_altitude,
double altitude,
double accuracy,
bool provides_altitude_accuracy,
double altitude_accuracy,
bool provides_heading,
double heading,
bool provides_speed,
double speed)
: latitude_(latitude),
longitude_(longitude),
altitude_(altitude),
......@@ -84,4 +84,4 @@ class Coordinates : public ScriptWrappable {
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_GEOLOCATION_COORDINATES_H_
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_GEOLOCATION_GEOLOCATION_COORDINATES_H_
......@@ -24,9 +24,8 @@
*/
[
Exposed=Window,
NoInterfaceObject
] interface Coordinates {
Exposed=Window
] interface GeolocationCoordinates {
readonly attribute double latitude;
readonly attribute double longitude;
readonly attribute double? altitude;
......
......@@ -27,9 +27,8 @@
[
Exposed=Window,
NoInterfaceObject,
ImplementedAs=Geoposition
] interface Position {
readonly attribute Coordinates coords;
] interface GeolocationPosition {
readonly attribute GeolocationCoordinates coords;
readonly attribute DOMTimeStamp timestamp;
};
......@@ -23,8 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_GEOLOCATION_POSITION_ERROR_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_GEOLOCATION_POSITION_ERROR_H_
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_GEOLOCATION_GEOLOCATION_POSITION_ERROR_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_GEOLOCATION_GEOLOCATION_POSITION_ERROR_H_
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
......@@ -32,7 +32,7 @@
namespace blink {
class PositionError final : public ScriptWrappable {
class GeolocationPositionError final : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
......@@ -42,7 +42,7 @@ class PositionError final : public ScriptWrappable {
kTimeout = 3
};
PositionError(ErrorCode code, const String& message)
GeolocationPositionError(ErrorCode code, const String& message)
: code_(code), message_(message), is_fatal_(false) {}
ErrorCode code() const { return code_; }
......@@ -60,4 +60,4 @@ class PositionError final : public ScriptWrappable {
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_GEOLOCATION_POSITION_ERROR_H_
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_GEOLOCATION_GEOLOCATION_POSITION_ERROR_H_
......@@ -24,9 +24,8 @@
*/
[
Exposed=Window,
NoInterfaceObject
] interface PositionError {
Exposed=Window
] interface GeolocationPositionError {
readonly attribute unsigned short code;
readonly attribute DOMString message;
......
......@@ -28,7 +28,7 @@
#include "third_party/blink/renderer/core/dom/dom_time_stamp.h"
#include "third_party/blink/renderer/modules/event_modules.h"
#include "third_party/blink/renderer/modules/geolocation/coordinates.h"
#include "third_party/blink/renderer/modules/geolocation/geolocation_coordinates.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
#include "third_party/blink/renderer/platform/wtf/assertions.h"
......@@ -39,7 +39,7 @@ class Geoposition final : public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
Geoposition(Coordinates* coordinates, DOMTimeStamp timestamp)
Geoposition(GeolocationCoordinates* coordinates, DOMTimeStamp timestamp)
: coordinates_(coordinates), timestamp_(timestamp) {
DCHECK(coordinates_);
}
......@@ -50,10 +50,10 @@ class Geoposition final : public ScriptWrappable {
}
DOMTimeStamp timestamp() const { return timestamp_; }
Coordinates* coords() const { return coordinates_; }
GeolocationCoordinates* coords() const { return coordinates_; }
private:
Member<Coordinates> coordinates_;
Member<GeolocationCoordinates> coordinates_;
DOMTimeStamp timestamp_;
};
......
......@@ -51,9 +51,10 @@ Geolocation* NavigatorGeolocation::geolocation(Navigator& navigator) {
}
Geolocation* NavigatorGeolocation::geolocation() {
if (!geolocation_ && GetSupplementable()->GetFrame())
if (!geolocation_ && GetSupplementable()->GetFrame()) {
geolocation_ =
Geolocation::Create(GetSupplementable()->GetFrame()->GetDocument());
}
return geolocation_;
}
......
......@@ -30,10 +30,9 @@ namespace blink {
class Geolocation;
class Navigator;
class NavigatorGeolocation final
: public GarbageCollected<NavigatorGeolocation>,
public Supplement<Navigator>,
public NameClient {
class NavigatorGeolocation final : public GarbageCollected<Geolocation>,
public Supplement<Navigator>,
public NameClient {
USING_GARBAGE_COLLECTED_MIXIN(NavigatorGeolocation);
public:
......
......@@ -163,10 +163,10 @@ modules_idl_files =
"gamepad/gamepad_haptic_actuator.idl",
"gamepad/gamepad_list.idl",
"gamepad/gamepad_pose.idl",
"geolocation/coordinates.idl",
"geolocation/geolocation.idl",
"geolocation/position.idl",
"geolocation/position_error.idl",
"geolocation/geolocation_coordinates.idl",
"geolocation/geolocation_position.idl",
"geolocation/geolocation_position_error.idl",
"hid/hid.idl",
"hid/hid_collection_info.idl",
"hid/hid_connection_event.idl",
......
This is a testharness.js-based test.
FAIL Geolocation report only mode promise_test: Unhandled rejection with value: object "[object PositionError]"
FAIL Geolocation report only mode promise_test: Unhandled rejection with value: object "[object GeolocationPositionError]"
Harness: the test ran to completion.
This is a testharness.js-based test.
FAIL getCurrentPosition success callback tests assert_unreached: Error callback called in error Reached unreachable code
PASS getCurrentPosition error callback tests
PASS PositionError toString
PASS GeolocationPositionError toString
PASS PERMISSION_DENIED value is 1
PASS POSITION_UNAVAILABLE is 2
PASS TIMEOUT value is 3
......
......@@ -20,31 +20,29 @@ function successCallback(position)
var ii, oldval;
/*
[NoInterfaceObject]
interface Position {
readonly attribute Coordinates coords;
interface GeolocationPosition {
readonly attribute GeolocationCoordinates coords;
readonly attribute DOMTimeStamp timestamp;
};
*/
test(function() {
assert_equals(position.toString(), "[object Position]",
"Position.toString should result in '[object Position]' was: " + position.toString());
}, "Position toString");
assert_equals(position.toString(), "[object GeolocationPosition]",
"position.toString should result in '[object GeolocationPosition]' was: " + position.toString());
}, "GeolocationPosition toString");
test(function() {
assert_equals(position.coords.toString(), "[object Coordinates]",
"position.coords.toString should result in '[object Coordinates]' was: " + position.coords.toString());
}, "Position.coordinates toString");
assert_equals(position.coords.toString(), "[object GeolocationCoordinates]",
"position.coords.toString should result in '[object GeolocationCoordinates]' was: " + position.coords.toString());
}, "GeolocationCoordinates toString");
test(function() {
assert_equals(typeof(position.timestamp), "number",
"Position.timestamp should be of type 'number' was: " + typeof(position.timestamp));
}, "Position.timestamp is type number");
"position.timestamp should be of type 'number' was: " + typeof(position.timestamp));
}, "GeolocationPosition.timestamp is type number");
/*
[NoInterfaceObject]
interface Coordinates {
interface GeolocationCoordinates {
readonly attribute double latitude;
readonly attribute double longitude;
readonly attribute double? altitude;
......@@ -103,10 +101,10 @@ function BadSuccessCallback(position)
function errorCallback(error)
{
test(function() {
assert_equals(error.toString(), "[object PositionError]",
"PositionError.toString should result in '[object PositionError]' was: " +
assert_equals(error.toString(), "[object GeolocationPositionError]",
"error.toString should result in '[object GeolocationPositionError]' was: " +
error.toString());
}, "PositionError toString");
}, "GeolocationPositionError toString");
test(function() {
assert_equals(error.PERMISSION_DENIED, 1,
......
......@@ -5,8 +5,8 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
PASS position.coords.latitude is mockLatitude
PASS position.coords.longitude is mockLongitude
PASS position.coords.accuracy is mockAccuracy
PASS position.toString() is "[object Position]"
PASS position.coords.toString() is "[object Coordinates]"
PASS position.toString() is "[object GeolocationPosition]"
PASS position.coords.toString() is "[object GeolocationCoordinates]"
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -30,8 +30,8 @@ navigator.geolocation.getCurrentPosition(function(p) {
shouldBe('position.coords.latitude', 'mockLatitude');
shouldBe('position.coords.longitude', 'mockLongitude');
shouldBe('position.coords.accuracy', 'mockAccuracy');
shouldBe('position.toString()', '"[object Position]"');
shouldBe('position.coords.toString()', '"[object Coordinates]"');
shouldBe('position.toString()', '"[object GeolocationPosition]"');
shouldBe('position.coords.toString()', '"[object GeolocationCoordinates]"');
finishJSTest();
}, function(e) {
testFailed('Error callback invoked unexpectedly');
......
......@@ -9,7 +9,7 @@
run_permission_default_header_policy_tests(
location.protocol + '//localhost:' + location.port,
'geolocation',
'PositionError',
'GeolocationPositionError',
function() { return new Promise((resolve, reject) => {
navigator.geolocation.getCurrentPosition(resolve, reject); }); });
......
......@@ -1914,6 +1914,35 @@ interface GamepadHapticActuator
method constructor
method playEffect
method reset
interface Geolocation
attribute @@toStringTag
method clearWatch
method constructor
method getCurrentPosition
method watchPosition
interface GeolocationCoordinates
attribute @@toStringTag
getter accuracy
getter altitude
getter altitudeAccuracy
getter heading
getter latitude
getter longitude
getter speed
method constructor
interface GeolocationPosition
attribute @@toStringTag
getter coords
getter timestamp
method constructor
interface GeolocationPositionError
attribute @@toStringTag
attribute PERMISSION_DENIED
attribute POSITION_UNAVAILABLE
attribute TIMEOUT
getter code
getter message
method constructor
interface Gyroscope : Sensor
attribute @@toStringTag
getter x
......
......@@ -2513,6 +2513,35 @@ interface GamepadPose
getter orientation
getter position
method constructor
interface Geolocation
attribute @@toStringTag
method clearWatch
method constructor
method getCurrentPosition
method watchPosition
interface GeolocationCoordinates
attribute @@toStringTag
getter accuracy
getter altitude
getter altitudeAccuracy
getter heading
getter latitude
getter longitude
getter speed
method constructor
interface GeolocationPosition
attribute @@toStringTag
getter coords
getter timestamp
method constructor
interface GeolocationPositionError
attribute @@toStringTag
attribute PERMISSION_DENIED
attribute POSITION_UNAVAILABLE
attribute TIMEOUT
getter code
getter message
method constructor
interface Gyroscope : Sensor
attribute @@toStringTag
getter x
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment