CrOS Files: Don't bake-in so much test code to background_scripts.js.
Instead, load it lazily the first time a testing extension connects and wants to use the remote call APIs. This avoids having to parse the testing code every time any of the ui/file_manager apps start up (in release, or in tests). Note that current tests (e.g. gallery) may start up a background page with this test code up to *four times* for each test. After this change, only the app under test will load the testing code. There may still be some added latency. To help balance that, this CL caches the result of RemoteCall.isStepByStepEnabled(). That makes it consistent with the newly added function anyway. This still distributes the testing code in release, which is not ideal. Loading from a filesystem:// URL might avoid that in future. This should probably also use an ES6 module.. Baby steps. Bug: 903669 Cq-Include-Trybots: luci.chromium.try:closure_compilation Change-Id: I7acf6b55b10fa775d40bae48b81b0cfd1859df56 Reviewed-on: https://chromium-review.googlesource.com/c/1322340 Commit-Queue: Trent Apted <tapted@chromium.org> Reviewed-by:Noel Gordon <noel@chromium.org> Cr-Commit-Position: refs/heads/master@{#606742}
Showing
This diff is collapsed.
This diff is collapsed.
Please register or sign in to comment