OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/app_list/arc/arc_app_dialog.h" | 5 #include "chrome/browser/ui/app_list/arc/arc_app_dialog.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/browser/chromeos/arc/arc_auth_notification.h" | 9 #include "chrome/browser/chromeos/arc/arc_auth_notification.h" |
10 #include "chrome/browser/chromeos/arc/arc_session_manager.h" | 10 #include "chrome/browser/chromeos/arc/arc_session_manager.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 namespace arc { | 26 namespace arc { |
27 | 27 |
28 class ArcAppUninstallDialogViewBrowserTest : public InProcessBrowserTest { | 28 class ArcAppUninstallDialogViewBrowserTest : public InProcessBrowserTest { |
29 public: | 29 public: |
30 ArcAppUninstallDialogViewBrowserTest() {} | 30 ArcAppUninstallDialogViewBrowserTest() {} |
31 | 31 |
32 // InProcessBrowserTest: | 32 // InProcessBrowserTest: |
33 ~ArcAppUninstallDialogViewBrowserTest() override {} | 33 ~ArcAppUninstallDialogViewBrowserTest() override {} |
34 | 34 |
35 void SetUpCommandLine(base::CommandLine* command_line) override { | 35 void SetUpCommandLine(base::CommandLine* command_line) override { |
36 InProcessBrowserTest::SetUpCommandLine(command_line); | |
37 arc::SetArcAvailableCommandLineForTesting(command_line); | 36 arc::SetArcAvailableCommandLineForTesting(command_line); |
38 } | 37 } |
39 | 38 |
40 void SetUpInProcessBrowserTestFixture() override { | 39 void SetUpInProcessBrowserTestFixture() override { |
41 InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); | |
42 ArcSessionManager::DisableUIForTesting(); | 40 ArcSessionManager::DisableUIForTesting(); |
43 ArcAuthNotification::DisableForTesting(); | 41 ArcAuthNotification::DisableForTesting(); |
44 } | 42 } |
45 | 43 |
46 void SetUpOnMainThread() override { | 44 void SetUpOnMainThread() override { |
47 profile_ = browser()->profile(); | 45 profile_ = browser()->profile(); |
48 arc_app_list_pref_ = ArcAppListPrefs::Get(profile_); | 46 arc_app_list_pref_ = ArcAppListPrefs::Get(profile_); |
49 if (!arc_app_list_pref_) { | 47 if (!arc_app_list_pref_) { |
50 ArcAppListPrefsFactory::GetInstance()->RecreateServiceInstanceForTesting( | 48 ArcAppListPrefsFactory::GetInstance()->RecreateServiceInstanceForTesting( |
51 profile_); | 49 profile_); |
(...skipping 30 matching lines...) Expand all Loading... |
82 package.package_version = 0; | 80 package.package_version = 0; |
83 package.last_backup_android_id = 0; | 81 package.last_backup_android_id = 0; |
84 package.last_backup_time = 0; | 82 package.last_backup_time = 0; |
85 package.sync = false; | 83 package.sync = false; |
86 app_instance_->SendRefreshPackageList( | 84 app_instance_->SendRefreshPackageList( |
87 std::vector<mojom::ArcPackageInfo>(1, package)); | 85 std::vector<mojom::ArcPackageInfo>(1, package)); |
88 } | 86 } |
89 | 87 |
90 void TearDownOnMainThread() override { | 88 void TearDownOnMainThread() override { |
91 ArcSessionManager::Get()->Shutdown(); | 89 ArcSessionManager::Get()->Shutdown(); |
92 InProcessBrowserTest::TearDownOnMainThread(); | |
93 } | 90 } |
94 | 91 |
95 // Ensures the ArcAppDialogView is destoryed. | 92 // Ensures the ArcAppDialogView is destoryed. |
96 void TearDown() override { ASSERT_FALSE(IsArcAppDialogViewAliveForTest()); } | 93 void TearDown() override { ASSERT_FALSE(IsArcAppDialogViewAliveForTest()); } |
97 | 94 |
98 ArcAppListPrefs* arc_app_list_pref() { return arc_app_list_pref_; } | 95 ArcAppListPrefs* arc_app_list_pref() { return arc_app_list_pref_; } |
99 | 96 |
100 FakeAppInstance* instance() { return app_instance_.get(); } | 97 FakeAppInstance* instance() { return app_instance_.get(); } |
101 | 98 |
102 private: | 99 private: |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 content::RunAllPendingInMessageLoop(); | 168 content::RunAllPendingInMessageLoop(); |
172 | 169 |
173 EXPECT_TRUE(CloseAppDialogViewAndConfirmForTest(true)); | 170 EXPECT_TRUE(CloseAppDialogViewAndConfirmForTest(true)); |
174 content::RunAllPendingInMessageLoop(); | 171 content::RunAllPendingInMessageLoop(); |
175 app_ids = arc_app_list_pref()->GetAppIds(); | 172 app_ids = arc_app_list_pref()->GetAppIds(); |
176 EXPECT_EQ(app_ids.size(), 1u); | 173 EXPECT_EQ(app_ids.size(), 1u); |
177 controller->DismissView(); | 174 controller->DismissView(); |
178 } | 175 } |
179 | 176 |
180 } // namespace arc | 177 } // namespace arc |
OLD | NEW |