Commit 780bea5b authored by Eric Willigers's avatar Eric Willigers Committed by Commit Bot

Desktop PWAs: AppSearchProvider test cleanup

As DesktopPWAsWithoutExtensions are enabled and shipped, we no longer
need to mention the flag in tests.




Bug: 1065748
Change-Id: I643757798cbe6ee1972a26d39e9df8f9dc7ef903
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2454353
Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
Reviewed-by: default avatarNancy Wang <nancylingwang@chromium.org>
Auto-Submit: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#815426}
parent 5969ceef
......@@ -36,9 +36,7 @@
#include "chrome/browser/ui/app_list/test/test_app_list_controller_delegate.h"
#include "chrome/browser/web_applications/components/web_app_provider_base.h"
#include "chrome/browser/web_applications/test/web_app_install_test_utils.h"
#include "chrome/browser/web_applications/test/web_app_test.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_features.h"
#include "chrome/test/base/testing_profile.h"
#include "components/arc/test/fake_app_instance.h"
#include "components/crx_file/id_util.h"
......@@ -61,8 +59,6 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
using web_app::ProviderType;
namespace app_list {
namespace test {
......@@ -711,20 +707,7 @@ TEST_F(AppSearchProviderTest, FetchInternalApp) {
EXPECT_EQ(kKeyboardShortcutHelperInternalName, RunQuery("Helper"));
}
class AppSearchProviderWebAppTest : public AppSearchProviderTest {
public:
AppSearchProviderWebAppTest() {
scoped_feature_list_.InitAndEnableFeature(
features::kDesktopPWAsWithoutExtensions);
}
~AppSearchProviderWebAppTest() override = default;
private:
base::test::ScopedFeatureList scoped_feature_list_;
};
TEST_F(AppSearchProviderWebAppTest, WebApp) {
TEST_F(AppSearchProviderTest, WebApp) {
apps::AppServiceProxy* proxy =
apps::AppServiceProxyFactory::GetForProfile(testing_profile());
proxy->FlushMojoCallsForTesting();
......@@ -739,27 +722,9 @@ TEST_F(AppSearchProviderWebAppTest, WebApp) {
EXPECT_EQ("WebApp1", RunQuery("WebA"));
}
class AppSearchProviderCrostiniTest
: public AppSearchProviderTest,
public ::testing::WithParamInterface<ProviderType> {
protected:
AppSearchProviderCrostiniTest() {
if (GetParam() == ProviderType::kWebApps) {
scoped_feature_list_.InitAndEnableFeature(
features::kDesktopPWAsWithoutExtensions);
} else if (GetParam() == ProviderType::kBookmarkApps) {
scoped_feature_list_.InitAndDisableFeature(
features::kDesktopPWAsWithoutExtensions);
}
}
using AppSearchProviderCrostiniTest = AppSearchProviderTest;
~AppSearchProviderCrostiniTest() override = default;
private:
base::test::ScopedFeatureList scoped_feature_list_;
};
TEST_P(AppSearchProviderCrostiniTest, CrostiniTerminal) {
TEST_F(AppSearchProviderCrostiniTest, CrostiniTerminal) {
CreateSearch();
// Crostini UI is not allowed yet.
......@@ -792,7 +757,7 @@ TEST_P(AppSearchProviderCrostiniTest, CrostiniTerminal) {
EXPECT_EQ("Terminal", RunQuery("cros"));
}
TEST_P(AppSearchProviderCrostiniTest, CrostiniApp) {
TEST_F(AppSearchProviderCrostiniTest, CrostiniApp) {
// This both allows Crostini UI and enables Crostini.
crostini::CrostiniTestHelper crostini_test_helper(testing_profile());
crostini_test_helper.ReInitializeAppServiceIntegration();
......@@ -1106,11 +1071,5 @@ INSTANTIATE_TEST_SUITE_P(
::testing::ValuesIn({TestArcAppInstallType::CONTROLLED_BY_POLICY,
TestArcAppInstallType::INSTALLED_BY_DEFAULT}));
INSTANTIATE_TEST_SUITE_P(All,
AppSearchProviderCrostiniTest,
::testing::Values(ProviderType::kBookmarkApps,
ProviderType::kWebApps),
web_app::ProviderTypeParamToString);
} // namespace test
} // namespace app_list
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