| 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(app_id, false, NULL); | 245 service->UninstallExtension( |
| 246 app_id, |
| 247 ExtensionService::UNINSTALL_REASON_ORPHANED_EPHEMERAL_EXTENSION, |
| 248 NULL); |
| 246 | 249 |
| 247 uninstalled_signal.Wait(); | 250 uninstalled_signal.Wait(); |
| 248 } | 251 } |
| 249 | 252 |
| 250 // EphemeralAppBrowserTest: | 253 // EphemeralAppBrowserTest: |
| 251 | 254 |
| 252 class EphemeralAppBrowserTest : public EphemeralAppTestBase { | 255 class EphemeralAppBrowserTest : public EphemeralAppTestBase { |
| 253 protected: | 256 protected: |
| 254 bool LaunchAppAndRunTest(const Extension* app, const char* test_name) { | 257 bool LaunchAppAndRunTest(const Extension* app, const char* test_name) { |
| 255 ExtensionTestMessageListener launched_listener("launched", true); | 258 ExtensionTestMessageListener launched_listener("launched", true); |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 | 701 |
| 699 // Ensure that when the app is promoted to an installed app, the bit in the | 702 // Ensure that when the app is promoted to an installed app, the bit in the |
| 700 // creation flags is cleared. | 703 // creation flags is cleared. |
| 701 PromoteEphemeralApp(app); | 704 PromoteEphemeralApp(app); |
| 702 EXPECT_FALSE(extensions::util::IsEphemeralApp(app->id(), profile())); | 705 EXPECT_FALSE(extensions::util::IsEphemeralApp(app->id(), profile())); |
| 703 | 706 |
| 704 int creation_flags = | 707 int creation_flags = |
| 705 ExtensionPrefs::Get(profile())->GetCreationFlags(app->id()); | 708 ExtensionPrefs::Get(profile())->GetCreationFlags(app->id()); |
| 706 EXPECT_EQ(0, creation_flags & Extension::IS_EPHEMERAL); | 709 EXPECT_EQ(0, creation_flags & Extension::IS_EPHEMERAL); |
| 707 } | 710 } |
| OLD | NEW |