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 { ...@@ -143,6 +143,11 @@ struct TestCase {
return *this; return *this;
} }
TestCase& DisableJsModules() {
options.enable_js_modules = false;
return *this;
}
std::string GetFullName() const { std::string GetFullName() const {
std::string full_name = name; std::string full_name = name;
...@@ -173,6 +178,9 @@ struct TestCase { ...@@ -173,6 +178,9 @@ struct TestCase {
if (options.single_partition_format) if (options.single_partition_format)
full_name += "_SinglePartitionFormat"; full_name += "_SinglePartitionFormat";
if (!options.enable_js_modules)
full_name += "_NonJsModule";
return full_name; return full_name;
} }
...@@ -264,17 +272,20 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P( ...@@ -264,17 +272,20 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
FilesAppBrowserTest, FilesAppBrowserTest,
::testing::Values( ::testing::Values(
TestCase("fileDisplayDownloads"), TestCase("fileDisplayDownloads"),
TestCase("fileDisplayDownloads").DisableJsModules(),
TestCase("fileDisplayDownloads").InGuestMode(), TestCase("fileDisplayDownloads").InGuestMode(),
TestCase("fileDisplayDownloads").TabletMode(), TestCase("fileDisplayDownloads").TabletMode(),
TestCase("fileDisplayLaunchOnLocalFolder").DontObserveFileTasks(), TestCase("fileDisplayLaunchOnLocalFolder").DontObserveFileTasks(),
TestCase("fileDisplayLaunchOnDrive").DontObserveFileTasks(), TestCase("fileDisplayLaunchOnDrive").DontObserveFileTasks(),
TestCase("fileDisplayDrive").TabletMode(), TestCase("fileDisplayDrive").TabletMode(),
TestCase("fileDisplayDrive"), TestCase("fileDisplayDrive"),
TestCase("fileDisplayDrive").DisableJsModules(),
TestCase("fileDisplayDriveOffline").Offline(), TestCase("fileDisplayDriveOffline").Offline(),
TestCase("fileDisplayDriveOnline"), TestCase("fileDisplayDriveOnline"),
TestCase("fileDisplayComputers"), TestCase("fileDisplayComputers"),
TestCase("fileDisplayMtp"), TestCase("fileDisplayMtp"),
TestCase("fileDisplayUsb"), TestCase("fileDisplayUsb"),
TestCase("fileDisplayUsb").DisableJsModules(),
TestCase("fileDisplayUsbPartition"), TestCase("fileDisplayUsbPartition"),
TestCase("fileDisplayUsbPartition").EnableSinglePartitionFormat(), TestCase("fileDisplayUsbPartition").EnableSinglePartitionFormat(),
TestCase("fileDisplayUsbPartitionSort"), TestCase("fileDisplayUsbPartitionSort"),
...@@ -317,6 +328,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P( ...@@ -317,6 +328,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
TestCase("audioOpenCloseDrive"), TestCase("audioOpenCloseDrive"),
TestCase("audioOpenDownloads").InGuestMode(), TestCase("audioOpenDownloads").InGuestMode(),
TestCase("audioOpenDownloads"), TestCase("audioOpenDownloads"),
TestCase("audioOpenDownloads").DisableJsModules(),
TestCase("audioOpenDrive"), TestCase("audioOpenDrive"),
TestCase("audioAutoAdvanceDrive"), TestCase("audioAutoAdvanceDrive"),
TestCase("audioRepeatAllModeSingleFileDrive"), TestCase("audioRepeatAllModeSingleFileDrive"),
...@@ -329,7 +341,9 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P( ...@@ -329,7 +341,9 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
WRAPPED_INSTANTIATE_TEST_SUITE_P( WRAPPED_INSTANTIATE_TEST_SUITE_P(
OpenImageBacklight, /* open_image_backlight.js */ OpenImageBacklight, /* open_image_backlight.js */
FilesAppBrowserTest, FilesAppBrowserTest,
::testing::Values(TestCase("imageOpenBacklight").MediaSwa().InGuestMode(), ::testing::Values(
TestCase("imageOpenBacklight").MediaSwa().InGuestMode(),
TestCase("imageOpenBacklight").MediaSwa().DisableJsModules(),
TestCase("imageOpenBacklight").MediaSwa())); TestCase("imageOpenBacklight").MediaSwa()));
WRAPPED_INSTANTIATE_TEST_SUITE_P( WRAPPED_INSTANTIATE_TEST_SUITE_P(
...@@ -337,6 +351,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P( ...@@ -337,6 +351,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
FilesAppBrowserTest, FilesAppBrowserTest,
::testing::Values(TestCase("imageOpenDownloads").InGuestMode(), ::testing::Values(TestCase("imageOpenDownloads").InGuestMode(),
TestCase("imageOpenDownloads"), TestCase("imageOpenDownloads"),
TestCase("imageOpenDownloads").DisableJsModules(),
TestCase("imageOpenDrive"), TestCase("imageOpenDrive"),
TestCase("imageOpenGalleryOpenDownloads"), TestCase("imageOpenGalleryOpenDownloads"),
TestCase("imageOpenGalleryOpenDrive"))); TestCase("imageOpenGalleryOpenDrive")));
...@@ -382,6 +397,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P( ...@@ -382,6 +397,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
TestCase("selectCreateFolderDownloads"), TestCase("selectCreateFolderDownloads"),
TestCase("createFolderDownloads").InGuestMode(), TestCase("createFolderDownloads").InGuestMode(),
TestCase("createFolderDownloads"), TestCase("createFolderDownloads"),
TestCase("createFolderDownloads").DisableJsModules(),
TestCase("createFolderNestedDownloads"), TestCase("createFolderNestedDownloads"),
TestCase("createFolderDrive"))); TestCase("createFolderDrive")));
...@@ -390,6 +406,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P( ...@@ -390,6 +406,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
FilesAppBrowserTest, FilesAppBrowserTest,
::testing::Values(TestCase("keyboardDeleteDownloads").InGuestMode(), ::testing::Values(TestCase("keyboardDeleteDownloads").InGuestMode(),
TestCase("keyboardDeleteDownloads"), TestCase("keyboardDeleteDownloads"),
TestCase("keyboardDeleteDownloads").DisableJsModules(),
TestCase("keyboardDeleteDrive"), TestCase("keyboardDeleteDrive"),
TestCase("keyboardDeleteFolderDownloads").InGuestMode(), TestCase("keyboardDeleteFolderDownloads").InGuestMode(),
TestCase("keyboardDeleteFolderDownloads"), TestCase("keyboardDeleteFolderDownloads"),
...@@ -470,6 +487,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P( ...@@ -470,6 +487,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
TestCase("toolbarDeleteButtonKeepFocus"), TestCase("toolbarDeleteButtonKeepFocus"),
TestCase("toolbarDeleteEntry").InGuestMode(), TestCase("toolbarDeleteEntry").InGuestMode(),
TestCase("toolbarDeleteEntry"), TestCase("toolbarDeleteEntry"),
TestCase("toolbarDeleteEntry").DisableJsModules(),
TestCase("toolbarRefreshButtonWithSelection").EnableArc(), TestCase("toolbarRefreshButtonWithSelection").EnableArc(),
TestCase("toolbarAltACommand"), TestCase("toolbarAltACommand"),
TestCase("toolbarRefreshButtonHiddenInRecents"), TestCase("toolbarRefreshButtonHiddenInRecents"),
...@@ -484,6 +502,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P( ...@@ -484,6 +502,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
FilesAppBrowserTest, FilesAppBrowserTest,
::testing::Values( ::testing::Values(
TestCase("openQuickView"), TestCase("openQuickView"),
TestCase("openQuickView").DisableJsModules(),
TestCase("openQuickViewDialog"), TestCase("openQuickViewDialog"),
TestCase("openQuickViewAndEscape"), TestCase("openQuickViewAndEscape"),
TestCase("openQuickView").InGuestMode(), TestCase("openQuickView").InGuestMode(),
...@@ -676,6 +695,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P( ...@@ -676,6 +695,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
FilesAppBrowserTest, FilesAppBrowserTest,
::testing::Values( ::testing::Values(
TestCase("transferFromDriveToDownloads"), TestCase("transferFromDriveToDownloads"),
TestCase("transferFromDriveToDownloads").DisableJsModules(),
TestCase("transferFromDownloadsToMyFiles"), TestCase("transferFromDownloadsToMyFiles"),
TestCase("transferFromDownloadsToMyFilesMove"), TestCase("transferFromDownloadsToMyFilesMove"),
TestCase("transferFromDownloadsToDrive"), TestCase("transferFromDownloadsToDrive"),
...@@ -757,8 +777,10 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P( ...@@ -757,8 +777,10 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
WRAPPED_INSTANTIATE_TEST_SUITE_P( WRAPPED_INSTANTIATE_TEST_SUITE_P(
Tasks, /* tasks.js */ Tasks, /* tasks.js */
FilesAppBrowserTest, FilesAppBrowserTest,
::testing::Values(TestCase("executeDefaultTaskDownloads"), ::testing::Values(
TestCase("executeDefaultTaskDownloads"),
TestCase("executeDefaultTaskDownloads").InGuestMode(), TestCase("executeDefaultTaskDownloads").InGuestMode(),
TestCase("executeDefaultTaskDownloads").DisableJsModules(),
TestCase("executeDefaultTaskDrive"), TestCase("executeDefaultTaskDrive"),
TestCase("defaultTaskForPdf"), TestCase("defaultTaskForPdf"),
TestCase("defaultTaskForTextPlain"), TestCase("defaultTaskForTextPlain"),
...@@ -807,12 +829,14 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P( ...@@ -807,12 +829,14 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
::testing::Values( ::testing::Values(
TestCase("openFileDialogUnload").WithBrowser(), TestCase("openFileDialogUnload").WithBrowser(),
TestCase("openFileDialogDownloads").WithBrowser(), TestCase("openFileDialogDownloads").WithBrowser(),
TestCase("openFileDialogDownloads").WithBrowser().DisableJsModules(),
TestCase("openFileDialogDownloads").WithBrowser().InGuestMode(), TestCase("openFileDialogDownloads").WithBrowser().InGuestMode(),
TestCase("openFileDialogDownloads").WithBrowser().InIncognito(), TestCase("openFileDialogDownloads").WithBrowser().InIncognito(),
TestCase("openFileDialogPanelsDisabled").WithBrowser(), TestCase("openFileDialogPanelsDisabled").WithBrowser(),
TestCase("openFileDialogAriaMultipleSelect").WithBrowser(), TestCase("openFileDialogAriaMultipleSelect").WithBrowser(),
TestCase("saveFileDialogAriaSingleSelect").WithBrowser(), TestCase("saveFileDialogAriaSingleSelect").WithBrowser(),
TestCase("saveFileDialogDownloads").WithBrowser(), TestCase("saveFileDialogDownloads").WithBrowser(),
TestCase("saveFileDialogDownloads").WithBrowser().DisableJsModules(),
TestCase("saveFileDialogDownloads").WithBrowser().InGuestMode(), TestCase("saveFileDialogDownloads").WithBrowser().InGuestMode(),
TestCase("saveFileDialogDownloads").WithBrowser().InIncognito(), TestCase("saveFileDialogDownloads").WithBrowser().InIncognito(),
TestCase("saveFileDialogDownloadsNewFolderButton").WithBrowser(), TestCase("saveFileDialogDownloadsNewFolderButton").WithBrowser(),
...@@ -847,8 +871,10 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P( ...@@ -847,8 +871,10 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
WRAPPED_INSTANTIATE_TEST_SUITE_P( WRAPPED_INSTANTIATE_TEST_SUITE_P(
CopyBetweenWindows, /* copy_between_windows.js */ CopyBetweenWindows, /* copy_between_windows.js */
FilesAppBrowserTest, FilesAppBrowserTest,
::testing::Values(TestCase("copyBetweenWindowsLocalToDrive"), ::testing::Values(
TestCase("copyBetweenWindowsLocalToDrive"),
TestCase("copyBetweenWindowsLocalToUsb"), TestCase("copyBetweenWindowsLocalToUsb"),
TestCase("copyBetweenWindowsLocalToUsb").DisableJsModules(),
TestCase("copyBetweenWindowsUsbToDrive"), TestCase("copyBetweenWindowsUsbToDrive"),
TestCase("copyBetweenWindowsDriveToLocal"), TestCase("copyBetweenWindowsDriveToLocal"),
TestCase("copyBetweenWindowsDriveToUsb"), TestCase("copyBetweenWindowsDriveToUsb"),
...@@ -860,6 +886,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P( ...@@ -860,6 +886,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
::testing::Values( ::testing::Values(
TestCase("showGridViewDownloads").InGuestMode(), TestCase("showGridViewDownloads").InGuestMode(),
TestCase("showGridViewDownloads"), TestCase("showGridViewDownloads"),
TestCase("showGridViewDownloads").DisableJsModules(),
TestCase("showGridViewDrive"), TestCase("showGridViewDrive"),
TestCase("showGridViewButtonSwitches"), TestCase("showGridViewButtonSwitches"),
TestCase("showGridViewKeyboardSelectionA11y"), TestCase("showGridViewKeyboardSelectionA11y"),
...@@ -872,6 +899,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P( ...@@ -872,6 +899,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
ExtendedFilesAppBrowserTest, ExtendedFilesAppBrowserTest,
::testing::Values(TestCase("requestMount"), ::testing::Values(TestCase("requestMount"),
TestCase("requestMount").DisableNativeSmb(), TestCase("requestMount").DisableNativeSmb(),
TestCase("requestMount").DisableJsModules(),
TestCase("requestMountMultipleMounts"), TestCase("requestMountMultipleMounts"),
TestCase("requestMountMultipleMounts").DisableNativeSmb(), TestCase("requestMountMultipleMounts").DisableNativeSmb(),
TestCase("requestMountSourceDevice"), TestCase("requestMountSourceDevice"),
...@@ -964,6 +992,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P( ...@@ -964,6 +992,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
FilesAppBrowserTest, FilesAppBrowserTest,
::testing::Values(TestCase("launcherOpenSearchResult"), ::testing::Values(TestCase("launcherOpenSearchResult"),
TestCase("launcherSearch"), TestCase("launcherSearch"),
TestCase("launcherSearch").DisableJsModules(),
TestCase("launcherSearchOffline").Offline())); TestCase("launcherSearchOffline").Offline()));
WRAPPED_INSTANTIATE_TEST_SUITE_P( WRAPPED_INSTANTIATE_TEST_SUITE_P(
...@@ -998,6 +1027,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P( ...@@ -998,6 +1027,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
Search, /* search.js */ Search, /* search.js */
FilesAppBrowserTest, FilesAppBrowserTest,
::testing::Values(TestCase("searchDownloadsWithResults"), ::testing::Values(TestCase("searchDownloadsWithResults"),
TestCase("searchDownloadsWithResults").DisableJsModules(),
TestCase("searchDownloadsWithNoResults"), TestCase("searchDownloadsWithNoResults"),
TestCase("searchDownloadsClearSearchKeyDown"), TestCase("searchDownloadsClearSearchKeyDown"),
TestCase("searchDownloadsClearSearch"), TestCase("searchDownloadsClearSearch"),
...@@ -1015,6 +1045,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P( ...@@ -1015,6 +1045,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
Breadcrumbs, /* breadcrumbs.js */ Breadcrumbs, /* breadcrumbs.js */
FilesAppBrowserTest, FilesAppBrowserTest,
::testing::Values(TestCase("breadcrumbsNavigate"), ::testing::Values(TestCase("breadcrumbsNavigate"),
TestCase("breadcrumbsNavigate").DisableJsModules(),
TestCase("breadcrumbsDownloadsTranslation"), TestCase("breadcrumbsDownloadsTranslation"),
TestCase("breadcrumbsRenderShortPath"), TestCase("breadcrumbsRenderShortPath"),
TestCase("breadcrumbsEliderButtonHidden"), TestCase("breadcrumbsEliderButtonHidden"),
...@@ -1033,6 +1064,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P( ...@@ -1033,6 +1064,7 @@ WRAPPED_INSTANTIATE_TEST_SUITE_P(
FilesAppBrowserTest, FilesAppBrowserTest,
::testing::Values( ::testing::Values(
TestCase("formatDialog"), TestCase("formatDialog"),
TestCase("formatDialog").DisableJsModules(),
TestCase("formatDialogEmpty"), TestCase("formatDialogEmpty"),
TestCase("formatDialogCancel"), TestCase("formatDialogCancel"),
TestCase("formatDialogNameLength"), TestCase("formatDialogNameLength"),
......
...@@ -740,6 +740,7 @@ std::ostream& operator<<(std::ostream& out, ...@@ -740,6 +740,7 @@ std::ostream& operator<<(std::ostream& out,
PRINT_IF_NOT_DEFAULT(tablet_mode) PRINT_IF_NOT_DEFAULT(tablet_mode)
PRINT_IF_NOT_DEFAULT(zip) PRINT_IF_NOT_DEFAULT(zip)
PRINT_IF_NOT_DEFAULT(zip_no_nacl) PRINT_IF_NOT_DEFAULT(zip_no_nacl)
PRINT_IF_NOT_DEFAULT(enable_js_modules)
#undef PRINT_IF_NOT_DEFAULT #undef PRINT_IF_NOT_DEFAULT
...@@ -1715,6 +1716,12 @@ void FileManagerBrowserTestBase::SetUpCommandLine( ...@@ -1715,6 +1716,12 @@ void FileManagerBrowserTestBase::SetUpCommandLine(
disabled_features.push_back(ash::features::kTemporaryHoldingSpace); 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") && if (command_line->HasSwitch("devtools-code-coverage") &&
options.guest_mode != IN_INCOGNITO) { options.guest_mode != IN_INCOGNITO) {
devtools_code_coverage_dir_ = devtools_code_coverage_dir_ =
......
...@@ -111,6 +111,9 @@ class FileManagerBrowserTestBase : public content::DevToolsAgentHostObserver, ...@@ -111,6 +111,9 @@ class FileManagerBrowserTestBase : public content::DevToolsAgentHostObserver,
// Whether test should enable holding space. // Whether test should enable holding space.
bool enable_holding_space = false; bool enable_holding_space = false;
// Whether test should run Files app UI as JS modules.
bool enable_js_modules = true;
}; };
protected: 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