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

Files app: Fix file picker to open as JS modules based on the flag

Bug: 1133186
Change-Id: Ib1bdd895ef7872d940cebcf8825a90f575db5082
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2643671
Commit-Queue: Jeremie Boulic <jboulic@chromium.org>
Auto-Submit: Luciano Pacheco <lucmult@chromium.org>
Reviewed-by: default avatarJeremie Boulic <jboulic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845960}
parent 1b90c2f0
...@@ -66,7 +66,11 @@ std::string GetDialogTypeAsString( ...@@ -66,7 +66,11 @@ std::string GetDialogTypeAsString(
} // namespace } // namespace
GURL GetFileManagerMainPageUrl() { GURL GetFileManagerMainPageUrl() {
return GetFileManagerUrl("/main.html"); if (base::FeatureList::IsEnabled(chromeos::features::kFilesJsModules)) {
return GetFileManagerUrl("/main_modules.html");
} else {
return GetFileManagerUrl("/main.html");
}
} }
GURL GetFileManagerMainPageUrlWithParams( GURL GetFileManagerMainPageUrlWithParams(
......
...@@ -38,8 +38,14 @@ std::string PrettyPrintEscapedJson(const std::string& query) { ...@@ -38,8 +38,14 @@ std::string PrettyPrintEscapedJson(const std::string& query) {
} }
TEST(FileManagerUrlUtilTest, GetFileManagerMainPageUrl) { TEST(FileManagerUrlUtilTest, GetFileManagerMainPageUrl) {
EXPECT_EQ("chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/main.html", if (base::FeatureList::IsEnabled(chromeos::features::kFilesJsModules)) {
GetFileManagerMainPageUrl().spec()); EXPECT_EQ(
"chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/main_modules.html",
GetFileManagerMainPageUrl().spec());
} else {
EXPECT_EQ("chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/main.html",
GetFileManagerMainPageUrl().spec());
}
} }
TEST(FileManagerUrlUtilTest, GetFileManagerMainPageUrlWithParams_NoFileTypes) { TEST(FileManagerUrlUtilTest, GetFileManagerMainPageUrlWithParams_NoFileTypes) {
......
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