Files app, Audio & Video Player: Convert integration tests to JS modules

NOTE: Re-enables the closure type checking for these files.

Change the manifest for the test extensions to allow them to reach to
file_manager extension via chrom-extension:// to be able to share some
types for closure compilation.

Move some of the test data to its own file (from background.js) to avoid
circular dependency when the variable was used at the module level.

Bug: 1214953
Change-Id: Ic0df18065dded98d7b1d173edff09f66d0e1a77e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2936440
Reviewed-by: Noel Gordon <[email protected]>
Reviewed-by: Jeremie Boulic <[email protected]>
Commit-Queue: Luciano Pacheco <[email protected]>
Cr-Commit-Position: refs/heads/master@{#892885}
diff --git a/ui/file_manager/integration_tests/BUILD.gn b/ui/file_manager/integration_tests/BUILD.gn
index 10d426fb..f4dc15b 100644
--- a/ui/file_manager/integration_tests/BUILD.gn
+++ b/ui/file_manager/integration_tests/BUILD.gn
@@ -5,13 +5,19 @@
 import("//third_party/closure_compiler/compile_js.gni")
 
 js_type_check("closure_compile") {
-  uses_legacy_modules = true
   testonly = true
   deps = [
     ":remote_call",
     ":test_util",
-    "//ui/file_manager/file_manager/common/js:volume_manager_types",
   ]
+  closure_flags = strict_error_checking_closure_args + [
+                    "js_module_root=./gen/ui",
+                    "js_module_root=../../ui",
+                    "browser_resolver_prefix_replacements=\"chrome://test/=./\"",
+                    "browser_resolver_prefix_replacements=\"chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/=../file_manager/\"",
+
+                    "hide_warnings_for=third_party/",
+                  ]
 }
 
 js_library("remote_call") {
@@ -19,6 +25,7 @@
   deps = [
     ":test_util",
     "//ui/file_manager/file_manager/background/js:runtime_loaded_test_util",
+    "//ui/file_manager/file_manager/common/js:volume_manager_types.m",
   ]
   externs_list = [ "$externs_path/command_line_private.js" ]
 }
@@ -30,3 +37,7 @@
     "$externs_path/test.js",
   ]
 }
+
+js_library("testcase") {
+  testonly = true
+}