addRoutes currently returns a promise without using the ability to resolve/reject the promise asynchronously.
Looking at Chromium implementation, it seems that the promise is resolved asynchronously (probably after storing the route out of process).
The spec could be written as follows:
- Validate parameters synchronously, reject as needed (like current spec)
- If parameters are valid, In parallel, try storing the new route
- If storing the route fails, queue a task to reject the promise
- Otherwise, queue a task to resolve the promise