Index: chrome/browser/extensions/extension_management_browsertest.cc |
diff --git a/chrome/browser/extensions/extension_management_browsertest.cc b/chrome/browser/extensions/extension_management_browsertest.cc |
index ffde5930a3aecda865f56c49bc78a4a64fa77ec4..1e8b11fe4dcb5e2e7de0a4a7cd2d385b82c5768b 100644 |
--- a/chrome/browser/extensions/extension_management_browsertest.cc |
+++ b/chrome/browser/extensions/extension_management_browsertest.cc |
@@ -11,6 +11,7 @@ |
#include "chrome/browser/extensions/extension_updater.h" |
#include "chrome/browser/prefs/pref_notifier.h" |
#include "chrome/browser/prefs/pref_service.h" |
+#include "chrome/browser/prefs/scoped_pref_update.h" |
#include "chrome/browser/profile.h" |
#include "chrome/browser/renderer_host/render_view_host.h" |
#include "chrome/browser/ui/browser.h" |
@@ -337,14 +338,16 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementTest, ExternalPolicyRefresh) { |
ASSERT_TRUE(service->disabled_extensions()->empty()); |
// Set the policy as a user preference and fire notification observers. |
- PrefService* prefs = browser()->profile()->GetPrefs(); |
- ListValue* forcelist = |
- prefs->GetMutableList(prefs::kExtensionInstallForceList); |
- ASSERT_TRUE(forcelist->empty()); |
- forcelist->Append(Value::CreateStringValue( |
- "ogjcoiohnmldgjemafoockdghcjciccf;" |
- "http://localhost/autoupdate/manifest")); |
- prefs->pref_notifier()->FireObservers(prefs::kExtensionInstallForceList); |
+ { |
+ PrefService* prefs = browser()->profile()->GetPrefs(); |
+ ScopedPrefUpdate pref_update(prefs, prefs::kExtensionInstallForceList); |
+ ListValue* forcelist = |
+ prefs->GetMutableList(prefs::kExtensionInstallForceList); |
+ ASSERT_TRUE(forcelist->empty()); |
+ forcelist->Append(Value::CreateStringValue( |
+ "ogjcoiohnmldgjemafoockdghcjciccf;" |
+ "http://localhost/autoupdate/manifest")); |
+ } |
// Check if the extension got installed. |
ASSERT_TRUE(WaitForExtensionInstall()); |