Files app: Fix test stepper with async load of test functions
After crrev.com/c/1322340 which changed test functions to be lazy loaded (asynchronously), running tests in step-by-step mode wasn't working if tried to step after Files app background page was put to sleep for inactivity. There were 2 issues: 1. The logic was relying on a global state window.IN_TEST which gets lost when extension goes to sleep. 2 Any queued response was replied with sendResponse(true), which was skipping the execution of the test function that it requested to run. This CL fixes both of these issues by doing: 1. Instead of relying on window.IN_TEST, it checks if test functions are loaded with: "test.util.executeTestMessage !== null", if so runs the requested function, otherwise en-queues the request and async-loads the test functions. 2. Change to en-queue both the request and the sendResponse to be able to run the requested functions once the test functions are fully loaded. This new design, made |enableTesting| and |ensureLoaded_| routines not necessary anymore and they were removed. Test: Manually run tests with the flags: --ui-test-action-timeout=100000 --enable-file-manager-step-by-step-tests --remote-debugging-port=9222 and waited all extensions to disappear before issuing a step. Also triggered MSAN and ASAN bots in addition to normal bots. Bug: 903669 Change-Id: Ia66f7ce7cd920a7a815340119591ff5ff957603c Reviewed-on: https://chromium-review.googlesource.com/c/1333177 Commit-Queue: Luciano Pacheco <lucmult@chromium.org> Reviewed-by:Noel Gordon <noel@chromium.org> Cr-Commit-Position: refs/heads/master@{#607842}
Showing
Please register or sign in to comment