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/saved_files_service.h" | 9 #include "apps/saved_files_service.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 // Uninstall the app, which is what happens when ephemeral apps get evicted | 238 // Uninstall the app, which is what happens when ephemeral apps get evicted |
239 // from the cache. | 239 // from the cache. |
240 content::WindowedNotificationObserver uninstalled_signal( | 240 content::WindowedNotificationObserver uninstalled_signal( |
241 chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED, | 241 chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED, |
242 content::Source<Profile>(profile())); | 242 content::Source<Profile>(profile())); |
243 | 243 |
244 ExtensionService* service = | 244 ExtensionService* service = |
245 ExtensionSystem::Get(profile())->extension_service(); | 245 ExtensionSystem::Get(profile())->extension_service(); |
246 ASSERT_TRUE(service); | 246 ASSERT_TRUE(service); |
247 service->UninstallExtension( | 247 service->UninstallExtension( |
248 app_id, extensions::UNINSTALL_REASON_ORPHANED_EPHEMERAL_EXTENSION, NULL); | 248 app_id, |
| 249 extensions::UNINSTALL_REASON_ORPHANED_EPHEMERAL_EXTENSION, |
| 250 base::Bind(&base::DoNothing), |
| 251 NULL); |
249 | 252 |
250 uninstalled_signal.Wait(); | 253 uninstalled_signal.Wait(); |
251 } | 254 } |
252 | 255 |
253 // EphemeralAppBrowserTest: | 256 // EphemeralAppBrowserTest: |
254 | 257 |
255 class EphemeralAppBrowserTest : public EphemeralAppTestBase { | 258 class EphemeralAppBrowserTest : public EphemeralAppTestBase { |
256 protected: | 259 protected: |
257 bool LaunchAppAndRunTest(const Extension* app, const char* test_name) { | 260 bool LaunchAppAndRunTest(const Extension* app, const char* test_name) { |
258 ExtensionTestMessageListener launched_listener("launched", true); | 261 ExtensionTestMessageListener launched_listener("launched", true); |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 | 727 |
725 // Ensure that when the app is promoted to an installed app, the bit in the | 728 // Ensure that when the app is promoted to an installed app, the bit in the |
726 // creation flags is cleared. | 729 // creation flags is cleared. |
727 PromoteEphemeralApp(app); | 730 PromoteEphemeralApp(app); |
728 EXPECT_FALSE(extensions::util::IsEphemeralApp(app->id(), profile())); | 731 EXPECT_FALSE(extensions::util::IsEphemeralApp(app->id(), profile())); |
729 | 732 |
730 int creation_flags = | 733 int creation_flags = |
731 ExtensionPrefs::Get(profile())->GetCreationFlags(app->id()); | 734 ExtensionPrefs::Get(profile())->GetCreationFlags(app->id()); |
732 EXPECT_EQ(0, creation_flags & Extension::IS_EPHEMERAL); | 735 EXPECT_EQ(0, creation_flags & Extension::IS_EPHEMERAL); |
733 } | 736 } |
OLD | NEW |