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

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

Issue 1052703002: Cleanup/ Remove deprecated extension notification from c/b/apps/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « chrome/browser/apps/ephemeral_app_launcher_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <vector> 5 #include <vector>
6 6
7 #include "chrome/browser/apps/ephemeral_app_browsertest.h" 7 #include "chrome/browser/apps/ephemeral_app_browsertest.h"
8 #include "chrome/browser/apps/ephemeral_app_service.h" 8 #include "chrome/browser/apps/ephemeral_app_service.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "content/public/test/test_utils.h" 10 #include "content/public/test/test_utils.h"
11 #include "extensions/browser/extension_prefs.h" 11 #include "extensions/browser/extension_prefs.h"
12 #include "extensions/browser/extension_registry.h" 12 #include "extensions/browser/extension_registry.h"
13 #include "extensions/browser/notification_types.h" 13 #include "extensions/browser/test_extension_registry_observer.h"
14 #include "extensions/common/manifest.h"
15 14
16 using extensions::Extension; 15 using extensions::Extension;
17 using extensions::ExtensionPrefs; 16 using extensions::ExtensionPrefs;
18 using extensions::ExtensionRegistry; 17 using extensions::ExtensionRegistry;
19 18
20 namespace { 19 namespace {
21 20
22 const int kNumTestApps = 2; 21 const int kNumTestApps = 2;
23 const char* kTestApps[] = { 22 const char* kTestApps[] = {
24 "app_window/generic", 23 "app_window/generic",
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 base::TimeDelta::FromDays(EphemeralAppService::kAppInactiveThreshold + 1); 82 base::TimeDelta::FromDays(EphemeralAppService::kAppInactiveThreshold + 1);
84 prefs->SetLastLaunchTime(inactive_app_id, inactive_launch); 83 prefs->SetLastLaunchTime(inactive_app_id, inactive_launch);
85 84
86 // Set launch time for an active app. 85 // Set launch time for an active app.
87 std::string active_app_id = app_ids_[1]; 86 std::string active_app_id = app_ids_[1];
88 base::Time active_launch = time_now - 87 base::Time active_launch = time_now -
89 base::TimeDelta::FromDays(EphemeralAppService::kAppKeepThreshold); 88 base::TimeDelta::FromDays(EphemeralAppService::kAppKeepThreshold);
90 prefs->SetLastLaunchTime(active_app_id, active_launch); 89 prefs->SetLastLaunchTime(active_app_id, active_launch);
91 90
92 // Perform garbage collection. 91 // Perform garbage collection.
93 content::WindowedNotificationObserver uninstall_signal( 92 extensions::TestExtensionRegistryObserver observer(
94 extensions::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED, 93 ExtensionRegistry::Get(browser()->profile()));
95 content::Source<Profile>(browser()->profile()));
96 GarbageCollectEphemeralApps(); 94 GarbageCollectEphemeralApps();
97 uninstall_signal.Wait(); 95 observer.WaitForExtensionUninstalled();
98 96
99 ExtensionRegistry* registry = ExtensionRegistry::Get(profile()); 97 ExtensionRegistry* registry = ExtensionRegistry::Get(profile());
100 ASSERT_TRUE(registry); 98 ASSERT_TRUE(registry);
101 EXPECT_FALSE(registry->GetExtensionById(inactive_app_id, 99 EXPECT_FALSE(registry->GetExtensionById(inactive_app_id,
102 ExtensionRegistry::EVERYTHING)); 100 ExtensionRegistry::EVERYTHING));
103 EXPECT_TRUE( 101 EXPECT_TRUE(
104 registry->GetExtensionById(active_app_id, ExtensionRegistry::EVERYTHING)); 102 registry->GetExtensionById(active_app_id, ExtensionRegistry::EVERYTHING));
105 103
106 EXPECT_EQ(1, ephemeral_service->ephemeral_app_count()); 104 EXPECT_EQ(1, ephemeral_service->ephemeral_app_count());
107 } 105 }
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 installed_app->id(), Extension::DISABLE_INACTIVE_EPHEMERAL_APP)); 198 installed_app->id(), Extension::DISABLE_INACTIVE_EPHEMERAL_APP));
201 EXPECT_FALSE(prefs->HasDisableReason( 199 EXPECT_FALSE(prefs->HasDisableReason(
202 running_app->id(), Extension::DISABLE_INACTIVE_EPHEMERAL_APP)); 200 running_app->id(), Extension::DISABLE_INACTIVE_EPHEMERAL_APP));
203 EXPECT_TRUE(prefs->HasDisableReason( 201 EXPECT_TRUE(prefs->HasDisableReason(
204 inactive_app->id(), Extension::DISABLE_INACTIVE_EPHEMERAL_APP)); 202 inactive_app->id(), Extension::DISABLE_INACTIVE_EPHEMERAL_APP));
205 EXPECT_TRUE(prefs->HasDisableReason( 203 EXPECT_TRUE(prefs->HasDisableReason(
206 disabled_app->id(), Extension::DISABLE_INACTIVE_EPHEMERAL_APP)); 204 disabled_app->id(), Extension::DISABLE_INACTIVE_EPHEMERAL_APP));
207 EXPECT_TRUE(prefs->HasDisableReason( 205 EXPECT_TRUE(prefs->HasDisableReason(
208 disabled_app->id(), Extension::DISABLE_PERMISSIONS_INCREASE)); 206 disabled_app->id(), Extension::DISABLE_PERMISSIONS_INCREASE));
209 } 207 }
OLDNEW
« no previous file with comments | « chrome/browser/apps/ephemeral_app_launcher_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698