Index: chrome/browser/ui/app_list/app_list_service_views_browsertest.cc |
diff --git a/chrome/browser/ui/app_list/app_list_service_views_browsertest.cc b/chrome/browser/ui/app_list/app_list_service_views_browsertest.cc |
index 6c150812077dc1557be0cf40b14918d22d8d2ffe..0b2fa59859e4937747f29bfd3536bc7a9cf97661 100644 |
--- a/chrome/browser/ui/app_list/app_list_service_views_browsertest.cc |
+++ b/chrome/browser/ui/app_list/app_list_service_views_browsertest.cc |
@@ -29,6 +29,7 @@ |
#include "ash/shell.h" |
#include "chrome/browser/chromeos/arc/arc_auth_service.h" |
#include "chrome/browser/ui/ash/app_list/test/app_list_service_ash_test_api.h" |
+#include "chromeos/chromeos_switches.h" |
#endif |
namespace { |
@@ -132,18 +133,34 @@ IN_PROC_BROWSER_TEST_F(AppListServiceViewsBrowserTest, MAYBE_AcceleratorClose) { |
} |
// Tests for opening the app info dialog from the app list. |
-class AppListControllerAppInfoDialogBrowserTest : public ExtensionBrowserTest { |
+class AppListControllerAppInfoDialogBrowserTest : |
+ public ExtensionBrowserTest, |
+ public testing::WithParamInterface<bool> { |
public: |
AppListControllerAppInfoDialogBrowserTest() {} |
~AppListControllerAppInfoDialogBrowserTest() override {} |
protected: |
// content::BrowserTestBase: |
- void SetUpOnMainThread() override { |
+ void SetUpCommandLine(base::CommandLine* command_line) override { |
+ ExtensionBrowserTest::SetUpCommandLine(command_line); |
+#if defined(OS_CHROMEOS) |
+ if (GetParam()) |
+ command_line->AppendSwitch(chromeos::switches::kEnableArc); |
+#endif |
+ } |
+ |
+ void SetUpInProcessBrowserTestFixture() override { |
+ ExtensionBrowserTest::SetUpInProcessBrowserTestFixture(); |
#if defined(OS_CHROMEOS) |
arc::ArcAuthService::DisableUIForTesting(); |
- arc::ArcAuthService::Get()->OnPrimaryUserProfilePrepared( |
- browser()->profile()); |
+#endif |
+ } |
+ |
+ void SetUpOnMainThread() override { |
+#if defined(OS_CHROMEOS) |
+ if (GetParam()) |
+ arc::ArcAuthService::Get()->EnableArc(); |
#endif |
// Install a test extension. |
base::FilePath test_extension_path; |
@@ -165,11 +182,16 @@ class AppListControllerAppInfoDialogBrowserTest : public ExtensionBrowserTest { |
EXPECT_TRUE(native_view_); |
} |
+ // Opens app info for default test extension. |
void OpenAppInfoDialog() { |
+ OpenAppInfoDialog(extension_->id()); |
+ } |
+ |
+ void OpenAppInfoDialog(const std::string& app_id) { |
AppListControllerDelegate* controller = service_->GetControllerDelegate(); |
EXPECT_TRUE(controller); |
EXPECT_TRUE(controller->GetAppListWindow()); |
- controller->DoShowAppInfoFlow(browser()->profile(), extension_->id()); |
+ controller->DoShowAppInfoFlow(browser()->profile(), app_id); |
} |
AppListService* service_; |
@@ -183,7 +205,7 @@ class AppListControllerAppInfoDialogBrowserTest : public ExtensionBrowserTest { |
// Test the DoShowAppInfoFlow function of the controller delegate. |
// flaky: http://crbug.com/378251 |
-IN_PROC_BROWSER_TEST_F(AppListControllerAppInfoDialogBrowserTest, |
+IN_PROC_BROWSER_TEST_P(AppListControllerAppInfoDialogBrowserTest, |
DISABLED_DoShowAppInfoFlow) { |
test::AppListViewTestApi test_api(app_list_view_); |
@@ -211,7 +233,7 @@ IN_PROC_BROWSER_TEST_F(AppListControllerAppInfoDialogBrowserTest, |
// Check that the app list can be closed with the app info dialog |
// open without crashing. This is a regression test for http://crbug.com/443066. |
-IN_PROC_BROWSER_TEST_F(AppListControllerAppInfoDialogBrowserTest, |
+IN_PROC_BROWSER_TEST_P(AppListControllerAppInfoDialogBrowserTest, |
CanCloseAppListWithAppInfoOpen) { |
OpenAppInfoDialog(); |
@@ -220,6 +242,22 @@ IN_PROC_BROWSER_TEST_F(AppListControllerAppInfoDialogBrowserTest, |
EXPECT_FALSE(GetAppListView(service_)); |
} |
+// Check that the app info can be safely opened for Chrome. |
+IN_PROC_BROWSER_TEST_P(AppListControllerAppInfoDialogBrowserTest, |
+ OpenAppInfoForChrome) { |
+ OpenAppInfoDialog(extension_misc::kChromeAppId); |
+} |
+ |
+#if defined(OS_CHROMEOS) |
+INSTANTIATE_TEST_CASE_P(AppListControllerAppInfoDialogBrowserTestInstance, |
+ AppListControllerAppInfoDialogBrowserTest, |
+ testing::Bool()); |
+#else |
+INSTANTIATE_TEST_CASE_P(AppListControllerAppInfoDialogBrowserTestInstance, |
+ AppListControllerAppInfoDialogBrowserTest, |
+ testing::Values(false)); |
+#endif |
+ |
using AppListServiceViewsExtensionBrowserTest = ExtensionBrowserTest; |
IN_PROC_BROWSER_TEST_F(AppListServiceViewsExtensionBrowserTest, |