| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/apps/ephemeral_app_browsertest.h" | 5 #include "chrome/browser/apps/ephemeral_app_browsertest.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "apps/app_restore_service.h" | 9 #include "apps/app_restore_service.h" |
| 10 #include "apps/saved_files_service.h" | 10 #include "apps/saved_files_service.h" |
| (...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 CloseAppWaitForUnload(app->id()); | 859 CloseAppWaitForUnload(app->id()); |
| 860 VerifyInactiveEphemeralApp(app->id()); | 860 VerifyInactiveEphemeralApp(app->id()); |
| 861 | 861 |
| 862 PromoteEphemeralAppFromSyncAndVerify(app, false, ExtensionRegistry::DISABLED); | 862 PromoteEphemeralAppFromSyncAndVerify(app, false, ExtensionRegistry::DISABLED); |
| 863 } | 863 } |
| 864 | 864 |
| 865 // In most cases, ExtensionService::PromoteEphemeralApp() will be called to | 865 // In most cases, ExtensionService::PromoteEphemeralApp() will be called to |
| 866 // permanently install an ephemeral app. However, there may be cases where an | 866 // permanently install an ephemeral app. However, there may be cases where an |
| 867 // install occurs through the usual route of installing from the Web Store (due | 867 // install occurs through the usual route of installing from the Web Store (due |
| 868 // to race conditions). Ensure that the app is still installed correctly. | 868 // to race conditions). Ensure that the app is still installed correctly. |
| 869 #if defined(OS_WIN) |
| 870 // Disabled on Windows due to failures. See crbug.com/401028 |
| 871 #define MAYBE_ReplaceEphemeralAppWithInstalledApp \ |
| 872 DISABLED_ReplaceEphemeralAppWithInstalledApp |
| 873 #else |
| 874 #define MAYBE_ReplaceEphemeralAppWithInstalledApp \ |
| 875 ReplaceEphemeralAppWithInstalledApp |
| 876 #endif |
| 869 IN_PROC_BROWSER_TEST_F(EphemeralAppBrowserTest, | 877 IN_PROC_BROWSER_TEST_F(EphemeralAppBrowserTest, |
| 870 ReplaceEphemeralAppWithInstalledApp) { | 878 MAYBE_ReplaceEphemeralAppWithInstalledApp) { |
| 871 InitSyncService(); | 879 InitSyncService(); |
| 872 | 880 |
| 873 const Extension* app = InstallAndLaunchEphemeralApp(kNotificationsTestApp); | 881 const Extension* app = InstallAndLaunchEphemeralApp(kNotificationsTestApp); |
| 874 ASSERT_TRUE(app); | 882 ASSERT_TRUE(app); |
| 875 CloseAppWaitForUnload(app->id()); | 883 CloseAppWaitForUnload(app->id()); |
| 876 std::string app_id = app->id(); | 884 std::string app_id = app->id(); |
| 877 app = NULL; | 885 app = NULL; |
| 878 | 886 |
| 879 InstallObserver installed_observer(profile()); | 887 InstallObserver installed_observer(profile()); |
| 880 ReplaceEphemeralApp(app_id, kNotificationsTestApp, 1); | 888 ReplaceEphemeralApp(app_id, kNotificationsTestApp, 1); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 | 967 |
| 960 // Ensure that when the app is promoted to an installed app, the bit in the | 968 // Ensure that when the app is promoted to an installed app, the bit in the |
| 961 // creation flags is cleared. | 969 // creation flags is cleared. |
| 962 PromoteEphemeralApp(app); | 970 PromoteEphemeralApp(app); |
| 963 EXPECT_FALSE(extensions::util::IsEphemeralApp(app->id(), profile())); | 971 EXPECT_FALSE(extensions::util::IsEphemeralApp(app->id(), profile())); |
| 964 | 972 |
| 965 int creation_flags = | 973 int creation_flags = |
| 966 ExtensionPrefs::Get(profile())->GetCreationFlags(app->id()); | 974 ExtensionPrefs::Get(profile())->GetCreationFlags(app->id()); |
| 967 EXPECT_EQ(0, creation_flags & Extension::IS_EPHEMERAL); | 975 EXPECT_EQ(0, creation_flags & Extension::IS_EPHEMERAL); |
| 968 } | 976 } |
| OLD | NEW |