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

Unified Diff: chrome/browser/ui/cocoa/window_size_autosaver_unittest.mm

Issue 6735032: Get rid of PrefService::GetMutableDictionary/GetMutableList (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated license header Created 9 years, 9 months 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/ui/cocoa/window_size_autosaver_unittest.mm
diff --git a/chrome/browser/ui/cocoa/window_size_autosaver_unittest.mm b/chrome/browser/ui/cocoa/window_size_autosaver_unittest.mm
index 09b13f5f1cfe9adec74b2e0aa1153cf1f29eefcf..7b9371794c00556e5542977cc1a30b2ab72f9f62 100644
--- a/chrome/browser/ui/cocoa/window_size_autosaver_unittest.mm
+++ b/chrome/browser/ui/cocoa/window_size_autosaver_unittest.mm
@@ -8,6 +8,7 @@
#include "base/memory/scoped_nsobject.h"
#include "chrome/browser/prefs/pref_service.h"
+#include "chrome/browser/prefs/scoped_user_pref_update.h"
#include "chrome/browser/ui/cocoa/browser_test_helper.h"
#import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -95,7 +96,7 @@ TEST_F(WindowSizeAutosaverTest, RestoresAndSavesPos) {
// ...and it should be in the profile, too.
EXPECT_TRUE(pref->GetDictionary(path_) != NULL);
int x, y;
- DictionaryValue* windowPref = pref->GetMutableDictionary(path_);
+ const DictionaryValue* windowPref = pref->GetDictionary(path_);
EXPECT_FALSE(windowPref->GetInteger("left", &x));
EXPECT_FALSE(windowPref->GetInteger("right", &x));
EXPECT_FALSE(windowPref->GetInteger("top", &x));
@@ -154,7 +155,7 @@ TEST_F(WindowSizeAutosaverTest, RestoresAndSavesRect) {
// ...and it should be in the profile, too.
EXPECT_TRUE(pref->GetDictionary(path_) != NULL);
int x1, y1, x2, y2;
- DictionaryValue* windowPref = pref->GetMutableDictionary(path_);
+ const DictionaryValue* windowPref = pref->GetDictionary(path_);
EXPECT_FALSE(windowPref->GetInteger("x", &x1));
EXPECT_FALSE(windowPref->GetInteger("y", &x1));
ASSERT_TRUE(windowPref->GetInteger("left", &x1));
@@ -172,7 +173,8 @@ TEST_F(WindowSizeAutosaverTest, DoesNotRestoreButClearsEmptyRect) {
PrefService* pref = browser_helper_.profile()->GetPrefs();
ASSERT_TRUE(pref != NULL);
- DictionaryValue* windowPref = pref->GetMutableDictionary(path_);
+ DictionaryPrefUpdate update(pref, path_);
+ DictionaryValue* windowPref = update.Get();
windowPref->SetInteger("left", 50);
windowPref->SetInteger("right", 50);
windowPref->SetInteger("top", 60);

Powered by Google App Engine
This is Rietveld 408576698