From 6ab4c2faad61e90e29fc9333b0240d323267a020 Mon Sep 17 00:00:00 2001 From: limasdf Date: Tue, 31 Mar 2015 09:19:54 -0700 Subject: [PATCH] cleanup/ Remove deprecated extension notification from policy_browsertest.cc BUG=411568 TEST=browser_tests --gtest_filter=PolicyTest.* Review URL: https://codereview.chromium.org/1024563002 Cr-Commit-Position: refs/heads/master@{#323051} --- chrome/browser/policy/policy_browsertest.cc | 36 +++++++++++++++++------------ 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc index 103d5902df88..902e514f3152 100644 --- a/chrome/browser/policy/policy_browsertest.cc +++ b/chrome/browser/policy/policy_browsertest.cc @@ -740,26 +740,32 @@ class PolicyTest : public InProcessBrowserTest { } void UninstallExtension(const std::string& id, bool expect_success) { - content::WindowedNotificationObserver observer( - expect_success - ? extensions::NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED - : extensions::NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED, - content::NotificationService::AllSources()); - extension_service()->UninstallExtension( - id, - extensions::UNINSTALL_REASON_FOR_TESTING, - base::Bind(&base::DoNothing), - NULL); - observer.Wait(); + if (expect_success) { + extensions::TestExtensionRegistryObserver observer( + extensions::ExtensionRegistry::Get(browser()->profile())); + extension_service()->UninstallExtension( + id, extensions::UNINSTALL_REASON_FOR_TESTING, + base::Bind(&base::DoNothing), NULL); + observer.WaitForExtensionUninstalled(); + } else { + content::WindowedNotificationObserver observer( + extensions::NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED, + content::NotificationService::AllSources()); + extension_service()->UninstallExtension( + id, + extensions::UNINSTALL_REASON_FOR_TESTING, + base::Bind(&base::DoNothing), + NULL); + observer.Wait(); + } } void DisableExtension(const std::string& id) { - content::WindowedNotificationObserver observer( - extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, - content::NotificationService::AllSources()); + extensions::TestExtensionRegistryObserver observer( + extensions::ExtensionRegistry::Get(browser()->profile())); extension_service()->DisableExtension(id, extensions::Extension::DISABLE_NONE); - observer.Wait(); + observer.WaitForExtensionUnloaded(); } void UpdateProviderPolicy(const PolicyMap& policy) { -- 2.11.4.GIT