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

Side by Side Diff: components/prefs/pref_service_unittest.cc

Issue 2773513002: Stop passing raw pointers to DictionaryValue::Set, part 1 (Closed)
Patch Set: Fix compilation Created 3 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 unified diff | Download patch
« no previous file with comments | « components/prefs/pref_service.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 EXPECT_EQ(entry.write_flags, flag_checker->GetLastFlagsAndClear()); 323 EXPECT_EQ(entry.write_flags, flag_checker->GetLastFlagsAndClear());
324 324
325 prefs->ReportUserPrefChanged(entry.pref_name); 325 prefs->ReportUserPrefChanged(entry.pref_name);
326 EXPECT_TRUE(flag_checker->last_write_flags_set()); 326 EXPECT_TRUE(flag_checker->last_write_flags_set());
327 EXPECT_EQ(entry.write_flags, flag_checker->GetLastFlagsAndClear()); 327 EXPECT_EQ(entry.write_flags, flag_checker->GetLastFlagsAndClear());
328 328
329 prefs->ClearPref(entry.pref_name); 329 prefs->ClearPref(entry.pref_name);
330 EXPECT_TRUE(flag_checker->last_write_flags_set()); 330 EXPECT_TRUE(flag_checker->last_write_flags_set());
331 EXPECT_EQ(entry.write_flags, flag_checker->GetLastFlagsAndClear()); 331 EXPECT_EQ(entry.write_flags, flag_checker->GetLastFlagsAndClear());
332 332
333 prefs->SetUserPrefValue(entry.pref_name, new base::DictionaryValue()); 333 prefs->SetUserPrefValue(entry.pref_name,
334 base::MakeUnique<base::DictionaryValue>());
334 EXPECT_TRUE(flag_checker->last_write_flags_set()); 335 EXPECT_TRUE(flag_checker->last_write_flags_set());
335 EXPECT_EQ(entry.write_flags, flag_checker->GetLastFlagsAndClear()); 336 EXPECT_EQ(entry.write_flags, flag_checker->GetLastFlagsAndClear());
336 } 337 }
337 } 338 }
338 339
339 class PrefServiceSetValueTest : public testing::Test { 340 class PrefServiceSetValueTest : public testing::Test {
340 protected: 341 protected:
341 static const char kName[]; 342 static const char kName[];
342 static const char kValue[]; 343 static const char kValue[];
343 344
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 419
419 EXPECT_CALL(observer_, OnPreferenceChanged(_)).Times(0); 420 EXPECT_CALL(observer_, OnPreferenceChanged(_)).Times(0);
420 prefs_.Set(kName, new_value); 421 prefs_.Set(kName, new_value);
421 Mock::VerifyAndClearExpectations(&observer_); 422 Mock::VerifyAndClearExpectations(&observer_);
422 423
423 base::ListValue empty; 424 base::ListValue empty;
424 observer_.Expect(kName, &empty); 425 observer_.Expect(kName, &empty);
425 prefs_.Set(kName, empty); 426 prefs_.Set(kName, empty);
426 Mock::VerifyAndClearExpectations(&observer_); 427 Mock::VerifyAndClearExpectations(&observer_);
427 } 428 }
OLDNEW
« no previous file with comments | « components/prefs/pref_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698