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 <memory> | 5 #include <memory> |
6 #include <string> | 6 #include <string> |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_manager.h" | 14 #include "chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_manager.h" |
15 #include "chrome/browser/chromeos/ownership/fake_owner_settings_service.h" | 15 #include "chrome/browser/chromeos/ownership/fake_owner_settings_service.h" |
16 #include "chrome/browser/chromeos/policy/device_local_account.h" | 16 #include "chrome/browser/chromeos/policy/device_local_account.h" |
17 #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h" | 17 #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h" |
18 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
19 #include "chrome/test/base/in_process_browser_test.h" | 19 #include "chrome/test/base/in_process_browser_test.h" |
20 #include "chromeos/chromeos_switches.h" | |
21 #include "chromeos/settings/cros_settings_names.h" | 20 #include "chromeos/settings/cros_settings_names.h" |
| 21 #include "components/arc/arc_util.h" |
22 #include "components/prefs/scoped_user_pref_update.h" | 22 #include "components/prefs/scoped_user_pref_update.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
24 | 24 |
25 namespace chromeos { | 25 namespace chromeos { |
26 | 26 |
27 namespace { | 27 namespace { |
28 | 28 |
29 // The purpose of this waiter - wait for being notified some amount of times. | 29 // The purpose of this waiter - wait for being notified some amount of times. |
30 class NotificationWaiter | 30 class NotificationWaiter |
31 : public ArcKioskAppManager::ArcKioskAppManagerObserver { | 31 : public ArcKioskAppManager::ArcKioskAppManagerObserver { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 } // namespace | 77 } // namespace |
78 | 78 |
79 class ArcKioskAppManagerTest : public InProcessBrowserTest { | 79 class ArcKioskAppManagerTest : public InProcessBrowserTest { |
80 public: | 80 public: |
81 ArcKioskAppManagerTest() : settings_helper_(false) {} | 81 ArcKioskAppManagerTest() : settings_helper_(false) {} |
82 ~ArcKioskAppManagerTest() override {} | 82 ~ArcKioskAppManagerTest() override {} |
83 | 83 |
84 void SetUpCommandLine(base::CommandLine* command_line) override { | 84 void SetUpCommandLine(base::CommandLine* command_line) override { |
85 InProcessBrowserTest::SetUpCommandLine(command_line); | 85 InProcessBrowserTest::SetUpCommandLine(command_line); |
86 command_line->AppendSwitch(chromeos::switches::kEnableArc); | 86 arc::SetArcAvailableCommandLineForTesting(command_line); |
87 } | 87 } |
88 | 88 |
89 void SetUpOnMainThread() override { | 89 void SetUpOnMainThread() override { |
90 InProcessBrowserTest::SetUpOnMainThread(); | 90 InProcessBrowserTest::SetUpOnMainThread(); |
91 | 91 |
92 settings_helper_.ReplaceProvider(kAccountsPrefDeviceLocalAccounts); | 92 settings_helper_.ReplaceProvider(kAccountsPrefDeviceLocalAccounts); |
93 owner_settings_service_ = | 93 owner_settings_service_ = |
94 settings_helper_.CreateOwnerSettingsService(browser()->profile()); | 94 settings_helper_.CreateOwnerSettingsService(browser()->profile()); |
95 } | 95 } |
96 | 96 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 CleanApps(); | 209 CleanApps(); |
210 waiter.Wait(); | 210 waiter.Wait(); |
211 EXPECT_TRUE(waiter.was_notified()); | 211 EXPECT_TRUE(waiter.was_notified()); |
212 | 212 |
213 ASSERT_EQ(0u, manager()->GetAllApps().size()); | 213 ASSERT_EQ(0u, manager()->GetAllApps().size()); |
214 EXPECT_FALSE(manager()->GetAutoLaunchAccountId().is_valid()); | 214 EXPECT_FALSE(manager()->GetAutoLaunchAccountId().is_valid()); |
215 } | 215 } |
216 } | 216 } |
217 | 217 |
218 } // namespace chromeos | 218 } // namespace chromeos |
OLD | NEW |