WebKit / Speedometer

An open source repository for the Speedometer benchmark
Other
592 stars 68 forks source link

Possibility to test in a top window? #403

Closed muodov closed 5 months ago

muodov commented 5 months ago

Some web browsers such as DuckDuckGo are based on WebViews. Unfortunately, there are limitations in WebView APIs when it comes to controlling iframes. This is most limiting in Android WebView, where some things like script injection can only be done in top frames.

Since Speedometer loads all the tests in an iframe, it makes it difficult to test WebViews. Is there a way to make it load tests in a separate tab, for example an auxiliary window opened with window.open()? I'm also happy to hack on a local copy, so would appreciate any thoughts and pointers.

I also realize that some of the tests may create their own iframes. This is ok, I'm just looking to avoid the topmost iframe nesting between the test harness and the test app.

muodov commented 5 months ago

I played with it in https://github.com/muodov/Speedometer/commit/281f8461592fd4a0ae7544ba38754497322b70cc, it seems to work, although you need to make sure to keep the runner window active, otherwise requestAnimationFrame() doesn't trigger

muodov commented 5 months ago

I've moved on from this idea because the background tab throttling seems to make this approach difficult, and you can't have both the harness and the test windows active at the same time.