There seems to be an internals.setNetworkConnectionInfo method, but as far as I can tell that only effects what navigator.connection returns; it doesn't actually effect the network stack in any way. It would be nice if there was some way through internals or testRunner to do that though. I wonder if somehow it is possible to (ab)use testRunner.evaluateInWebInspector to call the devtools Network.emulateNetworkConditions command, but probably that wouldn't be a good idea anyway.--On Mon, Jun 6, 2016 at 9:00 PM, Joel Weinberger <j...@chromium.org> wrote:Well, a unit test would be helpful as well, but I'm definitely looking for a way to do it in a layout test, as part of some integration tests for appcache I'm working on.On Mon, Jun 6, 2016 at 8:15 PM Daniel Cheng <dch...@chromium.org> wrote:Does it have to be a layout test? Could it be a unit test instead?DanielOn Mon, Jun 6, 2016 at 8:05 PM Joel Weinberger <j...@chromium.org> wrote:Hi all. I'm interested in making a test where the network is offline from the perspective of the network stack. In particular, the AppCache LayoutTests that use network-simulator.php are not what I need, because while it treats those individual resources as giving network errors, I want the network stack itself to think it's offline.What I'd particularly like is for navigator.onLine == false. I would have expected there to be some sort of test of this for the throttling in network tools, but I haven't found one. Any ideas? Thanks!--Joel
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "net-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to net-dev+u...@chromium.org.
To post to this group, send email to net...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/net-dev/CAANMuaPiW%2BcYDLwsgDi1AVvXFfstP1YkjsNvyt1GcwOP8hoUmA%40mail.gmail.com.
Makes sense, and I'm guessing I'll have to do the best that I can with browsers tests as well. I'm just sad that we can't test Web APIs that depend on network state at what we've traditionally used as the Web API testing layer. Put differently, I don't think you could write a Web Platform Test for the W3C for the parts of background sync you're talking about right?
In short, I'd love a new internals API to test behavior like this, but understand that the complexity may not be worth it. As time goes on, though, and especially with the "offline first" PWA ideal, I imagine this will become a bigger hole.
Makes sense, and I'm guessing I'll have to do the best that I can with browsers tests as well. I'm just sad that we can't test Web APIs that depend on network state at what we've traditionally used as the Web API testing layer. Put differently, I don't think you could write a Web Platform Test for the W3C for the parts of background sync you're talking about right?
In short, I'd love a new internals API to test behavior like this, but understand that the complexity may not be worth it. As time goes on, though, and especially with the "offline first" PWA ideal, I imagine this will become a bigger hole.
Makes sense, and I'm guessing I'll have to do the best that I can with browsers tests as well. I'm just sad that we can't test Web APIs that depend on network state at what we've traditionally used as the Web API testing layer. Put differently, I don't think you could write a Web Platform Test for the W3C for the parts of background sync you're talking about right?
In short, I'd love a new internals API to test behavior like this, but understand that the complexity may not be worth it. As time goes on, though, and especially with the "offline first" PWA ideal, I imagine this will become a bigger hole.
On Tue, Jun 7, 2016 at 7:22 AM, Joel Weinberger <j...@chromium.org> wrote:Makes sense, and I'm guessing I'll have to do the best that I can with browsers tests as well. I'm just sad that we can't test Web APIs that depend on network state at what we've traditionally used as the Web API testing layer. Put differently, I don't think you could write a Web Platform Test for the W3C for the parts of background sync you're talking about right?
I guess I philosophically disagree that it would be a good thing, for the normal reason that I would argue a unit test is superior to an integration tests. The costs, and risks, of integration tests (which LayoutTests are) are necessarily higher, riskier, and ultimately result in shipping 'testing' code to users. There needs to be a relatively high bar when asking all users to bear those costs.
Yoav: doesn't WPT define generic internals-like controls via testharness.js that user agents then back appropriately? I imagined something like that for turning off network connectivity; perhaps that's more fine grained of a control than we generally provide, though.
Can this be done as a SimTest? That would have many fewer layers than a BrowserTest, run faster and be less flaky.
--
You received this message because you are subscribed to the Google Groups "net-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to net-dev+u...@chromium.org.
To post to this group, send email to net...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/net-dev/9f4df822-015d-4279-8d2d-f66269af1243%40chromium.org.