Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(703)

Unified Diff: chrome/browser/ui/views/arc_app_dialog_view_browsertest.cc

Issue 2648213004: Migrate --enable-arc and --arc-available part 1. (Closed)
Patch Set: address comments. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/arc_app_dialog_view_browsertest.cc
diff --git a/chrome/browser/ui/views/arc_app_dialog_view_browsertest.cc b/chrome/browser/ui/views/arc_app_dialog_view_browsertest.cc
index a3816d76afa6155ced9a858760628d0b67432499..977853e8230449520c4aa00b54fd401468d30c70 100644
--- a/chrome/browser/ui/views/arc_app_dialog_view_browsertest.cc
+++ b/chrome/browser/ui/views/arc_app_dialog_view_browsertest.cc
@@ -16,7 +16,7 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/test/base/in_process_browser_test.h"
-#include "chromeos/chromeos_switches.h"
+#include "components/arc/arc_util.h"
#include "components/arc/common/app.mojom.h"
#include "components/arc/test/fake_app_instance.h"
#include "content/public/test/test_utils.h"
@@ -30,12 +30,19 @@ class ArcAppUninstallDialogViewBrowserTest : public InProcessBrowserTest {
// InProcessBrowserTest:
~ArcAppUninstallDialogViewBrowserTest() override {}
- void SetUpAppInstance() {
- profile_ = browser()->profile();
+ void SetUpCommandLine(base::CommandLine* command_line) override {
+ InProcessBrowserTest::SetUpCommandLine(command_line);
+ arc::SetArcAvailableCommandLineForTesting(command_line);
+ }
- base::CommandLine::ForCurrentProcess()->AppendSwitch(
- chromeos::switches::kEnableArc);
+ void SetUpInProcessBrowserTestFixture() override {
+ InProcessBrowserTest::SetUpInProcessBrowserTestFixture();
+ ArcSessionManager::DisableUIForTesting();
+ }
+ void SetUpOnMainThread() override {
+ InProcessBrowserTest::SetUpOnMainThread();
+ profile_ = browser()->profile();
arc_app_list_pref_ = ArcAppListPrefs::Get(profile_);
if (!arc_app_list_pref_) {
ArcAppListPrefsFactory::GetInstance()->RecreateServiceInstanceForTesting(
@@ -44,8 +51,6 @@ class ArcAppUninstallDialogViewBrowserTest : public InProcessBrowserTest {
ArcSessionManager* session_manager = ArcSessionManager::Get();
DCHECK(session_manager);
- ArcSessionManager::DisableUIForTesting();
- session_manager->OnPrimaryUserProfilePrepared(profile_);
session_manager->EnableArc();
arc_app_list_pref_ = ArcAppListPrefs::Get(profile_);
@@ -109,8 +114,6 @@ class ArcAppUninstallDialogViewBrowserTest : public InProcessBrowserTest {
// share same package.
IN_PROC_BROWSER_TEST_F(ArcAppUninstallDialogViewBrowserTest,
UserConfirmsUninstall) {
- SetUpAppInstance();
-
std::vector<std::string> app_ids = arc_app_list_pref()->GetAppIds();
EXPECT_EQ(app_ids.size(), 2u);
std::string package_name = base::StringPrintf("fake.package.%d", 0);
@@ -145,8 +148,6 @@ IN_PROC_BROWSER_TEST_F(ArcAppUninstallDialogViewBrowserTest,
// uninstalled when the shortcut is removed.
IN_PROC_BROWSER_TEST_F(ArcAppUninstallDialogViewBrowserTest,
UserConfirmsUninstallShortcut) {
- SetUpAppInstance();
-
std::vector<std::string> app_ids = arc_app_list_pref()->GetAppIds();
EXPECT_EQ(app_ids.size(), 2u);
std::string package_name = base::StringPrintf("fake.package.%d", 0);

Powered by Google App Engine
This is Rietveld 408576698