Index: base/prefs/overlay_user_pref_store_unittest.cc |
diff --git a/base/prefs/overlay_user_pref_store_unittest.cc b/base/prefs/overlay_user_pref_store_unittest.cc |
index 06b4ec989a690081c1dad861528b8df007e9a981..bf5e6a59c4fe7e102591c7c93e04250cf54289c2 100644 |
--- a/base/prefs/overlay_user_pref_store_unittest.cc |
+++ b/base/prefs/overlay_user_pref_store_unittest.cc |
@@ -48,22 +48,22 @@ TEST_F(OverlayUserPrefStoreTest, Observer) { |
overlay_->AddObserver(&obs); |
// Check that underlay first value is reported. |
- underlay_->SetValue(overlay_key, new FundamentalValue(42), |
+ underlay_->SetValue(overlay_key, make_scoped_ptr(new FundamentalValue(42)), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
obs.VerifyAndResetChangedKey(overlay_key); |
// Check that underlay overwriting is reported. |
- underlay_->SetValue(overlay_key, new FundamentalValue(43), |
+ underlay_->SetValue(overlay_key, make_scoped_ptr(new FundamentalValue(43)), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
obs.VerifyAndResetChangedKey(overlay_key); |
// Check that overwriting change in overlay is reported. |
- overlay_->SetValue(overlay_key, new FundamentalValue(44), |
+ overlay_->SetValue(overlay_key, make_scoped_ptr(new FundamentalValue(44)), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
obs.VerifyAndResetChangedKey(overlay_key); |
// Check that hidden underlay change is not reported. |
- underlay_->SetValue(overlay_key, new FundamentalValue(45), |
+ underlay_->SetValue(overlay_key, make_scoped_ptr(new FundamentalValue(45)), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
EXPECT_TRUE(obs.changed_keys.empty()); |
@@ -78,16 +78,17 @@ TEST_F(OverlayUserPrefStoreTest, Observer) { |
obs.VerifyAndResetChangedKey(overlay_key); |
// Check respecting of silence. |
- overlay_->SetValueSilently(overlay_key, new FundamentalValue(46), |
+ overlay_->SetValueSilently(overlay_key, |
+ make_scoped_ptr(new FundamentalValue(46)), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
EXPECT_TRUE(obs.changed_keys.empty()); |
overlay_->RemoveObserver(&obs); |
// Check successful unsubscription. |
- underlay_->SetValue(overlay_key, new FundamentalValue(47), |
+ underlay_->SetValue(overlay_key, make_scoped_ptr(new FundamentalValue(47)), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
- overlay_->SetValue(overlay_key, new FundamentalValue(48), |
+ overlay_->SetValue(overlay_key, make_scoped_ptr(new FundamentalValue(48)), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
EXPECT_TRUE(obs.changed_keys.empty()); |
} |
@@ -97,7 +98,7 @@ TEST_F(OverlayUserPrefStoreTest, GetAndSet) { |
EXPECT_FALSE(overlay_->GetValue(overlay_key, &value)); |
EXPECT_FALSE(underlay_->GetValue(overlay_key, &value)); |
- underlay_->SetValue(overlay_key, new FundamentalValue(42), |
+ underlay_->SetValue(overlay_key, make_scoped_ptr(new FundamentalValue(42)), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
// Value shines through: |
@@ -107,7 +108,7 @@ TEST_F(OverlayUserPrefStoreTest, GetAndSet) { |
EXPECT_TRUE(underlay_->GetValue(overlay_key, &value)); |
EXPECT_TRUE(base::FundamentalValue(42).Equals(value)); |
- overlay_->SetValue(overlay_key, new FundamentalValue(43), |
+ overlay_->SetValue(overlay_key, make_scoped_ptr(new FundamentalValue(43)), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
EXPECT_TRUE(overlay_->GetValue(overlay_key, &value)); |
@@ -129,7 +130,7 @@ TEST_F(OverlayUserPrefStoreTest, GetAndSet) { |
// Check that GetMutableValue does not return the dictionary of the underlay. |
TEST_F(OverlayUserPrefStoreTest, ModifyDictionaries) { |
- underlay_->SetValue(overlay_key, new DictionaryValue, |
+ underlay_->SetValue(overlay_key, make_scoped_ptr(new DictionaryValue), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
Value* modify = NULL; |
@@ -159,12 +160,12 @@ TEST_F(OverlayUserPrefStoreTest, GlobalPref) { |
const Value* value = NULL; |
// Check that underlay first value is reported. |
- underlay_->SetValue(regular_key, new FundamentalValue(42), |
+ underlay_->SetValue(regular_key, make_scoped_ptr(new FundamentalValue(42)), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
obs.VerifyAndResetChangedKey(regular_key); |
// Check that underlay overwriting is reported. |
- underlay_->SetValue(regular_key, new FundamentalValue(43), |
+ underlay_->SetValue(regular_key, make_scoped_ptr(new FundamentalValue(43)), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
obs.VerifyAndResetChangedKey(regular_key); |
@@ -173,7 +174,7 @@ TEST_F(OverlayUserPrefStoreTest, GlobalPref) { |
EXPECT_TRUE(base::FundamentalValue(43).Equals(value)); |
// Check that overwriting change in overlay is reported. |
- overlay_->SetValue(regular_key, new FundamentalValue(44), |
+ overlay_->SetValue(regular_key, make_scoped_ptr(new FundamentalValue(44)), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
obs.VerifyAndResetChangedKey(regular_key); |
@@ -193,16 +194,17 @@ TEST_F(OverlayUserPrefStoreTest, GlobalPref) { |
EXPECT_FALSE(underlay_->GetValue(regular_key, &value)); |
// Check respecting of silence. |
- overlay_->SetValueSilently(regular_key, new FundamentalValue(46), |
+ overlay_->SetValueSilently(regular_key, |
+ make_scoped_ptr(new FundamentalValue(46)), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
EXPECT_TRUE(obs.changed_keys.empty()); |
overlay_->RemoveObserver(&obs); |
// Check successful unsubscription. |
- underlay_->SetValue(regular_key, new FundamentalValue(47), |
+ underlay_->SetValue(regular_key, make_scoped_ptr(new FundamentalValue(47)), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
- overlay_->SetValue(regular_key, new FundamentalValue(48), |
+ overlay_->SetValue(regular_key, make_scoped_ptr(new FundamentalValue(48)), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
EXPECT_TRUE(obs.changed_keys.empty()); |
} |
@@ -216,12 +218,14 @@ TEST_F(OverlayUserPrefStoreTest, NamesMapping) { |
// Check that if there is no override in the overlay, changing underlay value |
// is reported as changing an overlay value. |
- underlay_->SetValue(mapped_underlay_key, new FundamentalValue(42), |
+ underlay_->SetValue(mapped_underlay_key, |
+ make_scoped_ptr(new FundamentalValue(42)), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
obs.VerifyAndResetChangedKey(mapped_overlay_key); |
// Check that underlay overwriting is reported. |
- underlay_->SetValue(mapped_underlay_key, new FundamentalValue(43), |
+ underlay_->SetValue(mapped_underlay_key, |
+ make_scoped_ptr(new FundamentalValue(43)), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
obs.VerifyAndResetChangedKey(mapped_overlay_key); |
@@ -233,7 +237,8 @@ TEST_F(OverlayUserPrefStoreTest, NamesMapping) { |
EXPECT_TRUE(base::FundamentalValue(43).Equals(value)); |
// Check that overwriting change in overlay is reported. |
- overlay_->SetValue(mapped_overlay_key, new FundamentalValue(44), |
+ overlay_->SetValue(mapped_overlay_key, |
+ make_scoped_ptr(new FundamentalValue(44)), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
obs.VerifyAndResetChangedKey(mapped_overlay_key); |
@@ -247,7 +252,8 @@ TEST_F(OverlayUserPrefStoreTest, NamesMapping) { |
EXPECT_TRUE(base::FundamentalValue(43).Equals(value)); |
// Check that hidden underlay change is not reported. |
- underlay_->SetValue(mapped_underlay_key, new FundamentalValue(45), |
+ underlay_->SetValue(mapped_underlay_key, |
+ make_scoped_ptr(new FundamentalValue(45)), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
EXPECT_TRUE(obs.changed_keys.empty()); |
@@ -266,16 +272,19 @@ TEST_F(OverlayUserPrefStoreTest, NamesMapping) { |
EXPECT_FALSE(overlay_->GetValue(mapped_underlay_key, &value)); |
// Check respecting of silence. |
- overlay_->SetValueSilently(mapped_overlay_key, new FundamentalValue(46), |
+ overlay_->SetValueSilently(mapped_overlay_key, |
+ make_scoped_ptr(new FundamentalValue(46)), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
EXPECT_TRUE(obs.changed_keys.empty()); |
overlay_->RemoveObserver(&obs); |
// Check successful unsubscription. |
- underlay_->SetValue(mapped_underlay_key, new FundamentalValue(47), |
+ underlay_->SetValue(mapped_underlay_key, |
+ make_scoped_ptr(new FundamentalValue(47)), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
- overlay_->SetValue(mapped_overlay_key, new FundamentalValue(48), |
+ overlay_->SetValue(mapped_overlay_key, |
+ make_scoped_ptr(new FundamentalValue(48)), |
WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS); |
EXPECT_TRUE(obs.changed_keys.empty()); |
} |