Chromium Code Reviews| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "ash/desktop_background/desktop_background_controller.h" | 7 #include "ash/desktop_background/desktop_background_controller.h" |
| 8 #include "ash/desktop_background/desktop_background_controller_observer.h" | 8 #include "ash/desktop_background/desktop_background_controller_observer.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 // An app to test local fs data persistence across app update. V1 app writes | 110 // An app to test local fs data persistence across app update. V1 app writes |
| 111 // data into local fs. V2 app reads and verifies the data. | 111 // data into local fs. V2 app reads and verifies the data. |
| 112 // Webstore data json is in | 112 // Webstore data json is in |
| 113 // chrome/test/data/chromeos/app_mode/webstore/inlineinstall/ | 113 // chrome/test/data/chromeos/app_mode/webstore/inlineinstall/ |
| 114 // detail/bmbpicmpniaclbbpdkfglgipkkebnbjf | 114 // detail/bmbpicmpniaclbbpdkfglgipkkebnbjf |
| 115 const char kTestLocalFsKioskApp[] = "bmbpicmpniaclbbpdkfglgipkkebnbjf"; | 115 const char kTestLocalFsKioskApp[] = "bmbpicmpniaclbbpdkfglgipkkebnbjf"; |
| 116 | 116 |
| 117 // An app to test local access to file systems via the | 117 // An app to test local access to file systems via the |
| 118 // chrome.fileSystem.requestFileSystem API. | 118 // chrome.fileSystem.requestFileSystem API. |
| 119 // Webstore data json is in | 119 // Webstore data json is in |
| 120 // chrome/test/data/chromeos/app_mode/webstore/inlineinstall/ | 120 // chrome/test/data/chromeos/app_mode/webstore/inlineinstall/ |
| 121 // detail/aaedpojejpghjkedenggihopfhfijcko | 121 // detail/aaedpojejpghjkedenggihopfhfijcko |
| 122 const char kTestGetVolumeListKioskApp[] = "aaedpojejpghjkedenggihopfhfijcko"; | 122 const char kTestGetVolumeListKioskApp[] = "aaedpojejpghjkedenggihopfhfijcko"; |
| 123 | 123 |
| 124 // Testing apps for testing kiosk multi-app feature. | 124 // Testing apps for testing kiosk multi-app feature. All the crx files are in |
| 125 const char kTestPrimaryKioskApp[] = "ceobkcclegcliomogfoeoheahogoecgl"; | 125 // chrome/test/data/chromeos/app_mode/webstore/downloads. |
| 126 const char kTestSecondaryApp1[] = "ihplaomghjbeafnpnjkhppmfpnmdihgd"; | 126 |
| 127 const char kTestSecondaryApp2[] = "fiehokkcgaojmbhfhlpiheggjhaedjoc"; | 127 // Source files are in |
| 128 const char kTestSecondaryApp3[] = "aabnpdpieclcikafhdkkpldcaodmfoai"; | 128 // chrome/test/data/chromeos/app_mode/multi_app_kiosk/src/primary_app |
| 129 const char kTestSecondaryExtension[] = "imlgadjgphbjkaceoiapiephhgeofhic"; | 129 const char kTestPrimaryKioskApp[] = "dpejijbnadgcgmabkmcoajkgongfgnii"; |
| 130 | |
| 131 // Source files are in | |
| 132 // chrome/test/data/chromeos/app_mode/multi_app_kiosk/src/secondary_app_1 | |
| 133 const char kTestSecondaryApp1[] = "emnbflhfbllbehnpjmjddklbkeeoaaeg"; | |
| 134 | |
| 135 // Source files are in | |
| 136 // chrome/test/data/chromeos/app_mode/multi_app_kiosk/src/secondary_app_2 | |
| 137 const char kTestSecondaryApp2[] = "blmjgfbajihimkjmepbhgmjbopjchlda"; | |
| 138 | |
| 139 // Source files are in | |
| 140 // chrome/test/data/chromeos/app_mode/multi_app_kiosk/src/secondary_app_3 | |
| 141 const char kTestSecondaryApp3[] = "jkofhenkpndpdflehcjpcekgecjkpggg"; | |
| 142 | |
| 143 // Source files are in | |
| 144 // chrome/test/data/chromeos/app_mode/multi_app_kiosk/src/ | |
| 145 // secondary_extensions_1 | |
| 146 const char kTestSecondaryExtension[] = "gdmgkkoghcihimdfoabkefdkccllcfea"; | |
| 147 | |
| 148 // Source files are in | |
| 149 // chrome/test/data/chromeos/app_mode/multi_app_kiosk/src/ | |
| 150 // shared_module_primary_app | |
| 130 const char kTestSharedModulePrimaryApp[] = "ofmeihgcmabfalhhgooajcijiaoekhkg"; | 151 const char kTestSharedModulePrimaryApp[] = "ofmeihgcmabfalhhgooajcijiaoekhkg"; |
| 152 | |
| 153 // Source files are in | |
| 154 // chrome/test/data/chromeos/app_mode/multi_app_kiosk/src/secondary_app | |
| 131 const char kTestSecondaryApp[] = "bbmaiojbgkkmfaglfhaplfomobgojhke"; | 155 const char kTestSecondaryApp[] = "bbmaiojbgkkmfaglfhaplfomobgojhke"; |
| 156 | |
| 157 // Source files are in | |
| 158 // chrome/test/data/chromeos/app_mode/multi_app_kiosk/src/shared_module | |
| 132 const char kTestSharedModuleId[] = "biebhpdepndljbnkadldcbjkiedldnmn"; | 159 const char kTestSharedModuleId[] = "biebhpdepndljbnkadldcbjkiedldnmn"; |
| 160 | |
| 161 // Source files are in | |
| 162 // chrome/test/data/chromeos/app_mode/multi_app_kiosk/src/ | |
| 163 // secondary_extension | |
| 133 const char kTestSecondaryExt[] = "kcoobopfcjmbfeppibolpaolbgbmkcjd"; | 164 const char kTestSecondaryExt[] = "kcoobopfcjmbfeppibolpaolbgbmkcjd"; |
| 134 | 165 |
| 135 // Fake usb stick mount path. | 166 // Fake usb stick mount path. |
| 136 const char kFakeUsbMountPathUpdatePass[] = | 167 const char kFakeUsbMountPathUpdatePass[] = |
| 137 "chromeos/app_mode/external_update/update_pass"; | 168 "chromeos/app_mode/external_update/update_pass"; |
| 138 const char kFakeUsbMountPathNoManifest[] = | 169 const char kFakeUsbMountPathNoManifest[] = |
| 139 "chromeos/app_mode/external_update/no_manifest"; | 170 "chromeos/app_mode/external_update/no_manifest"; |
| 140 const char kFakeUsbMountPathBadManifest[] = | 171 const char kFakeUsbMountPathBadManifest[] = |
| 141 "chromeos/app_mode/external_update/bad_manifest"; | 172 "chromeos/app_mode/external_update/bad_manifest"; |
| 142 const char kFakeUsbMountPathLowerAppVersion[] = | 173 const char kFakeUsbMountPathLowerAppVersion[] = |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 196 void OnNetworkWaitTimedOut(const base::Closure& runner_quit_task) { | 227 void OnNetworkWaitTimedOut(const base::Closure& runner_quit_task) { |
| 197 runner_quit_task.Run(); | 228 runner_quit_task.Run(); |
| 198 } | 229 } |
| 199 | 230 |
| 200 // Helper function for LockFileThread. | 231 // Helper function for LockFileThread. |
| 201 void LockAndUnlock(scoped_ptr<base::Lock> lock) { | 232 void LockAndUnlock(scoped_ptr<base::Lock> lock) { |
| 202 lock->Acquire(); | 233 lock->Acquire(); |
| 203 lock->Release(); | 234 lock->Release(); |
| 204 } | 235 } |
| 205 | 236 |
| 206 bool IsAppInstalled(const std::string& app_id) { | 237 bool IsAppInstalled(const std::string& app_id, const std::string& version) { |
| 207 Profile* app_profile = ProfileManager::GetPrimaryUserProfile(); | 238 Profile* app_profile = ProfileManager::GetPrimaryUserProfile(); |
| 208 DCHECK(app_profile); | 239 DCHECK(app_profile); |
| 209 const extensions::Extension* app = | 240 const extensions::Extension* app = |
| 210 extensions::ExtensionSystem::Get(app_profile) | 241 extensions::ExtensionSystem::Get(app_profile) |
| 211 ->extension_service() | 242 ->extension_service() |
| 212 ->GetInstalledExtension(app_id); | 243 ->GetInstalledExtension(app_id); |
| 213 return app != nullptr; | 244 return app != nullptr && version == app->version()->GetString(); |
| 214 } | 245 } |
| 215 | 246 |
| 216 extensions::Manifest::Type GetAppType(const std::string& app_id) { | 247 extensions::Manifest::Type GetAppType(const std::string& app_id) { |
| 217 Profile* app_profile = ProfileManager::GetPrimaryUserProfile(); | 248 Profile* app_profile = ProfileManager::GetPrimaryUserProfile(); |
| 218 DCHECK(app_profile); | 249 DCHECK(app_profile); |
| 219 const extensions::Extension* app = | 250 const extensions::Extension* app = |
| 220 extensions::ExtensionSystem::Get(app_profile) | 251 extensions::ExtensionSystem::Get(app_profile) |
| 221 ->extension_service() | 252 ->extension_service() |
| 222 ->GetInstalledExtension(app_id); | 253 ->GetInstalledExtension(app_id); |
| 223 DCHECK(app); | 254 DCHECK(app); |
| (...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1418 fake_cws()->SetUpdateCrx(app.id, app.crx_filename, app.version); | 1449 fake_cws()->SetUpdateCrx(app.id, app.crx_filename, app.version); |
| 1419 } | 1450 } |
| 1420 | 1451 |
| 1421 // Launch the primary app. | 1452 // Launch the primary app. |
| 1422 StartUIForAppLaunch(); | 1453 StartUIForAppLaunch(); |
| 1423 SimulateNetworkOnline(); | 1454 SimulateNetworkOnline(); |
| 1424 LaunchApp(test_app_id(), false); | 1455 LaunchApp(test_app_id(), false); |
| 1425 WaitForAppLaunchWithOptions(false, true); | 1456 WaitForAppLaunchWithOptions(false, true); |
| 1426 | 1457 |
| 1427 // Verify the primary app and the secondary apps are all installed. | 1458 // Verify the primary app and the secondary apps are all installed. |
| 1428 EXPECT_EQ(primary_app.version, GetInstalledAppVersion().GetString()); | 1459 EXPECT_TRUE(IsAppInstalled(primary_app.id, primary_app.version)); |
| 1429 for (const auto& app : secondary_apps) { | 1460 for (const auto& app : secondary_apps) { |
| 1430 EXPECT_TRUE(IsAppInstalled(app.id)); | 1461 EXPECT_TRUE(IsAppInstalled(app.id, app.version)); |
| 1431 EXPECT_EQ(GetAppType(app.id), app.type); | 1462 EXPECT_EQ(GetAppType(app.id), app.type); |
| 1432 } | 1463 } |
| 1433 } | 1464 } |
| 1434 | 1465 |
| 1435 void LaunchTestKioskAppWithTwoSecondaryApps() { | 1466 void LaunchTestKioskAppWithTwoSecondaryApps() { |
| 1436 TestAppInfo primary_app(kTestPrimaryKioskApp, "1.0.0", | 1467 TestAppInfo primary_app(kTestPrimaryKioskApp, "1.0.0", |
| 1437 std::string(kTestPrimaryKioskApp) + "-1.0.0.crx", | 1468 std::string(kTestPrimaryKioskApp) + "-1.0.0.crx", |
| 1438 extensions::Manifest::TYPE_PLATFORM_APP); | 1469 extensions::Manifest::TYPE_PLATFORM_APP); |
| 1439 | 1470 |
| 1440 std::vector<TestAppInfo> secondary_apps; | 1471 std::vector<TestAppInfo> secondary_apps; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1477 extensions::Manifest::TYPE_PLATFORM_APP); | 1508 extensions::Manifest::TYPE_PLATFORM_APP); |
| 1478 secondary_apps.push_back(secondary_app); | 1509 secondary_apps.push_back(secondary_app); |
| 1479 // Setting up FakeCWS for shared module is the same for shared module as | 1510 // Setting up FakeCWS for shared module is the same for shared module as |
| 1480 // for kiosk secondary apps. | 1511 // for kiosk secondary apps. |
| 1481 TestAppInfo shared_module(kTestSharedModuleId, "1.0.0", | 1512 TestAppInfo shared_module(kTestSharedModuleId, "1.0.0", |
| 1482 std::string(kTestSharedModuleId) + "-1.0.0.crx", | 1513 std::string(kTestSharedModuleId) + "-1.0.0.crx", |
| 1483 extensions::Manifest::TYPE_SHARED_MODULE); | 1514 extensions::Manifest::TYPE_SHARED_MODULE); |
| 1484 secondary_apps.push_back(shared_module); | 1515 secondary_apps.push_back(shared_module); |
| 1485 | 1516 |
| 1486 LaunchKioskWithSecondaryApps(primary_app, secondary_apps); | 1517 LaunchKioskWithSecondaryApps(primary_app, secondary_apps); |
| 1487 EXPECT_TRUE(IsAppInstalled(kTestSharedModuleId)); | 1518 EXPECT_TRUE(IsAppInstalled(shared_module.id, shared_module.version)); |
| 1519 } | |
| 1520 | |
| 1521 void LaunchAppWithSharedModule() { | |
| 1522 TestAppInfo primary_app( | |
| 1523 kTestSharedModulePrimaryApp, "2.0.0", | |
| 1524 std::string(kTestSharedModulePrimaryApp) + "-2.0.0.crx", | |
| 1525 extensions::Manifest::TYPE_PLATFORM_APP); | |
| 1526 | |
| 1527 std::vector<TestAppInfo> secondary_apps; | |
| 1528 // Setting up FakeCWS for shared module is the same for shared module as | |
| 1529 // for kiosk secondary apps. | |
| 1530 TestAppInfo shared_module(kTestSharedModuleId, "1.0.0", | |
| 1531 std::string(kTestSharedModuleId) + "-1.0.0.crx", | |
| 1532 extensions::Manifest::TYPE_SHARED_MODULE); | |
| 1533 secondary_apps.push_back(shared_module); | |
| 1534 | |
| 1535 LaunchKioskWithSecondaryApps(primary_app, secondary_apps); | |
| 1488 } | 1536 } |
| 1489 | 1537 |
| 1490 private: | 1538 private: |
| 1491 class KioskAppExternalUpdateWaiter : public KioskAppManagerObserver { | 1539 class KioskAppExternalUpdateWaiter : public KioskAppManagerObserver { |
| 1492 public: | 1540 public: |
| 1493 KioskAppExternalUpdateWaiter(KioskAppManager* manager, | 1541 KioskAppExternalUpdateWaiter(KioskAppManager* manager, |
| 1494 const std::string& app_id) | 1542 const std::string& app_id) |
| 1495 : runner_(NULL), | 1543 : runner_(NULL), |
| 1496 manager_(manager), | 1544 manager_(manager), |
| 1497 app_id_(app_id), | 1545 app_id_(app_id), |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1879 } | 1927 } |
| 1880 | 1928 |
| 1881 IN_PROC_BROWSER_TEST_F(KioskUpdateTest, PRE_UpdateMultiAppKioskRemoveOneApp) { | 1929 IN_PROC_BROWSER_TEST_F(KioskUpdateTest, PRE_UpdateMultiAppKioskRemoveOneApp) { |
| 1882 LaunchTestKioskAppWithTwoSecondaryApps(); | 1930 LaunchTestKioskAppWithTwoSecondaryApps(); |
| 1883 } | 1931 } |
| 1884 | 1932 |
| 1885 // Update the primary app to version 2 which removes one of the secondary app | 1933 // Update the primary app to version 2 which removes one of the secondary app |
| 1886 // from its manifest. | 1934 // from its manifest. |
| 1887 IN_PROC_BROWSER_TEST_F(KioskUpdateTest, UpdateMultiAppKioskRemoveOneApp) { | 1935 IN_PROC_BROWSER_TEST_F(KioskUpdateTest, UpdateMultiAppKioskRemoveOneApp) { |
| 1888 set_test_app_id(kTestPrimaryKioskApp); | 1936 set_test_app_id(kTestPrimaryKioskApp); |
| 1889 fake_cws()->SetUpdateCrx( | 1937 fake_cws()->SetUpdateCrx(kTestPrimaryKioskApp, |
| 1890 kTestPrimaryKioskApp, | 1938 std::string(kTestPrimaryKioskApp) + "-2.0.0.crx", |
| 1891 std::string(kTestPrimaryKioskApp) + "-2.0.0-1app.crx", "2.0.0"); | 1939 "2.0.0"); |
| 1892 fake_cws()->SetNoUpdate(kTestSecondaryApp1); | 1940 fake_cws()->SetNoUpdate(kTestSecondaryApp1); |
| 1893 fake_cws()->SetNoUpdate(kTestSecondaryApp2); | 1941 fake_cws()->SetNoUpdate(kTestSecondaryApp2); |
| 1894 | 1942 |
| 1895 StartUIForAppLaunch(); | 1943 StartUIForAppLaunch(); |
| 1896 SimulateNetworkOnline(); | 1944 SimulateNetworkOnline(); |
| 1897 LaunchApp(test_app_id(), false); | 1945 LaunchApp(test_app_id(), false); |
| 1898 WaitForAppLaunchWithOptions(false, true); | 1946 WaitForAppLaunchWithOptions(false, true); |
| 1899 | 1947 |
| 1900 // Verify the secondary app kTestSecondaryApp1 is removed. | 1948 // Verify the secondary app kTestSecondaryApp1 is removed. |
| 1901 EXPECT_EQ("2.0.0", GetInstalledAppVersion().GetString()); | 1949 EXPECT_EQ("2.0.0", GetInstalledAppVersion().GetString()); |
| 1902 EXPECT_FALSE(IsAppInstalled(kTestSecondaryApp1)); | 1950 EXPECT_FALSE(IsAppInstalled(kTestSecondaryApp1, "1.0.0")); |
| 1903 EXPECT_TRUE(IsAppInstalled(kTestSecondaryApp2)); | 1951 EXPECT_TRUE(IsAppInstalled(kTestSecondaryApp2, "1.0.0")); |
| 1904 } | 1952 } |
| 1905 | 1953 |
| 1906 IN_PROC_BROWSER_TEST_F(KioskUpdateTest, PRE_UpdateMultiAppKioskAddOneApp) { | 1954 IN_PROC_BROWSER_TEST_F(KioskUpdateTest, PRE_UpdateMultiAppKioskAddOneApp) { |
| 1907 LaunchTestKioskAppWithTwoSecondaryApps(); | 1955 LaunchTestKioskAppWithTwoSecondaryApps(); |
| 1908 } | 1956 } |
| 1909 | 1957 |
| 1910 // Update the primary app to version 3 which adds a new secondary app in its | 1958 // Update the primary app to version 3 which adds a new secondary app in its |
| 1911 // manifest. | 1959 // manifest. |
| 1912 IN_PROC_BROWSER_TEST_F(KioskUpdateTest, UpdateMultiAppKioskAddOneApp) { | 1960 IN_PROC_BROWSER_TEST_F(KioskUpdateTest, UpdateMultiAppKioskAddOneApp) { |
| 1913 set_test_app_id(kTestPrimaryKioskApp); | 1961 set_test_app_id(kTestPrimaryKioskApp); |
| 1914 fake_cws()->SetUpdateCrx( | 1962 fake_cws()->SetUpdateCrx(kTestPrimaryKioskApp, |
| 1915 kTestPrimaryKioskApp, | 1963 std::string(kTestPrimaryKioskApp) + "-3.0.0.crx", |
| 1916 std::string(kTestPrimaryKioskApp) + "-3.0.0-3app.crx", "3.0.0"); | 1964 "3.0.0"); |
| 1917 fake_cws()->SetNoUpdate(kTestSecondaryApp1); | 1965 fake_cws()->SetNoUpdate(kTestSecondaryApp1); |
| 1918 fake_cws()->SetNoUpdate(kTestSecondaryApp2); | 1966 fake_cws()->SetNoUpdate(kTestSecondaryApp2); |
| 1919 fake_cws()->SetUpdateCrx(kTestSecondaryApp3, | 1967 fake_cws()->SetUpdateCrx(kTestSecondaryApp3, |
| 1920 std::string(kTestSecondaryApp3) + "-1.0.0.crx", | 1968 std::string(kTestSecondaryApp3) + "-1.0.0.crx", |
| 1921 "1.0.0"); | 1969 "1.0.0"); |
| 1922 | 1970 |
| 1923 StartUIForAppLaunch(); | 1971 StartUIForAppLaunch(); |
| 1924 SimulateNetworkOnline(); | 1972 SimulateNetworkOnline(); |
| 1925 LaunchApp(test_app_id(), false); | 1973 LaunchApp(test_app_id(), false); |
| 1926 WaitForAppLaunchWithOptions(false, true); | 1974 WaitForAppLaunchWithOptions(false, true); |
| 1927 | 1975 |
| 1928 // Verify the secondary app kTestSecondaryApp3 is installed. | 1976 // Verify the secondary app kTestSecondaryApp3 is installed. |
| 1929 EXPECT_EQ("3.0.0", GetInstalledAppVersion().GetString()); | 1977 EXPECT_EQ("3.0.0", GetInstalledAppVersion().GetString()); |
| 1930 EXPECT_TRUE(IsAppInstalled(kTestSecondaryApp1)); | 1978 EXPECT_TRUE(IsAppInstalled(kTestSecondaryApp1, "1.0.0")); |
| 1931 EXPECT_TRUE(IsAppInstalled(kTestSecondaryApp2)); | 1979 EXPECT_TRUE(IsAppInstalled(kTestSecondaryApp2, "1.0.0")); |
| 1932 EXPECT_TRUE(IsAppInstalled(kTestSecondaryApp3)); | 1980 EXPECT_TRUE(IsAppInstalled(kTestSecondaryApp3, "1.0.0")); |
| 1933 } | 1981 } |
| 1934 | 1982 |
| 1935 IN_PROC_BROWSER_TEST_F(KioskUpdateTest, LaunchKioskAppWithSecondaryExtension) { | 1983 IN_PROC_BROWSER_TEST_F(KioskUpdateTest, LaunchKioskAppWithSecondaryExtension) { |
| 1936 LaunchTestKioskAppWithSeconadayExtension(); | 1984 LaunchTestKioskAppWithSeconadayExtension(); |
| 1937 } | 1985 } |
| 1938 | 1986 |
| 1939 IN_PROC_BROWSER_TEST_F(KioskUpdateTest, | 1987 IN_PROC_BROWSER_TEST_F(KioskUpdateTest, |
| 1940 LaunchAppWithSharedModuleAndSecondaryApp) { | 1988 LaunchAppWithSharedModuleAndSecondaryApp) { |
| 1941 LaunchAppWithSharedModuleAndSecondaryApp(); | 1989 LaunchAppWithSharedModuleAndSecondaryApp(); |
| 1942 } | 1990 } |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 1954 std::string(kTestSharedModulePrimaryApp) + "-2.0.0.crx", "2.0.0"); | 2002 std::string(kTestSharedModulePrimaryApp) + "-2.0.0.crx", "2.0.0"); |
| 1955 fake_cws()->SetNoUpdate(kTestSecondaryApp1); | 2003 fake_cws()->SetNoUpdate(kTestSecondaryApp1); |
| 1956 fake_cws()->SetNoUpdate(kTestSharedModuleId); | 2004 fake_cws()->SetNoUpdate(kTestSharedModuleId); |
| 1957 | 2005 |
| 1958 StartUIForAppLaunch(); | 2006 StartUIForAppLaunch(); |
| 1959 SimulateNetworkOnline(); | 2007 SimulateNetworkOnline(); |
| 1960 LaunchApp(test_app_id(), false); | 2008 LaunchApp(test_app_id(), false); |
| 1961 WaitForAppLaunchWithOptions(false, true); | 2009 WaitForAppLaunchWithOptions(false, true); |
| 1962 | 2010 |
| 1963 // Verify the secondary app is removed. | 2011 // Verify the secondary app is removed. |
| 1964 EXPECT_TRUE(IsAppInstalled(kTestSharedModuleId)); | 2012 EXPECT_TRUE(IsAppInstalled(kTestSharedModuleId, "1.0.0")); |
| 1965 EXPECT_FALSE(IsAppInstalled(kTestSecondaryApp1)); | 2013 EXPECT_FALSE(IsAppInstalled(kTestSecondaryApp1, "1.0.0")); |
| 1966 } | 2014 } |
| 1967 | 2015 |
| 1968 // This simulates the stand-alone ARC kiosk app case. The primary app has a | 2016 // This simulates the stand-alone ARC kiosk app case. The primary app has a |
| 1969 // shared ARC runtime but no secondary apps. | 2017 // shared ARC runtime but no secondary apps. |
| 1970 IN_PROC_BROWSER_TEST_F(KioskUpdateTest, LaunchAppWithSharedModuleNoSecondary) { | 2018 IN_PROC_BROWSER_TEST_F(KioskUpdateTest, LaunchAppWithSharedModuleNoSecondary) { |
| 2019 LaunchAppWithSharedModule(); | |
| 2020 } | |
| 2021 | |
| 2022 IN_PROC_BROWSER_TEST_F(KioskUpdateTest, PRE_LaunchAppWithUpdatedModule) { | |
| 2023 LaunchAppWithSharedModule(); | |
| 2024 } | |
| 2025 | |
| 2026 // This simulates the case the shared module is updated to a newer version. | |
| 2027 // See crbug.com/555083. | |
| 2028 IN_PROC_BROWSER_TEST_F(KioskUpdateTest, LaunchAppWithUpdatedModule) { | |
| 1971 TestAppInfo primary_app( | 2029 TestAppInfo primary_app( |
| 1972 kTestSharedModulePrimaryApp, "2.0.0", | 2030 kTestSharedModulePrimaryApp, "2.0.0", |
| 1973 std::string(kTestSharedModulePrimaryApp) + "-2.0.0.crx", | 2031 std::string(kTestSharedModulePrimaryApp) + "-2.0.0.crx", |
| 1974 extensions::Manifest::TYPE_PLATFORM_APP); | 2032 extensions::Manifest::TYPE_PLATFORM_APP); |
| 1975 | 2033 |
| 1976 std::vector<TestAppInfo> secondary_apps; | 2034 std::vector<TestAppInfo> secondary_apps; |
| 1977 // Setting up FakeCWS for shared module is the same for shared module as | 2035 // Set up the shared module on FakeCWS to the new version. |
| 1978 // for kiosk secondary apps. | 2036 TestAppInfo shared_module(kTestSharedModuleId, "2.0.0", |
| 1979 TestAppInfo shared_module(kTestSharedModuleId, "1.0.0", | 2037 std::string(kTestSharedModuleId) + "-2.0.0.crx", |
| 1980 std::string(kTestSharedModuleId) + "-1.0.0.crx", | |
| 1981 extensions::Manifest::TYPE_SHARED_MODULE); | 2038 extensions::Manifest::TYPE_SHARED_MODULE); |
| 1982 secondary_apps.push_back(shared_module); | 2039 secondary_apps.push_back(shared_module); |
| 1983 | 2040 |
| 2041 // When the primary app is launched, the shared module should be updated to | |
| 2042 // the new version. | |
| 1984 LaunchKioskWithSecondaryApps(primary_app, secondary_apps); | 2043 LaunchKioskWithSecondaryApps(primary_app, secondary_apps); |
| 1985 } | 2044 } |
|
xiyuan
2015/12/02 21:04:20
Should we do a
EXPECT_TRUE(IsAppInstalled(kTe
jennyz
2015/12/03 00:27:55
Done.
| |
| 1986 | 2045 |
| 1987 IN_PROC_BROWSER_TEST_F(KioskUpdateTest, | 2046 IN_PROC_BROWSER_TEST_F(KioskUpdateTest, |
| 1988 LaunchAppWithSecondaryArcLikeAppAndExtension) { | 2047 LaunchAppWithSecondaryArcLikeAppAndExtension) { |
| 1989 TestAppInfo primary_app( | 2048 TestAppInfo primary_app( |
| 1990 kTestSharedModulePrimaryApp, "3.0.0", | 2049 kTestSharedModulePrimaryApp, "3.0.0", |
| 1991 std::string(kTestSharedModulePrimaryApp) + "-3.0.0.crx", | 2050 std::string(kTestSharedModulePrimaryApp) + "-3.0.0.crx", |
| 1992 extensions::Manifest::TYPE_PLATFORM_APP); | 2051 extensions::Manifest::TYPE_PLATFORM_APP); |
| 1993 | 2052 |
| 1994 std::vector<TestAppInfo> secondary_apps; | 2053 std::vector<TestAppInfo> secondary_apps; |
| 1995 // Setting up FakeCWS for shared module is the same for shared module as | 2054 // Setting up FakeCWS for shared module is the same for shared module as |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2252 content::WindowedNotificationObserver( | 2311 content::WindowedNotificationObserver( |
| 2253 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 2312 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
| 2254 content::NotificationService::AllSources()).Wait(); | 2313 content::NotificationService::AllSources()).Wait(); |
| 2255 | 2314 |
| 2256 // Wait for the wallpaper to load. | 2315 // Wait for the wallpaper to load. |
| 2257 WaitForWallpaper(); | 2316 WaitForWallpaper(); |
| 2258 EXPECT_TRUE(wallpaper_loaded()); | 2317 EXPECT_TRUE(wallpaper_loaded()); |
| 2259 } | 2318 } |
| 2260 | 2319 |
| 2261 } // namespace chromeos | 2320 } // namespace chromeos |
| OLD | NEW |