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 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 | 882 |
883 // Check the notification parameters. | 883 // Check the notification parameters. |
884 const InstallObserver::InstallParameters& params = installed_observer.Last(); | 884 const InstallObserver::InstallParameters& params = installed_observer.Last(); |
885 EXPECT_EQ(app_id, params.id); | 885 EXPECT_EQ(app_id, params.id); |
886 EXPECT_TRUE(params.is_update); | 886 EXPECT_TRUE(params.is_update); |
887 EXPECT_TRUE(params.from_ephemeral); | 887 EXPECT_TRUE(params.from_ephemeral); |
888 } | 888 } |
889 | 889 |
890 // This is similar to ReplaceEphemeralAppWithInstalledApp, but installs will | 890 // This is similar to ReplaceEphemeralAppWithInstalledApp, but installs will |
891 // be delayed until the app is idle. | 891 // be delayed until the app is idle. |
| 892 #if defined(OS_WIN) |
| 893 // Disabled on Windows due to failures. See crbug.com/401028 |
| 894 #define MAYBE_ReplaceEphemeralAppWithDelayedInstalledApp \ |
| 895 DISABLED_ReplaceEphemeralAppWithDelayedInstalledApp |
| 896 #else |
| 897 #define MAYBE_ReplaceEphemeralAppWithDelayedInstalledApp \ |
| 898 ReplaceEphemeralAppWithDelayedInstalledApp |
| 899 #endif |
892 IN_PROC_BROWSER_TEST_F(EphemeralAppBrowserTest, | 900 IN_PROC_BROWSER_TEST_F(EphemeralAppBrowserTest, |
893 ReplaceEphemeralAppWithDelayedInstalledApp) { | 901 MAYBE_ReplaceEphemeralAppWithDelayedInstalledApp) { |
894 InitSyncService(); | 902 InitSyncService(); |
895 | |
896 const Extension* app = InstallAndLaunchEphemeralApp(kNotificationsTestApp); | 903 const Extension* app = InstallAndLaunchEphemeralApp(kNotificationsTestApp); |
897 ASSERT_TRUE(app); | 904 ASSERT_TRUE(app); |
898 std::string app_id = app->id(); | 905 std::string app_id = app->id(); |
899 app = NULL; | 906 app = NULL; |
900 | 907 |
901 // Initiate install. | 908 // Initiate install. |
902 ReplaceEphemeralApp(app_id, kNotificationsTestApp, 0); | 909 ReplaceEphemeralApp(app_id, kNotificationsTestApp, 0); |
903 | 910 |
904 // The delayed installation will occur when the ephemeral app is closed. | 911 // The delayed installation will occur when the ephemeral app is closed. |
905 content::WindowedNotificationObserver installed_signal( | 912 content::WindowedNotificationObserver installed_signal( |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 | 959 |
953 // Ensure that when the app is promoted to an installed app, the bit in the | 960 // Ensure that when the app is promoted to an installed app, the bit in the |
954 // creation flags is cleared. | 961 // creation flags is cleared. |
955 PromoteEphemeralApp(app); | 962 PromoteEphemeralApp(app); |
956 EXPECT_FALSE(extensions::util::IsEphemeralApp(app->id(), profile())); | 963 EXPECT_FALSE(extensions::util::IsEphemeralApp(app->id(), profile())); |
957 | 964 |
958 int creation_flags = | 965 int creation_flags = |
959 ExtensionPrefs::Get(profile())->GetCreationFlags(app->id()); | 966 ExtensionPrefs::Get(profile())->GetCreationFlags(app->id()); |
960 EXPECT_EQ(0, creation_flags & Extension::IS_EPHEMERAL); | 967 EXPECT_EQ(0, creation_flags & Extension::IS_EPHEMERAL); |
961 } | 968 } |
OLD | NEW |