Commit e74e634d authored by Luciano Pacheco's avatar Luciano Pacheco Committed by Chromium LUCI CQ

Files app: Enable tests to run as JS modules

Enable all integration tests to run as JS modules.

I have hand selected some tests to continue to run as non-js-modules to
have some coverage in case we need to flip back to it.

Bug: 1133186
Change-Id: Iddb5b65bd82c62a5288e856bdd0ff5587f80ac24
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2641688Reviewed-by: default avatarJeremie Boulic <jboulic@chromium.org>
Commit-Queue: Luciano Pacheco <lucmult@chromium.org>
Commit-Queue: Jeremie Boulic <jboulic@chromium.org>
Auto-Submit: Luciano Pacheco <lucmult@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845552}
parent 1d0bc611
......@@ -143,6 +143,11 @@ struct TestCase {
return *this;
}
TestCase& DisableJsModules() {
options.enable_js_modules = false;
return *this;
}
std::string GetFullName() const {
std::string full_name = name;
......@@ -173,6 +178,9 @@ struct TestCase {
if (options.single_partition_format)
full_name += "_SinglePartitionFormat";
if (!options.enable_js_modules)
full_name += "_NonJsModule";
return full_name;
}
......@@ -264,17 +272,20 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
FilesAppBrowserTest,
::testing::Values(
TestCase("fileDisplayDownloads"),
TestCase("fileDisplayDownloads").DisableJsModules(),
TestCase("fileDisplayDownloads").InGuestMode(),
TestCase("fileDisplayDownloads").TabletMode(),
TestCase("fileDisplayLaunchOnLocalFolder").DontObserveFileTasks(),
TestCase("fileDisplayLaunchOnDrive").DontObserveFileTasks(),
TestCase("fileDisplayDrive").TabletMode(),
TestCase("fileDisplayDrive"),
TestCase("fileDisplayDrive").DisableJsModules(),
TestCase("fileDisplayDriveOffline").Offline(),
TestCase("fileDisplayDriveOnline"),
TestCase("fileDisplayComputers"),
TestCase("fileDisplayMtp"),
TestCase("fileDisplayUsb"),
TestCase("fileDisplayUsb").DisableJsModules(),
TestCase("fileDisplayUsbPartition"),
TestCase("fileDisplayUsbPartition").EnableSinglePartitionFormat(),
TestCase("fileDisplayUsbPartitionSort"),
......@@ -317,6 +328,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
TestCase("audioOpenCloseDrive"),
TestCase("audioOpenDownloads").InGuestMode(),
TestCase("audioOpenDownloads"),
TestCase("audioOpenDownloads").DisableJsModules(),
TestCase("audioOpenDrive"),
TestCase("audioAutoAdvanceDrive"),
TestCase("audioRepeatAllModeSingleFileDrive"),
......@@ -329,14 +341,17 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
WRAPPED_INSTANTIATE_TEST_SUITE_P(
OpenImageBacklight, /* open_image_backlight.js */
FilesAppBrowserTest,
::testing::Values(TestCase("imageOpenBacklight").MediaSwa().InGuestMode(),
TestCase("imageOpenBacklight").MediaSwa()));
::testing::Values(
TestCase("imageOpenBacklight").MediaSwa().InGuestMode(),
TestCase("imageOpenBacklight").MediaSwa().DisableJsModules(),
TestCase("imageOpenBacklight").MediaSwa()));
WRAPPED_INSTANTIATE_TEST_SUITE_P(
OpenImageFiles, /* open_image_files.js */
FilesAppBrowserTest,
::testing::Values(TestCase("imageOpenDownloads").InGuestMode(),
TestCase("imageOpenDownloads"),
TestCase("imageOpenDownloads").DisableJsModules(),
TestCase("imageOpenDrive"),
TestCase("imageOpenGalleryOpenDownloads"),
TestCase("imageOpenGalleryOpenDrive")));
......@@ -382,6 +397,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
TestCase("selectCreateFolderDownloads"),
TestCase("createFolderDownloads").InGuestMode(),
TestCase("createFolderDownloads"),
TestCase("createFolderDownloads").DisableJsModules(),
TestCase("createFolderNestedDownloads"),
TestCase("createFolderDrive")));
......@@ -390,6 +406,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
FilesAppBrowserTest,
::testing::Values(TestCase("keyboardDeleteDownloads").InGuestMode(),
TestCase("keyboardDeleteDownloads"),
TestCase("keyboardDeleteDownloads").DisableJsModules(),
TestCase("keyboardDeleteDrive"),
TestCase("keyboardDeleteFolderDownloads").InGuestMode(),
TestCase("keyboardDeleteFolderDownloads"),
......@@ -470,6 +487,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
TestCase("toolbarDeleteButtonKeepFocus"),
TestCase("toolbarDeleteEntry").InGuestMode(),
TestCase("toolbarDeleteEntry"),
TestCase("toolbarDeleteEntry").DisableJsModules(),
TestCase("toolbarRefreshButtonWithSelection").EnableArc(),
TestCase("toolbarAltACommand"),
TestCase("toolbarRefreshButtonHiddenInRecents"),
......@@ -484,6 +502,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
FilesAppBrowserTest,
::testing::Values(
TestCase("openQuickView"),
TestCase("openQuickView").DisableJsModules(),
TestCase("openQuickViewDialog"),
TestCase("openQuickViewAndEscape"),
TestCase("openQuickView").InGuestMode(),
......@@ -676,6 +695,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
FilesAppBrowserTest,
::testing::Values(
TestCase("transferFromDriveToDownloads"),
TestCase("transferFromDriveToDownloads").DisableJsModules(),
TestCase("transferFromDownloadsToMyFiles"),
TestCase("transferFromDownloadsToMyFilesMove"),
TestCase("transferFromDownloadsToDrive"),
......@@ -757,18 +777,20 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
WRAPPED_INSTANTIATE_TEST_SUITE_P(
Tasks, /* tasks.js */
FilesAppBrowserTest,
::testing::Values(TestCase("executeDefaultTaskDownloads"),
TestCase("executeDefaultTaskDownloads").InGuestMode(),
TestCase("executeDefaultTaskDrive"),
TestCase("defaultTaskForPdf"),
TestCase("defaultTaskForTextPlain"),
TestCase("defaultTaskDialogDownloads"),
TestCase("defaultTaskDialogDownloads").InGuestMode(),
TestCase("defaultTaskDialogDrive"),
TestCase("changeDefaultDialogScrollList"),
TestCase("genericTaskIsNotExecuted"),
TestCase("genericTaskAndNonGenericTask"),
TestCase("noActionBarOpenForDirectories")));
::testing::Values(
TestCase("executeDefaultTaskDownloads"),
TestCase("executeDefaultTaskDownloads").InGuestMode(),
TestCase("executeDefaultTaskDownloads").DisableJsModules(),
TestCase("executeDefaultTaskDrive"),
TestCase("defaultTaskForPdf"),
TestCase("defaultTaskForTextPlain"),
TestCase("defaultTaskDialogDownloads"),
TestCase("defaultTaskDialogDownloads").InGuestMode(),
TestCase("defaultTaskDialogDrive"),
TestCase("changeDefaultDialogScrollList"),
TestCase("genericTaskIsNotExecuted"),
TestCase("genericTaskAndNonGenericTask"),
TestCase("noActionBarOpenForDirectories")));
WRAPPED_INSTANTIATE_TEST_SUITE_P(
FolderShortcuts, /* folder_shortcuts.js */
......@@ -807,12 +829,14 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
::testing::Values(
TestCase("openFileDialogUnload").WithBrowser(),
TestCase("openFileDialogDownloads").WithBrowser(),
TestCase("openFileDialogDownloads").WithBrowser().DisableJsModules(),
TestCase("openFileDialogDownloads").WithBrowser().InGuestMode(),
TestCase("openFileDialogDownloads").WithBrowser().InIncognito(),
TestCase("openFileDialogPanelsDisabled").WithBrowser(),
TestCase("openFileDialogAriaMultipleSelect").WithBrowser(),
TestCase("saveFileDialogAriaSingleSelect").WithBrowser(),
TestCase("saveFileDialogDownloads").WithBrowser(),
TestCase("saveFileDialogDownloads").WithBrowser().DisableJsModules(),
TestCase("saveFileDialogDownloads").WithBrowser().InGuestMode(),
TestCase("saveFileDialogDownloads").WithBrowser().InIncognito(),
TestCase("saveFileDialogDownloadsNewFolderButton").WithBrowser(),
......@@ -847,12 +871,14 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
WRAPPED_INSTANTIATE_TEST_SUITE_P(
CopyBetweenWindows, /* copy_between_windows.js */
FilesAppBrowserTest,
::testing::Values(TestCase("copyBetweenWindowsLocalToDrive"),
TestCase("copyBetweenWindowsLocalToUsb"),
TestCase("copyBetweenWindowsUsbToDrive"),
TestCase("copyBetweenWindowsDriveToLocal"),
TestCase("copyBetweenWindowsDriveToUsb"),
TestCase("copyBetweenWindowsUsbToLocal")));
::testing::Values(
TestCase("copyBetweenWindowsLocalToDrive"),
TestCase("copyBetweenWindowsLocalToUsb"),
TestCase("copyBetweenWindowsLocalToUsb").DisableJsModules(),
TestCase("copyBetweenWindowsUsbToDrive"),
TestCase("copyBetweenWindowsDriveToLocal"),
TestCase("copyBetweenWindowsDriveToUsb"),
TestCase("copyBetweenWindowsUsbToLocal")));
WRAPPED_INSTANTIATE_TEST_SUITE_P(
GridView, /* grid_view.js */
......@@ -860,6 +886,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
::testing::Values(
TestCase("showGridViewDownloads").InGuestMode(),
TestCase("showGridViewDownloads"),
TestCase("showGridViewDownloads").DisableJsModules(),
TestCase("showGridViewDrive"),
TestCase("showGridViewButtonSwitches"),
TestCase("showGridViewKeyboardSelectionA11y"),
......@@ -872,6 +899,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
ExtendedFilesAppBrowserTest,
::testing::Values(TestCase("requestMount"),
TestCase("requestMount").DisableNativeSmb(),
TestCase("requestMount").DisableJsModules(),
TestCase("requestMountMultipleMounts"),
TestCase("requestMountMultipleMounts").DisableNativeSmb(),
TestCase("requestMountSourceDevice"),
......@@ -964,6 +992,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
FilesAppBrowserTest,
::testing::Values(TestCase("launcherOpenSearchResult"),
TestCase("launcherSearch"),
TestCase("launcherSearch").DisableJsModules(),
TestCase("launcherSearchOffline").Offline()));
WRAPPED_INSTANTIATE_TEST_SUITE_P(
......@@ -998,6 +1027,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
Search, /* search.js */
FilesAppBrowserTest,
::testing::Values(TestCase("searchDownloadsWithResults"),
TestCase("searchDownloadsWithResults").DisableJsModules(),
TestCase("searchDownloadsWithNoResults"),
TestCase("searchDownloadsClearSearchKeyDown"),
TestCase("searchDownloadsClearSearch"),
......@@ -1015,6 +1045,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
Breadcrumbs, /* breadcrumbs.js */
FilesAppBrowserTest,
::testing::Values(TestCase("breadcrumbsNavigate"),
TestCase("breadcrumbsNavigate").DisableJsModules(),
TestCase("breadcrumbsDownloadsTranslation"),
TestCase("breadcrumbsRenderShortPath"),
TestCase("breadcrumbsEliderButtonHidden"),
......@@ -1033,6 +1064,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
FilesAppBrowserTest,
::testing::Values(
TestCase("formatDialog"),
TestCase("formatDialog").DisableJsModules(),
TestCase("formatDialogEmpty"),
TestCase("formatDialogCancel"),
TestCase("formatDialogNameLength"),
......
......@@ -740,6 +740,7 @@ std::ostream& operator<<(std::ostream& out,
PRINT_IF_NOT_DEFAULT(tablet_mode)
PRINT_IF_NOT_DEFAULT(zip)
PRINT_IF_NOT_DEFAULT(zip_no_nacl)
PRINT_IF_NOT_DEFAULT(enable_js_modules)
#undef PRINT_IF_NOT_DEFAULT
......@@ -1715,6 +1716,12 @@ void FileManagerBrowserTestBase::SetUpCommandLine(
disabled_features.push_back(ash::features::kTemporaryHoldingSpace);
}
if (options.enable_js_modules) {
enabled_features.push_back(chromeos::features::kFilesJsModules);
} else {
disabled_features.push_back(chromeos::features::kFilesJsModules);
}
if (command_line->HasSwitch("devtools-code-coverage") &&
options.guest_mode != IN_INCOGNITO) {
devtools_code_coverage_dir_ =
......
......@@ -111,6 +111,9 @@ class FileManagerBrowserTestBase : public content::DevToolsAgentHostObserver,
// Whether test should enable holding space.
bool enable_holding_space = false;
// Whether test should run Files app UI as JS modules.
bool enable_js_modules = true;
};
protected:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment