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 "ash/desktop_background/desktop_background_controller.h" | 5 #include "ash/desktop_background/desktop_background_controller.h" |
6 #include "ash/desktop_background/desktop_background_controller_observer.h" | 6 #include "ash/desktop_background/desktop_background_controller_observer.h" |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 #include "components/signin/core/common/signin_pref_names.h" | 50 #include "components/signin/core/common/signin_pref_names.h" |
51 #include "content/public/browser/browser_thread.h" | 51 #include "content/public/browser/browser_thread.h" |
52 #include "content/public/browser/notification_observer.h" | 52 #include "content/public/browser/notification_observer.h" |
53 #include "content/public/browser/notification_registrar.h" | 53 #include "content/public/browser/notification_registrar.h" |
54 #include "content/public/browser/notification_service.h" | 54 #include "content/public/browser/notification_service.h" |
55 #include "content/public/test/browser_test_utils.h" | 55 #include "content/public/test/browser_test_utils.h" |
56 #include "extensions/browser/app_window/app_window.h" | 56 #include "extensions/browser/app_window/app_window.h" |
57 #include "extensions/browser/app_window/app_window_registry.h" | 57 #include "extensions/browser/app_window/app_window_registry.h" |
58 #include "extensions/browser/app_window/native_app_window.h" | 58 #include "extensions/browser/app_window/native_app_window.h" |
59 #include "extensions/browser/extension_system.h" | 59 #include "extensions/browser/extension_system.h" |
| 60 #include "extensions/test/result_catcher.h" |
60 #include "google_apis/gaia/gaia_constants.h" | 61 #include "google_apis/gaia/gaia_constants.h" |
61 #include "google_apis/gaia/gaia_switches.h" | 62 #include "google_apis/gaia/gaia_switches.h" |
62 #include "google_apis/gaia/gaia_urls.h" | 63 #include "google_apis/gaia/gaia_urls.h" |
63 #include "net/test/embedded_test_server/embedded_test_server.h" | 64 #include "net/test/embedded_test_server/embedded_test_server.h" |
64 | 65 |
65 namespace em = enterprise_management; | 66 namespace em = enterprise_management; |
66 | 67 |
67 namespace chromeos { | 68 namespace chromeos { |
68 | 69 |
69 namespace { | 70 namespace { |
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1449 | 1450 |
1450 EXPECT_EQ("2.0.0", GetInstalledAppVersion().GetString()); | 1451 EXPECT_EQ("2.0.0", GetInstalledAppVersion().GetString()); |
1451 } | 1452 } |
1452 | 1453 |
1453 IN_PROC_BROWSER_TEST_F(KioskUpdateTest, PRE_PreserveLocalData) { | 1454 IN_PROC_BROWSER_TEST_F(KioskUpdateTest, PRE_PreserveLocalData) { |
1454 // Installs v1 app and writes some local data. | 1455 // Installs v1 app and writes some local data. |
1455 set_test_app_id(kTestLocalFsKioskApp); | 1456 set_test_app_id(kTestLocalFsKioskApp); |
1456 set_test_app_version("1.0.0"); | 1457 set_test_app_version("1.0.0"); |
1457 set_test_crx_file(test_app_id() + ".crx"); | 1458 set_test_crx_file(test_app_id() + ".crx"); |
1458 | 1459 |
1459 ResultCatcher catcher; | 1460 extensions::ResultCatcher catcher; |
1460 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); | 1461 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); |
1461 WaitForAppLaunchSuccess(); | 1462 WaitForAppLaunchSuccess(); |
1462 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 1463 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
1463 } | 1464 } |
1464 | 1465 |
1465 IN_PROC_BROWSER_TEST_F(KioskUpdateTest, PreserveLocalData) { | 1466 IN_PROC_BROWSER_TEST_F(KioskUpdateTest, PreserveLocalData) { |
1466 // Update existing v1 app installed in PRE_PreserveLocalData to v2 | 1467 // Update existing v1 app installed in PRE_PreserveLocalData to v2 |
1467 // that reads and verifies the local data. | 1468 // that reads and verifies the local data. |
1468 set_test_app_id(kTestLocalFsKioskApp); | 1469 set_test_app_id(kTestLocalFsKioskApp); |
1469 set_test_app_version("2.0.0"); | 1470 set_test_app_version("2.0.0"); |
1470 set_test_crx_file(test_app_id() + "_v2_read_and_verify_data.crx"); | 1471 set_test_crx_file(test_app_id() + "_v2_read_and_verify_data.crx"); |
1471 ResultCatcher catcher; | 1472 extensions::ResultCatcher catcher; |
1472 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); | 1473 StartAppLaunchFromLoginScreen(SimulateNetworkOnlineClosure()); |
1473 WaitForAppLaunchSuccess(); | 1474 WaitForAppLaunchSuccess(); |
1474 | 1475 |
1475 EXPECT_EQ("2.0.0", GetInstalledAppVersion().GetString()); | 1476 EXPECT_EQ("2.0.0", GetInstalledAppVersion().GetString()); |
1476 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 1477 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
1477 } | 1478 } |
1478 | 1479 |
1479 class KioskEnterpriseTest : public KioskTest { | 1480 class KioskEnterpriseTest : public KioskTest { |
1480 protected: | 1481 protected: |
1481 KioskEnterpriseTest() {} | 1482 KioskEnterpriseTest() {} |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1695 content::WindowedNotificationObserver( | 1696 content::WindowedNotificationObserver( |
1696 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 1697 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
1697 content::NotificationService::AllSources()).Wait(); | 1698 content::NotificationService::AllSources()).Wait(); |
1698 | 1699 |
1699 // Wait for the wallpaper to load. | 1700 // Wait for the wallpaper to load. |
1700 WaitForWallpaper(); | 1701 WaitForWallpaper(); |
1701 EXPECT_TRUE(wallpaper_loaded()); | 1702 EXPECT_TRUE(wallpaper_loaded()); |
1702 } | 1703 } |
1703 | 1704 |
1704 } // namespace chromeos | 1705 } // namespace chromeos |
OLD | NEW |