summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlimasdf <limasdf@gmail.com>2015-04-01 10:30:09 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-01 17:31:05 +0000
commit00e5633d763396f0b92e89e4c6e8fbb66c93c67a (patch)
tree87b025a592e46d9f4a8a1a54287c00522305b213
parentf47b494165f7d03a8e92b1780acdf673a87cb454 (diff)
downloadchromium_src-00e5633d763396f0b92e89e4c6e8fbb66c93c67a.zip
chromium_src-00e5633d763396f0b92e89e4c6e8fbb66c93c67a.tar.gz
chromium_src-00e5633d763396f0b92e89e4c6e8fbb66c93c67a.tar.bz2
Remove deprecated extension notification c/b/apps/
BUG=411568 TEST=browser_tests Review URL: https://codereview.chromium.org/1052703002 Cr-Commit-Position: refs/heads/master@{#323275}
-rw-r--r--chrome/browser/apps/ephemeral_app_browsertest.cc23
-rw-r--r--chrome/browser/apps/ephemeral_app_launcher_browsertest.cc8
-rw-r--r--chrome/browser/apps/ephemeral_app_service_browsertest.cc10
3 files changed, 18 insertions, 23 deletions
diff --git a/chrome/browser/apps/ephemeral_app_browsertest.cc b/chrome/browser/apps/ephemeral_app_browsertest.cc
index 348a125..2804632 100644
--- a/chrome/browser/apps/ephemeral_app_browsertest.cc
+++ b/chrome/browser/apps/ephemeral_app_browsertest.cc
@@ -31,8 +31,8 @@
#include "extensions/browser/extension_registry_observer.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/extension_util.h"
-#include "extensions/browser/notification_types.h"
#include "extensions/browser/process_manager.h"
+#include "extensions/browser/test_extension_registry_observer.h"
#include "extensions/browser/uninstall_reason.h"
#include "extensions/common/api/alarms.h"
#include "extensions/common/extension.h"
@@ -316,19 +316,17 @@ void EphemeralAppTestBase::CloseApp(const std::string& app_id) {
void EphemeralAppTestBase::CloseAppWaitForUnload(const std::string& app_id) {
// Ephemeral apps are unloaded from extension system after they stop running.
- content::WindowedNotificationObserver unloaded_signal(
- extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
- content::Source<Profile>(profile()));
+ extensions::TestExtensionRegistryObserver observer(
+ ExtensionRegistry::Get(profile()), app_id);
CloseApp(app_id);
- unloaded_signal.Wait();
+ observer.WaitForExtensionUnloaded();
}
void EphemeralAppTestBase::EvictApp(const std::string& app_id) {
// Uninstall the app, which is what happens when ephemeral apps get evicted
// from the cache.
- content::WindowedNotificationObserver uninstalled_signal(
- extensions::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
- content::Source<Profile>(profile()));
+ extensions::TestExtensionRegistryObserver observer(
+ ExtensionRegistry::Get(profile()), app_id);
ExtensionService* service =
ExtensionSystem::Get(profile())->extension_service();
@@ -339,7 +337,7 @@ void EphemeralAppTestBase::EvictApp(const std::string& app_id) {
base::Bind(&base::DoNothing),
NULL);
- uninstalled_signal.Wait();
+ observer.WaitForExtensionUninstalled();
}
// EphemeralAppBrowserTest:
@@ -965,12 +963,11 @@ IN_PROC_BROWSER_TEST_F(EphemeralAppBrowserTest,
ReplaceEphemeralApp(app_id, kNotificationsTestApp, 0);
// The delayed installation will occur when the ephemeral app is closed.
- content::WindowedNotificationObserver installed_signal(
- extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
- content::Source<Profile>(profile()));
+ extensions::TestExtensionRegistryObserver observer(
+ ExtensionRegistry::Get(profile()), app_id);
InstallObserver installed_observer(profile());
CloseAppWaitForUnload(app_id);
- installed_signal.Wait();
+ observer.WaitForExtensionWillBeInstalled();
VerifyPromotedApp(app_id, ExtensionRegistry::ENABLED);
// Check the notification parameters.
diff --git a/chrome/browser/apps/ephemeral_app_launcher_browsertest.cc b/chrome/browser/apps/ephemeral_app_launcher_browsertest.cc
index 4898431..565410a 100644
--- a/chrome/browser/apps/ephemeral_app_launcher_browsertest.cc
+++ b/chrome/browser/apps/ephemeral_app_launcher_browsertest.cc
@@ -21,6 +21,7 @@
#include "extensions/browser/extension_util.h"
#include "extensions/browser/management_policy.h"
#include "extensions/browser/process_manager.h"
+#include "extensions/browser/test_extension_registry_observer.h"
#include "extensions/test/extension_test_message_listener.h"
using extensions::Extension;
@@ -321,9 +322,8 @@ IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTestDisabled, FeatureDisabled) {
// ephemerally and launched without prompting the user.
IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest,
LaunchAppWithNoPermissionWarnings) {
- content::WindowedNotificationObserver unloaded_signal(
- extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
- content::Source<Profile>(profile()));
+ extensions::TestExtensionRegistryObserver observer(
+ ExtensionRegistry::Get(profile()));
scoped_refptr<EphemeralAppLauncherForTest> launcher(
new EphemeralAppLauncherForTest(kDefaultAppId, profile()));
@@ -334,7 +334,7 @@ IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest,
EXPECT_FALSE(launcher->install_prompt_created());
// Ephemeral apps are unloaded after they stop running.
- unloaded_signal.Wait();
+ observer.WaitForExtensionUnloaded();
// After an app has been installed ephemerally, it can be launched again
// without installing from the web store.
diff --git a/chrome/browser/apps/ephemeral_app_service_browsertest.cc b/chrome/browser/apps/ephemeral_app_service_browsertest.cc
index ea1fce1..137e6e1 100644
--- a/chrome/browser/apps/ephemeral_app_service_browsertest.cc
+++ b/chrome/browser/apps/ephemeral_app_service_browsertest.cc
@@ -10,8 +10,7 @@
#include "content/public/test/test_utils.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
-#include "extensions/browser/notification_types.h"
-#include "extensions/common/manifest.h"
+#include "extensions/browser/test_extension_registry_observer.h"
using extensions::Extension;
using extensions::ExtensionPrefs;
@@ -90,11 +89,10 @@ IN_PROC_BROWSER_TEST_F(EphemeralAppServiceBrowserTest,
prefs->SetLastLaunchTime(active_app_id, active_launch);
// Perform garbage collection.
- content::WindowedNotificationObserver uninstall_signal(
- extensions::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
- content::Source<Profile>(browser()->profile()));
+ extensions::TestExtensionRegistryObserver observer(
+ ExtensionRegistry::Get(browser()->profile()));
GarbageCollectEphemeralApps();
- uninstall_signal.Wait();
+ observer.WaitForExtensionUninstalled();
ExtensionRegistry* registry = ExtensionRegistry::Get(profile());
ASSERT_TRUE(registry);