| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "ash/common/wallpaper/wallpaper_controller.h" | 8 #include "ash/common/wallpaper/wallpaper_controller.h" |
| 9 #include "ash/common/wallpaper/wallpaper_controller_observer.h" | 9 #include "ash/common/wallpaper/wallpaper_controller_observer.h" |
| 10 #include "ash/common/wm_shell.h" | 10 #include "ash/common/wm_shell.h" |
| (...skipping 2263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2274 // Terminate the app. | 2274 // Terminate the app. |
| 2275 window->GetBaseWindow()->Close(); | 2275 window->GetBaseWindow()->Close(); |
| 2276 content::RunAllPendingInMessageLoop(); | 2276 content::RunAllPendingInMessageLoop(); |
| 2277 } | 2277 } |
| 2278 | 2278 |
| 2279 IN_PROC_BROWSER_TEST_F(KioskEnterpriseTest, PrivateStore) { | 2279 IN_PROC_BROWSER_TEST_F(KioskEnterpriseTest, PrivateStore) { |
| 2280 set_test_app_id(kTestEnterpriseKioskApp); | 2280 set_test_app_id(kTestEnterpriseKioskApp); |
| 2281 | 2281 |
| 2282 const char kPrivateStoreUpdate[] = "/private_store_update"; | 2282 const char kPrivateStoreUpdate[] = "/private_store_update"; |
| 2283 net::EmbeddedTestServer private_server; | 2283 net::EmbeddedTestServer private_server; |
| 2284 ASSERT_TRUE(private_server.Start()); | |
| 2285 | 2284 |
| 2286 // |private_server| serves crx from test data dir. | 2285 // |private_server| serves crx from test data dir. |
| 2287 base::FilePath test_data_dir; | 2286 base::FilePath test_data_dir; |
| 2288 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); | 2287 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); |
| 2289 private_server.ServeFilesFromDirectory(test_data_dir); | 2288 private_server.ServeFilesFromDirectory(test_data_dir); |
| 2289 ASSERT_TRUE(private_server.InitializeAndListen()); |
| 2290 | 2290 |
| 2291 FakeCWS private_store; | 2291 FakeCWS private_store; |
| 2292 private_store.InitAsPrivateStore(&private_server, kPrivateStoreUpdate); | 2292 private_store.InitAsPrivateStore(&private_server, kPrivateStoreUpdate); |
| 2293 private_store.SetUpdateCrx(kTestEnterpriseKioskApp, | 2293 private_store.SetUpdateCrx(kTestEnterpriseKioskApp, |
| 2294 std::string(kTestEnterpriseKioskApp) + ".crx", | 2294 std::string(kTestEnterpriseKioskApp) + ".crx", |
| 2295 "1.0.0"); | 2295 "1.0.0"); |
| 2296 | 2296 |
| 2297 private_server.StartAcceptingConnections(); |
| 2298 |
| 2297 // Configure kTestEnterpriseKioskApp in device policy. | 2299 // Configure kTestEnterpriseKioskApp in device policy. |
| 2298 ConfigureKioskAppInPolicy(kTestEnterpriseAccountId, | 2300 ConfigureKioskAppInPolicy(kTestEnterpriseAccountId, |
| 2299 kTestEnterpriseKioskApp, | 2301 kTestEnterpriseKioskApp, |
| 2300 private_server.GetURL(kPrivateStoreUpdate).spec()); | 2302 private_server.GetURL(kPrivateStoreUpdate).spec()); |
| 2301 | 2303 |
| 2302 // Meta should be able to be extracted from crx before launching. | 2304 // Meta should be able to be extracted from crx before launching. |
| 2303 KioskAppManager* manager = KioskAppManager::Get(); | 2305 KioskAppManager* manager = KioskAppManager::Get(); |
| 2304 AppDataLoadWaiter waiter(manager, kTestEnterpriseKioskApp, std::string()); | 2306 AppDataLoadWaiter waiter(manager, kTestEnterpriseKioskApp, std::string()); |
| 2305 waiter.WaitForAppData(); | 2307 waiter.WaitForAppData(); |
| 2306 | 2308 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2388 content::WindowedNotificationObserver( | 2390 content::WindowedNotificationObserver( |
| 2389 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 2391 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
| 2390 content::NotificationService::AllSources()).Wait(); | 2392 content::NotificationService::AllSources()).Wait(); |
| 2391 | 2393 |
| 2392 // Wait for the wallpaper to load. | 2394 // Wait for the wallpaper to load. |
| 2393 WaitForWallpaper(); | 2395 WaitForWallpaper(); |
| 2394 EXPECT_TRUE(wallpaper_loaded()); | 2396 EXPECT_TRUE(wallpaper_loaded()); |
| 2395 } | 2397 } |
| 2396 | 2398 |
| 2397 } // namespace chromeos | 2399 } // namespace chromeos |
| OLD | NEW |