Commit a5b9c8b3 authored by David Bertoni's avatar David Bertoni Committed by Chromium LUCI CQ

[Extensions] Clean up uses of kFlagEnableFileAccess.

These uses of the this flag were to prevent flakiness with Service
Worker-based tests. Now that the UnpackedInstaller is fixed with
regard to granting file access and incognito permissions, these
workarounds are no longer needed.

Bug: 1146173
Change-Id: Ic07e6482592767f3666e17c4cfc8bf0c5d70509e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2610937Reviewed-by: default avatarKelvin Jiang <kelvinjiang@chromium.org>
Commit-Queue: David Bertoni <dbertoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841196}
parent 7296e734
......@@ -73,13 +73,8 @@ IN_PROC_BROWSER_TEST_P(BookmarksApiTest, Bookmarks) {
if (GetParam() == ContextType::kEventPage) {
ASSERT_TRUE(RunExtensionTest("bookmarks")) << message_;
} else {
// TODO(https://crbug.com/1146173): This test is being run with
// file access to prevent flakiness for the SW version. This should
// be reverted to run without file access when this bug is fixed.
ASSERT_TRUE(RunExtensionTestWithFlags(
"bookmarks",
kFlagRunAsServiceWorkerBasedExtension | kFlagEnableFileAccess,
kFlagNone))
"bookmarks", kFlagRunAsServiceWorkerBasedExtension, kFlagNone))
<< message_;
}
}
......
......@@ -232,10 +232,7 @@ class ExtensionContentSettingsApiLazyTest
protected:
bool RunLazyTest(const std::string& extension_name) {
// TODO(https://crbug.com/1146173): These tests are being run with
// file access to prevent flakiness for the SW version. This should
// be reverted to run without file access when this bug is fixed.
int browser_test_flags = kFlagEnableFileAccess;
int browser_test_flags = kFlagNone;
if (GetParam() == ContextType::kServiceWorker)
browser_test_flags |= kFlagRunAsServiceWorkerBasedExtension;
......
......@@ -65,13 +65,8 @@ class NativeMessagingLazyApiTest
if (GetParam() == ContextType::kEventPage) {
return RunExtensionTest(extension_name);
}
// TODO(https://crbug.com/1146173): These tests are being run with
// file access to prevent flakiness for the SW version. This should
// be reverted to run without file access when this bug is fixed.
return RunExtensionTestWithFlags(
extension_name,
kFlagRunAsServiceWorkerBasedExtension | kFlagEnableFileAccess,
kFlagNone);
extension_name, kFlagRunAsServiceWorkerBasedExtension, kFlagNone);
}
std::unique_ptr<ScopedWorkerBasedExtensionsChannel> current_channel_;
......
......@@ -146,7 +146,7 @@ class ExtensionMetricsApiTest
}
bool RunComponentTestWithParamFlag(const std::string& extension_name) {
int flags = kFlagEnableFileAccess;
int flags = kFlagNone;
if (GetParam() == ContextType::kServiceWorker)
flags |= ExtensionBrowserTest::kFlagRunAsServiceWorkerBasedExtension;
......
......@@ -63,9 +63,7 @@ class PermissionsApiTestWithContextType
protected:
bool RunTest(const std::string& extension_name) {
// TODO(https://crbug.com/1146173): Change this to kFlagNone once the bug is
// fixed.
int browser_test_flags = kFlagEnableFileAccess;
int browser_test_flags = kFlagNone;
if (GetParam() == ContextType::kServiceWorker)
browser_test_flags |= kFlagRunAsServiceWorkerBasedExtension;
return RunExtensionTestWithFlags(extension_name, browser_test_flags,
......
......@@ -78,10 +78,7 @@ IN_PROC_BROWSER_TEST_P(ExecuteScriptApiTest, ExecuteScriptBadEncoding) {
// If failing, mark disabled and update http://crbug.com/92105.
IN_PROC_BROWSER_TEST_P(ExecuteScriptApiTest, ExecuteScriptInFrame) {
// TODO(https://crbug.com/1146173): This test is being run with
// file access to prevent flakiness for the SW version. It should
// be reverted to run without file access when this bug is fixed.
ASSERT_TRUE(RunTestWithFileAccess("executescript/in_frame")) << message_;
ASSERT_TRUE(RunTest("executescript/in_frame")) << message_;
}
IN_PROC_BROWSER_TEST_P(ExecuteScriptApiTest, ExecuteScriptByFrameId) {
......@@ -89,10 +86,7 @@ IN_PROC_BROWSER_TEST_P(ExecuteScriptApiTest, ExecuteScriptByFrameId) {
}
IN_PROC_BROWSER_TEST_P(ExecuteScriptApiTest, ExecuteScriptPermissions) {
// TODO(https://crbug.com/1146173): This test is being run with
// file access to prevent flakiness for the SW version. It should
// be reverted to run without file access when this bug is fixed.
ASSERT_TRUE(RunTestWithFileAccess("executescript/permissions")) << message_;
ASSERT_TRUE(RunTest("executescript/permissions")) << message_;
}
// If failing, mark disabled and update http://crbug.com/84760.
......
......@@ -356,13 +356,8 @@ IN_PROC_BROWSER_TEST_F(NativeBindingsApiTest, PromiseBasedAPI) {
});)";
test_dir.WriteFile(FILE_PATH_LITERAL("background.js"), kBackgroundJs);
ResultCatcher catcher;
// TODO(https://crbug.com/1146173): We shouldn't have to use the
// kEnableFileAccess flag here, but without it the extension gets reloaded to
// remove the file access that unpacked extensions are given by default. This
// reload can lead to a flaky failure related to registering service workers.
ASSERT_TRUE(LoadExtensionWithFlags(
test_dir.UnpackedPath(),
kFlagIgnoreManifestWarnings | kFlagEnableFileAccess));
ASSERT_TRUE(LoadExtensionWithFlags(test_dir.UnpackedPath(),
kFlagIgnoreManifestWarnings));
ASSERT_TRUE(catcher.GetNextResult()) << catcher.message();
}
......
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