36 Commits

Author SHA1 Message Date
Dmitry Gozman
57e8617474
chore: refactor impl-side events to be per-class (#3569) 2020-08-21 16:26:33 -07:00
Dmitry Gozman
9790ea5b5d
chore: align more server-side options with rpc protocol (#3506)
This touches:
- noDefaultViewport;
- ignoreAllDefaultArgs;
- env;
- validateXYZ logic that was copying objects - we do not need that anymore;
- shuffles some converters closer to their usage.
2020-08-18 09:37:40 -07:00
Dmitry Gozman
58fc6b4003
chore: align some server-side methods with rpc calls (#3504)
- Never write to console on the server side - we use stdout for
  communication. This includes logPolitely and deprecate.
- Pass undefined instead of null in some BrowserContext methods.
- Use explicit _setFileChooserIntercepted instead of on/off magic.
2020-08-17 16:19:21 -07:00
Dmitry Gozman
141a255a07
chore: remove unused methods from server side (#3502)
Most of these were api methods that are no longer called directly.
2020-08-17 14:36:51 -07:00
Dmitry Gozman
1e9c0eb705
chore: remove logger infrastructure from server side (#3487)
We do not implement LoggerSink on the server, so we can
use a simple debugLogger.
2020-08-17 14:12:31 -07:00
Dmitry Gozman
bc23324878
chore: remove apiName plumbing and some unused methods from server side (#3481)
We append apiName where needed on the client instead.
2020-08-14 18:25:32 -07:00
Dmitry Gozman
ae4280a12b
chore: cleanup more non-rpc code (#3471)
- Replaces BrowserServer class with BrowserProcess struct.
- Removes src/api.ts.
- Removes helper.installApiHooks.
- Removes BrowserType.launchServer.
2020-08-14 13:19:12 -07:00
Dmitry Gozman
2bed312911
fix(electron): emit close events in the correct order (#3111) 2020-07-23 11:02:43 -07:00
Dmitry Gozman
5848ed8f41
feat(rpc): introduce protocol.pdl (#3054)
We now generate channels.ts from the protocol definition. There are still some shortcomings,
like union types - these will be addressed in follow ups.
2020-07-20 17:38:06 -07:00
Dmitry Gozman
aa4c893b09
feat(rpc): implement waitForNavigation on the client (#2949)
Drive-by: fix electron issues, exposed by the test using
waitForNavigation.

Drive-by: mark some tests skip(CHANNEL) that were mistakenly
marked skip(USES_HOOKS).
2020-07-15 18:48:19 -07:00
Dmitry Gozman
cc8fe5a763
feat(rpc): support electron (#2933) 2020-07-13 21:46:59 -07:00
Dmitry Gozman
8fe29feb21
feat(rpc): support more chromium-specific apis (#2883)
This includes page CDPSession, backgroundPages() and serviceWorkers().

This has also revealed an issue with closing order between the context
and the service worker.
2020-07-08 21:36:03 -07:00
Dmitry Gozman
2a86ead0ac
chore: replace FrameTask with internal events on Frame (#2856)
We now use a few helper.waitForEvent calls to wait for internal
events kNavigationEvent and kLifecycleEvent. With these events,
we should be able to replicate logic over rpc.
2020-07-07 15:22:05 -07:00
Pavel Feldman
fca514d74e
chore: move non-trivial types out of types.ts (#2680) 2020-06-23 14:51:06 -07:00
Pavel Feldman
c220fc7f46
chore(logs): rework logs for simplicity (#2592) 2020-06-16 17:11:19 -07:00
Dmitry Gozman
1bb33650b0
chore: remove ExtendedEventEmitter and inline waitForEvent (#2529) 2020-06-10 15:12:50 -07:00
Dmitry Gozman
80705ff5e9
chore: simplify logging a bit (#2512)
This merges a few classes and stops inheriting from InnerLogger.
2020-06-09 16:11:17 -07:00
Dmitry Gozman
3ec79e17fc
chore: simplify timeout handling in progress (#2487) 2020-06-05 15:53:30 -07:00
Dmitry Gozman
300099734c
chore: migrate waitForEvent to Progress (#2483)
Drive-by: remove/simplify some helper code.
2020-06-05 14:14:19 -07:00
Dmitry Gozman
1d37a10558
chore: migrate navigations to Progress (#2463) 2020-06-04 16:43:48 -07:00
Dmitry Gozman
d5c992e1db
chore: unify evaluations across browsers even more (#2459)
This moves all the logic around UtilityScript to javascript.ts.
Also uncovers a bug in WebKit where we cannot returnByValue after navigation.
2020-06-03 17:50:16 -07:00
Dmitry Gozman
8e6375f532
chore: reduce the number of evaluate methods, improve types (#2454)
Types can now handle non-trivial tuples with handles inside.
2020-06-03 13:22:05 -07:00
Dmitry Gozman
d980ed7e7e
chore: introduce Progress concept (#2350)
A progress roughly corresponds to an api call. It is used:

- to collect logs related to the call;
- to handle timeout;
- to provide "cancellation token" behavior so that cancelable process can either
  early-exit with progress.throwIfCanceled() or race against it with progress.race();
- to ensure resources are disposed in the case of a failure
  with progress.cleanupWhenCanceled();
- (possibly) to log api calls if needed;
- (in the future) to augment async stacks.
2020-05-29 14:39:34 -07:00
Dmitry Gozman
057ae14adc
feat: make browserServer.kill() wait for the process to exit (#2375)
This ensures we cleaned everything up.
2020-05-27 19:59:03 -07:00
Dmitry Gozman
1e2b46437d
feat(debug): when debugging, use zero as default timeout (#2362)
Otherwise, operations always time out while stepping in debugger.
2020-05-27 13:25:57 -07:00
Dmitry Gozman
27d30fe162
chore: encapsulate more launching logic in BrowserType (#2339) 2020-05-22 16:06:00 -07:00
Dmitry Gozman
aae3f1e75d
feat(default context): support selected options for default context (#2177) 2020-05-21 15:13:16 -07:00
Pavel Feldman
2ede4bce12
chore: further unify launching and connection (#2320) 2020-05-21 09:43:10 -07:00
Pavel Feldman
f9b437a49e
chore: pull common functionality into the BrowserTypeBase (#2312) 2020-05-20 16:30:04 -07:00
Pavel Feldman
e558f0516b
chore: print the launch error message to console (#2304) 2020-05-20 00:10:10 -07:00
Dmitry Gozman
82cab094e8
feat(logging): add logging to websocket transport (#2289) 2020-05-18 19:00:38 -07:00
Dmitry Gozman
e8e761f77f
chore: use internal BrowserOptions to unify browsers (#2230) 2020-05-14 13:22:33 -07:00
Joel Einbinder
dbef7de42a
feat(electron): types (#2231) 2020-05-13 20:51:53 -07:00
Pavel Feldman
414ae0025e
fix(electron): handle in-event await errors (#2207) 2020-05-12 15:28:37 -07:00
Pavel Feldman
3f8dfed67f
feat(electron): add app.firstWindow convenience method (#2195) 2020-05-12 08:43:41 -07:00
Pavel Feldman
ffe7084652
feat(electron): experimental electron support (#2166) 2020-05-11 18:00:33 -07:00