Cleanup extensions unittests to use constant for extensions settings preference
Bug:
Change-Id: I00d7ff48486400e111150cad2b654dd2700a90b6
Reviewed-on: https://chromium-review.googlesource.com/861625
Reviewed-by: Finnur Thorarinsson <[email protected]>
Commit-Queue: Finnur Thorarinsson <[email protected]>
Cr-Commit-Position: refs/heads/master@{#528620}
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index 7de6ea1..3c9a7cf 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -112,6 +112,7 @@
#include "extensions/browser/install_flag.h"
#include "extensions/browser/management_policy.h"
#include "extensions/browser/mock_external_provider.h"
+#include "extensions/browser/pref_names.h"
#include "extensions/browser/test_extension_registry_observer.h"
#include "extensions/browser/test_management_policy.h"
#include "extensions/browser/uninstall_reason.h"
@@ -693,8 +694,8 @@
bool IsPrefExist(const std::string& extension_id,
const std::string& pref_path) {
- const base::DictionaryValue* dict =
- profile()->GetPrefs()->GetDictionary("extensions.settings");
+ const base::DictionaryValue* dict = profile()->GetPrefs()->GetDictionary(
+ extensions::pref_names::kExtensions);
if (dict == NULL) return false;
const base::DictionaryValue* pref = NULL;
if (!dict->GetDictionary(extension_id, &pref)) {
@@ -714,7 +715,8 @@
const std::string& pref_path,
std::unique_ptr<base::Value> value,
const std::string& msg) {
- DictionaryPrefUpdate update(profile()->GetPrefs(), "extensions.settings");
+ DictionaryPrefUpdate update(profile()->GetPrefs(),
+ extensions::pref_names::kExtensions);
base::DictionaryValue* dict = update.Get();
ASSERT_TRUE(dict != NULL) << msg;
base::DictionaryValue* pref = NULL;
@@ -752,7 +754,8 @@
std::string msg = " while clearing: ";
msg += extension_id + " " + pref_path;
- DictionaryPrefUpdate update(profile()->GetPrefs(), "extensions.settings");
+ DictionaryPrefUpdate update(profile()->GetPrefs(),
+ extensions::pref_names::kExtensions);
base::DictionaryValue* dict = update.Get();
ASSERT_TRUE(dict != NULL) << msg;
base::DictionaryValue* pref = NULL;