| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 void EphemeralAppTestBase::EvictApp(const std::string& app_id) { | 235 void EphemeralAppTestBase::EvictApp(const std::string& app_id) { |
| 236 // Uninstall the app, which is what happens when ephemeral apps get evicted | 236 // Uninstall the app, which is what happens when ephemeral apps get evicted |
| 237 // from the cache. | 237 // from the cache. |
| 238 content::WindowedNotificationObserver uninstalled_signal( | 238 content::WindowedNotificationObserver uninstalled_signal( |
| 239 chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED, | 239 chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED, |
| 240 content::Source<Profile>(profile())); | 240 content::Source<Profile>(profile())); |
| 241 | 241 |
| 242 ExtensionService* service = | 242 ExtensionService* service = |
| 243 ExtensionSystem::Get(profile())->extension_service(); | 243 ExtensionSystem::Get(profile())->extension_service(); |
| 244 ASSERT_TRUE(service); | 244 ASSERT_TRUE(service); |
| 245 service->UninstallExtension( | 245 service->UninstallExtension(app_id, false, NULL); |
| 246 app_id, | |
| 247 ExtensionService::UNINSTALL_REASON_ORPHANED_EPHEMERAL_EXTENSION, | |
| 248 NULL); | |
| 249 | 246 |
| 250 uninstalled_signal.Wait(); | 247 uninstalled_signal.Wait(); |
| 251 } | 248 } |
| 252 | 249 |
| 253 // EphemeralAppBrowserTest: | 250 // EphemeralAppBrowserTest: |
| 254 | 251 |
| 255 class EphemeralAppBrowserTest : public EphemeralAppTestBase { | 252 class EphemeralAppBrowserTest : public EphemeralAppTestBase { |
| 256 protected: | 253 protected: |
| 257 bool LaunchAppAndRunTest(const Extension* app, const char* test_name) { | 254 bool LaunchAppAndRunTest(const Extension* app, const char* test_name) { |
| 258 ExtensionTestMessageListener launched_listener("launched", true); | 255 ExtensionTestMessageListener launched_listener("launched", true); |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 | 698 |
| 702 // Ensure that when the app is promoted to an installed app, the bit in the | 699 // Ensure that when the app is promoted to an installed app, the bit in the |
| 703 // creation flags is cleared. | 700 // creation flags is cleared. |
| 704 PromoteEphemeralApp(app); | 701 PromoteEphemeralApp(app); |
| 705 EXPECT_FALSE(extensions::util::IsEphemeralApp(app->id(), profile())); | 702 EXPECT_FALSE(extensions::util::IsEphemeralApp(app->id(), profile())); |
| 706 | 703 |
| 707 int creation_flags = | 704 int creation_flags = |
| 708 ExtensionPrefs::Get(profile())->GetCreationFlags(app->id()); | 705 ExtensionPrefs::Get(profile())->GetCreationFlags(app->id()); |
| 709 EXPECT_EQ(0, creation_flags & Extension::IS_EPHEMERAL); | 706 EXPECT_EQ(0, creation_flags & Extension::IS_EPHEMERAL); |
| 710 } | 707 } |
| OLD | NEW |