From 09b5874dabf7b3c7cbf4a1e8a0af6ba0d40b68fc Mon Sep 17 00:00:00 2001 From: scheib Date: Sun, 22 Jan 2017 16:28:16 -0800 Subject: [PATCH] bluetooth: web: IDL fixes: Inherit EventTarget, SameObject navigator.bluetooth These changes reflect the IDL update made in the spec: https://github.com/WebBluetoothCG/web-bluetooth/commit/8d5ed3939d906e8874e12d8a5d94f99960f9e520 EventTarget is not a mixin, and so 'Implements' should not be used, instead bluetooth should inherit from EventTarget. Also, navigator.bluetooth should use [SameObject]. Review-Url: https://codereview.chromium.org/2616443002 Cr-Commit-Position: refs/heads/master@{#445306} --- .../LayoutTests/bluetooth/idl/idl-NavigatorBluetooth.html | 4 ++++ .../stable/webexposed/global-interface-listing-expected.txt | 2 +- .../webexposed/global-interface-listing-expected.txt | 2 +- third_party/WebKit/Source/modules/bluetooth/Bluetooth.idl | 2 +- .../WebKit/Source/modules/bluetooth/NavigatorBluetooth.idl | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/third_party/WebKit/LayoutTests/bluetooth/idl/idl-NavigatorBluetooth.html b/third_party/WebKit/LayoutTests/bluetooth/idl/idl-NavigatorBluetooth.html index 620571efb0cdd5..40bf9ea52e28b5 100644 --- a/third_party/WebKit/LayoutTests/bluetooth/idl/idl-NavigatorBluetooth.html +++ b/third_party/WebKit/LayoutTests/bluetooth/idl/idl-NavigatorBluetooth.html @@ -8,4 +8,8 @@ assert_true('bluetooth' in navigator, 'navigator.bluetooth exists.'); }, 'navigator.bluetooth IDL test'); + +test(() => { + assert_equals(navigator.bluetooth, navigator.bluetooth); +}, '[SameObject] test for navigator.bluetooth'); diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt index 42a23e14cc3d22..00decab5cb1375 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt @@ -254,7 +254,7 @@ interface BlobEvent : Event getter data getter timecode method constructor -interface Bluetooth +interface Bluetooth : EventTarget attribute @@toStringTag method constructor method requestDevice diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt index b48f8c483f1991..4b596c6a6ba7fb 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt @@ -354,7 +354,7 @@ interface BlobEvent : Event getter data getter timecode method constructor -interface Bluetooth +interface Bluetooth : EventTarget attribute @@toStringTag method constructor method requestDevice diff --git a/third_party/WebKit/Source/modules/bluetooth/Bluetooth.idl b/third_party/WebKit/Source/modules/bluetooth/Bluetooth.idl index 550d1968eb5834..180af8c9fea116 100644 --- a/third_party/WebKit/Source/modules/bluetooth/Bluetooth.idl +++ b/third_party/WebKit/Source/modules/bluetooth/Bluetooth.idl @@ -6,7 +6,7 @@ [ RuntimeEnabled=WebBluetooth, -] interface Bluetooth { +] interface Bluetooth : EventTarget { [CallWith=ScriptState, RaisesException, MeasureAs=WebBluetoothRequestDevice] Promise requestDevice ( RequestDeviceOptions options ); diff --git a/third_party/WebKit/Source/modules/bluetooth/NavigatorBluetooth.idl b/third_party/WebKit/Source/modules/bluetooth/NavigatorBluetooth.idl index e74b141a9aa0ce..f90f07579c4639 100644 --- a/third_party/WebKit/Source/modules/bluetooth/NavigatorBluetooth.idl +++ b/third_party/WebKit/Source/modules/bluetooth/NavigatorBluetooth.idl @@ -7,5 +7,5 @@ [ RuntimeEnabled=WebBluetooth, ] partial interface Navigator { - readonly attribute Bluetooth bluetooth; + [SameObject] readonly attribute Bluetooth bluetooth; };