Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: chrome/browser/apps/ephemeral_app_browsertest.cc

Issue 398083002: Add "UninstallReason" parameter to ExtensionRegistryObserver::OnExtensionUninstalled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 30 matching lines...) Expand all
41 41
42 using extensions::AppSyncData; 42 using extensions::AppSyncData;
43 using extensions::Event; 43 using extensions::Event;
44 using extensions::EventRouter; 44 using extensions::EventRouter;
45 using extensions::Extension; 45 using extensions::Extension;
46 using extensions::ExtensionPrefs; 46 using extensions::ExtensionPrefs;
47 using extensions::ExtensionRegistry; 47 using extensions::ExtensionRegistry;
48 using extensions::ExtensionRegistryObserver; 48 using extensions::ExtensionRegistryObserver;
49 using extensions::ExtensionSystem; 49 using extensions::ExtensionSystem;
50 using extensions::Manifest; 50 using extensions::Manifest;
51 using extensions::UninstalledExtensionInfo;
51 52
52 namespace { 53 namespace {
53 54
54 namespace alarms = extensions::api::alarms; 55 namespace alarms = extensions::api::alarms;
55 56
56 const char kDispatchEventTestApp[] = "ephemeral_apps/dispatch_event"; 57 const char kDispatchEventTestApp[] = "ephemeral_apps/dispatch_event";
57 const char kNotificationsTestApp[] = "ephemeral_apps/notification_settings"; 58 const char kNotificationsTestApp[] = "ephemeral_apps/notification_settings";
58 const char kFileSystemTestApp[] = "ephemeral_apps/filesystem_retain_entries"; 59 const char kFileSystemTestApp[] = "ephemeral_apps/filesystem_retain_entries";
59 60
60 typedef std::vector<message_center::Notifier*> NotifierList; 61 typedef std::vector<message_center::Notifier*> NotifierList;
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 // from the cache. 238 // from the cache.
238 content::WindowedNotificationObserver uninstalled_signal( 239 content::WindowedNotificationObserver uninstalled_signal(
239 chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED, 240 chrome::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
240 content::Source<Profile>(profile())); 241 content::Source<Profile>(profile()));
241 242
242 ExtensionService* service = 243 ExtensionService* service =
243 ExtensionSystem::Get(profile())->extension_service(); 244 ExtensionSystem::Get(profile())->extension_service();
244 ASSERT_TRUE(service); 245 ASSERT_TRUE(service);
245 service->UninstallExtension( 246 service->UninstallExtension(
246 app_id, 247 app_id,
247 ExtensionService::UNINSTALL_REASON_ORPHANED_EPHEMERAL_EXTENSION, 248 UninstalledExtensionInfo::REASON_ORPHANED_EPHEMERAL_EXTENSION,
248 NULL); 249 NULL);
249 250
250 uninstalled_signal.Wait(); 251 uninstalled_signal.Wait();
251 } 252 }
252 253
253 // EphemeralAppBrowserTest: 254 // EphemeralAppBrowserTest:
254 255
255 class EphemeralAppBrowserTest : public EphemeralAppTestBase { 256 class EphemeralAppBrowserTest : public EphemeralAppTestBase {
256 protected: 257 protected:
257 bool LaunchAppAndRunTest(const Extension* app, const char* test_name) { 258 bool LaunchAppAndRunTest(const Extension* app, const char* test_name) {
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 702
702 // Ensure that when the app is promoted to an installed app, the bit in the 703 // Ensure that when the app is promoted to an installed app, the bit in the
703 // creation flags is cleared. 704 // creation flags is cleared.
704 PromoteEphemeralApp(app); 705 PromoteEphemeralApp(app);
705 EXPECT_FALSE(extensions::util::IsEphemeralApp(app->id(), profile())); 706 EXPECT_FALSE(extensions::util::IsEphemeralApp(app->id(), profile()));
706 707
707 int creation_flags = 708 int creation_flags =
708 ExtensionPrefs::Get(profile())->GetCreationFlags(app->id()); 709 ExtensionPrefs::Get(profile())->GetCreationFlags(app->id());
709 EXPECT_EQ(0, creation_flags & Extension::IS_EPHEMERAL); 710 EXPECT_EQ(0, creation_flags & Extension::IS_EPHEMERAL);
710 } 711 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698