Commit Graph

5 Commits

Author SHA1 Message Date
Daniel Martí
a0a36956a8 add support for opening multiple tabs
On a single browser, that is. And port the example from _example,
proving that it works.
2019-04-01 12:18:16 +01:00
Daniel Martí
f742f327a7 speed up the screenshot tests, and test the images
Using a smaller viewport speeds up both tests, and lets us know what
dimensions to expect in TestCaptureScreenshot.

For TestScreenshot, we can know what dimensions to expect in advance, as
we have the images in testdata.

'go test -run Screenshot' goes from ~0.9s to ~0.5s on my machine.

Finally, don't run ExampleTitle as part of 'go test', as it's slow.
2019-04-01 12:18:16 +01:00
Daniel Martí
0e92de5e65 make ExampleExecAllocatorOption less flaky
The Default folder is created asynchronously to Chrome starting to
listen on the debugging protocol port. So we can't expect it to exist.

Instead, base the example on DevToolsActivePort, which we can rely on.
2019-04-01 12:18:16 +01:00
Daniel Martí
b136a6267e remove Context's Wait method for now
All it did was wait on the entire allocator, which is confusing. From
the user's perspective, this wait method should instead wait for the
resources for its own browser, and not any other browsers sharing the
same allocator.

We haven't decided how to integrate that into our API, so simply replace
it with Allocator.Wait.
2019-04-01 12:18:16 +01:00
Daniel Martí
e698c943b3 make the simple and allocator examples runnable
This way, not only do we ensure that they always build, they're also
verified as part of 'go test'.
2019-04-01 12:18:16 +01:00