| 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 | 7 |
| 8 #include "apps/test/app_window_waiter.h" |
| 8 #include "base/base64.h" | 9 #include "base/base64.h" |
| 9 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 10 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
| 11 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 12 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 13 #include "chrome/browser/chromeos/app_mode/fake_cws.h" | 14 #include "chrome/browser/chromeos/app_mode/fake_cws.h" |
| 14 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 15 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 15 #include "chrome/browser/chromeos/login/test/app_window_waiter.h" | |
| 16 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h" | 16 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h" |
| 17 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_fact
ory.h" | 17 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_fact
ory.h" |
| 18 #include "chrome/browser/chromeos/policy/device_local_account.h" | 18 #include "chrome/browser/chromeos/policy/device_local_account.h" |
| 19 #include "chrome/browser/chromeos/policy/device_policy_builder.h" | 19 #include "chrome/browser/chromeos/policy/device_policy_builder.h" |
| 20 #include "chrome/browser/extensions/browsertest_util.h" | 20 #include "chrome/browser/extensions/browsertest_util.h" |
| 21 #include "chrome/browser/profiles/profile_manager.h" | 21 #include "chrome/browser/profiles/profile_manager.h" |
| 22 #include "chrome/common/chrome_constants.h" | 22 #include "chrome/common/chrome_constants.h" |
| 23 #include "chrome/common/chrome_paths.h" | 23 #include "chrome/common/chrome_paths.h" |
| 24 #include "chrome/common/pref_names.h" | 24 #include "chrome/common/pref_names.h" |
| 25 #include "chrome/test/base/in_process_browser_test.h" | 25 #include "chrome/test/base/in_process_browser_test.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 172 |
| 173 IN_PROC_BROWSER_TEST_F(KioskCrashRestoreTest, Basic) { | 173 IN_PROC_BROWSER_TEST_F(KioskCrashRestoreTest, Basic) { |
| 174 ExtensionTestMessageListener launch_data_check_listener( | 174 ExtensionTestMessageListener launch_data_check_listener( |
| 175 "launchData.isKioskSession = true", false); | 175 "launchData.isKioskSession = true", false); |
| 176 | 176 |
| 177 Profile* const app_profile = ProfileManager::GetPrimaryUserProfile(); | 177 Profile* const app_profile = ProfileManager::GetPrimaryUserProfile(); |
| 178 ASSERT_TRUE(app_profile); | 178 ASSERT_TRUE(app_profile); |
| 179 extensions::AppWindowRegistry* const app_window_registry = | 179 extensions::AppWindowRegistry* const app_window_registry = |
| 180 extensions::AppWindowRegistry::Get(app_profile); | 180 extensions::AppWindowRegistry::Get(app_profile); |
| 181 extensions::AppWindow* const window = | 181 extensions::AppWindow* const window = |
| 182 AppWindowWaiter(app_window_registry, test_app_id()).Wait(); | 182 apps::AppWindowWaiter(app_window_registry, test_app_id()).Wait(); |
| 183 ASSERT_TRUE(window); | 183 ASSERT_TRUE(window); |
| 184 | 184 |
| 185 window->GetBaseWindow()->Close(); | 185 window->GetBaseWindow()->Close(); |
| 186 | 186 |
| 187 // Wait until the app terminates if it is still running. | 187 // Wait until the app terminates if it is still running. |
| 188 if (!app_window_registry->GetAppWindowsForApp(test_app_id()).empty()) | 188 if (!app_window_registry->GetAppWindowsForApp(test_app_id()).empty()) |
| 189 base::RunLoop().Run(); | 189 base::RunLoop().Run(); |
| 190 | 190 |
| 191 EXPECT_TRUE(launch_data_check_listener.was_satisfied()); | 191 EXPECT_TRUE(launch_data_check_listener.was_satisfied()); |
| 192 } | 192 } |
| 193 | 193 |
| 194 } // namespace chromeos | 194 } // namespace chromeos |
| OLD | NEW |