It's awesome that you're trying to tackle this problem of test automation for Bluetooth.It's a big document and a big API surface, but I see that it all hangs off of navigator.bluetooth.test. Although, none of the interfaces have [NoInterfaceObject], but I assume it still isn't expected that these interface objects would show up on window?
Do you intend to merge this into https://webbluetoothcg.github.io/web-bluetooth/? I think that developing the testing APIs in the main spec would make a lot of sense, and trying to keep it in sync as a separate project doesn't seem like much fun. My own pet idea is to have a testing namespace, and to have all specs but things in a "partial namespace testing", so that there's exactly one object to expose or note expose. But a Web IDL extended attribute like [Testing] could also work.
One key design choice: "The interface will be implemented in C++ and will only be available in content_shell."I take it this means that the testing code would be behind a compile-time flag and wouldn't even ship in an official Chrome binary. This means that it will not be possible to https://wptdashboard.appspot.com/ that would show results from the actual shipping browsers. But even more importantly, it means that web developers would have no way to write regression tests for their integration with Web Bluetooth. It's tempting to solve these two problems at the same time, but it would come at a cost of binary size. What is your thinking on this?
Advantages:
Web Platform Tests could directly use the test interface.
Web Developers could reuse the interface’s implementation to fake devices and test their websites and write regression tests against our code.
https://wptdashboard.appspot.com/ would show results from the actual shipping browsers for Web Bluetooth
Disadvantages:
Harder implementation of the interface:
Test functions no longer available e.g. FlushForTesting.
Mojo in JS for any website is not yet ready (though Chromecast needs it), so we would need to use WebIDL in C++.
Requires security review for all IPC changes.
Increased binary size for a feature that very few will use.
On Wed, Feb 15, 2017 at 4:12 AM Giovanni <ort...@chromium.org> wrote:Hi all,Writing cross-browser tests for the Web Bluetooth API is difficult because it interacts with devices that live outside the browser. To that extent we are proposing a Test API to accompany the spec:Any browser that implements the Web Bluetooth API could also implement this Test API and reuse all of our tests (which eventually will become Web Platform Tests).Please have a look,Gio
--
You received this message because you are subscribed to the Google Groups "platform-predictability" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-predicta...@chromium.org.
To post to this group, send email to platform-pr...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-predictability/CAARdPYd_TEJ%2BQg-3tLRY_XDyBDD-Ve_RVYK6PU18UkhAYmYZcg%40mail.gmail.com.
Hi Philip,On Wed, Feb 15, 2017 at 3:28 PM Philip Jägenstedt <foo...@chromium.org> wrote:It's awesome that you're trying to tackle this problem of test automation for Bluetooth.It's a big document and a big API surface, but I see that it all hangs off of navigator.bluetooth.test. Although, none of the interfaces have [NoInterfaceObject], but I assume it still isn't expected that these interface objects would show up on window?Correct, the interface shouldn't appear on window. I added [NoInterfaceObject] to indicate that.Do you intend to merge this into https://webbluetoothcg.github.io/web-bluetooth/? I think that developing the testing APIs in the main spec would make a lot of sense, and trying to keep it in sync as a separate project doesn't seem like much fun. My own pet idea is to have a testing namespace, and to have all specs but things in a "partial namespace testing", so that there's exactly one object to expose or note expose. But a Web IDL extended attribute like [Testing] could also work.The original plan was to have an accompanying spec that other browsers could implemented if they wanted to reuse our tests. Similar to the outdated on at https://webbluetoothcg.github.io/web-bluetooth/tests.htmlThat said we could totally make this part of the main spec.
One key design choice: "The interface will be implemented in C++ and will only be available in content_shell."I take it this means that the testing code would be behind a compile-time flag and wouldn't even ship in an official Chrome binary. This means that it will not be possible to https://wptdashboard.appspot.com/ that would show results from the actual shipping browsers. But even more importantly, it means that web developers would have no way to write regression tests for their integration with Web Bluetooth. It's tempting to solve these two problems at the same time, but it would come at a cost of binary size. What is your thinking on this?I touched upon this in "Alternative: Expose the test interface in regular Chrome":Advantages:
Web Platform Tests could directly use the test interface.
Web Developers could reuse the interface’s implementation to fake devices and test their websites and write regression tests against our code.
https://wptdashboard.appspot.com/ would show results from the actual shipping browsers for Web Bluetooth
Disadvantages:
Harder implementation of the interface:
Test functions no longer available e.g. FlushForTesting.
Mojo in JS for any website is not yet ready (though Chromecast needs it), so we would need to use WebIDL in C++.
Requires security review for all IPC changes.
Increased binary size for a feature that very few will use.
Anyway, I think the decision is up for discussion and we could totally push for it if folks think the benefits outweigh the costs.Note that this is just a first step, we are just defining an API and writing one implementation for it. There are other alternatives for the implementation of the API e.g. Web Driver or, as discussed during BlinkOn, WebUSB, that would allow web developers to write regression tests. We are not taking those routes yet because there is no support for them in our test infrastructure.
Regardless, I believe that the main trade-off here is that of binary size if we extrapolate to most new features doing the same thing. We have already accepted some increase in binary size to support WebDriver and DevTools, which are also features that very few will use, but which I think are clearly worth shipping so that people can actually develop and test effectively. Would it be possible for you to make Chromium release builds with and without the code in question to get some estimate of the added binary size?
--
You received this message because you are subscribed to the Google Groups "platform-predictability" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-predicta...@chromium.org.
To post to this group, send email to platform-pr...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-predictability/CAARdPYeFk5VT5CkKrAuz%2BMpxFrPeOB5Nz8w79rouRLupXzfDjg%40mail.gmail.com.
Expose a Bluetooth Mojo Service from device/bluetooth. Implement Web Bluetooth Test in JS on top of a JS implementation of this new Bluetooth Mojo Service.
Binary size increase: 0 bytes. All testing code would live in test sites: Bluetooth Impl + Web Bluetooth Test Impl.
Expose a FakeBluetooth Mojo Interface to control the device/bluetooth C++ interface and implement it in the browser. Implement Web Bluetooth Test in JS on top of this interface.
Binary size increase: >100 Kilobytes based on http://crrev.com/2722473002. We would ship FakeBluetooth’s impl. Web Bluetooth Test Impl would live in test sites.
Expose a Bluetooth Mojo Service from device/bluetooth. Implement Web Bluetooth Test using Blink’s IDL Bindings on top of the Bluetooth Mojo Service.
Binary size increase: >200 Kilobytes based on http://crrev.com/2722473002 + http://crrev.com/2716263002. Assuming a Bluetooth Mojo Service impl is as big as an impl of the current device/bluetooth interface.
Expose a FakeBluetooth Mojo Interface to control the device/bluetooth C++ interface and implement it in the browser. Implement Web Bluetooth Test using Blink’s IDL Bindings on top of this Mojo interface.
Binary size increase: >200 Kilobytes based on http://crrev.com/2722473002 + http://crrev.com/2716263002. We would ship both Fake Bluetooth Impl and Web Bluetooth Test Impl.
Option 1 is very similar to what WebUSB, Geolocation, and probably more APIs, currently do in Layout Tests. It also has no binary size impact since all the test code would live in test websites.
Options 1 and 3 would require us to introduce a new Bluetooth Mojo Service and refactor device/bluetooth clients to use this new service. This is a pretty significant task that would require at least (optimistically speaking) a quarter of work.
Options 1 and 2 would require us to expose overriding Mojo service from JS and interacting with a Mojo Service from JS. These two features would probably be behind a flag as they are very dangerous. (--enable-web-platform-tests?). We will also have to check with Mojo and Blink owners to see if they are OK with this.
Option 4 is the least amount of work but has the biggest binary size impact.
Option 3 has no advantages over Option 4 and is here only for completeness.
--
You received this message because you are subscribed to the Google Groups "platform-predictability" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-predictability+unsub...@chromium.org.
To post to this group, send email to platform-predictability@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-predictability/CAMDKGBUpHnTZmLFsJNsekNbFKEGxcOpZo1dEenko_6%3D9pPMnFA%40mail.gmail.com.
--
To unsubscribe from this group and stop receiving emails from it, send an email to platform-predicta...@chromium.org.
To post to this group, send email to platform-pr...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-predictability/CAMDKGBWsFykcUEmFTOPA5zBCXdjGjZ1Z0K3NZTDcZEfmSB7OGg%40mail.gmail.com.