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

Unified Diff: chrome/browser/extensions/extension_management_browsertest.cc

Issue 5441002: Clean up pref change notification handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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());
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_pref_store.h » ('j') | chrome/browser/extensions/extension_pref_store.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698