Files app: Auto generate JS unittest HTML with deps using
chrome://file_manager_test/ Add js_test_gen_html build template and script that works similarly to js_unit_tests, which generates a HTML file with all JS dependencies to be able to run the JS unit tests. The new js_test_gen_html has 3 different behaviours from js_unit_tests: 1. Point scripts to chrome:// URLs instead of using file system files and directories. The files are served from either regular chrome://resources or from the test-only chrome://file_manager_test/. This allows to run tests for Polymer elements that load JS/HTML from chrome:// URLs. 2. Takes care of special cases where file paths aren't directly served from chrome://resources e.g.: jstemplate and some Polymer pahts. 3. Add the "html_import" boolean config to allow to use HTML Imports instead of <script> for unittesting Polymer elements. Change TestFilesDataSource (which backs chrome://file_manager_test/) to serve: 1. From //src/ and from //$OUT/gen/. From //$OUT/gen is to be able to serve the generated HTML file, all other files are served from //src/. 2. Serve both roots //src/ and //$OUT/gen/ instead of narrowing down only to ./ui/file_manager/, this makes simpler to keep the difference from previous path style for all apps (Files, Gallery, etc). Convert all unittests from //ui/file_manager/file_manager/ to use js_test_gen_html instead of js_unit_tests. Test: browser_tests --gtest_filter="FileManagerJsTest.*" Bug: 991105 Change-Id: I61c17edd4af10ac5ba739725585c23472b27b49e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1767297 Commit-Queue: Luciano Pacheco <lucmult@chromium.org> Reviewed-by:Trent Apted <tapted@chromium.org> Auto-Submit: Luciano Pacheco <lucmult@chromium.org> Cr-Commit-Position: refs/heads/master@{#691960}
Showing
This diff is collapsed.
Please register or sign in to comment