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

Side by Side Diff: components/sync/syncable/change_record_unittest.cc

Issue 2427803002: [Sync] Replacing NULL with nullptr in code and null in comments for components/sync/ (Closed)
Patch Set: Fixing start of sentence capitlization. Created 4 years, 2 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/sync/syncable/base_transaction.h ('k') | components/sync/syncable/directory.h » ('j') | 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 "components/sync/syncable/change_record.h" 5 #include "components/sync/syncable/change_record.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 void CheckChangeRecordValue(const ChangeRecord& record, 51 void CheckChangeRecordValue(const ChangeRecord& record,
52 const base::DictionaryValue& value) { 52 const base::DictionaryValue& value) {
53 ExpectChangeRecordActionValue(record.action, value, "action"); 53 ExpectChangeRecordActionValue(record.action, value, "action");
54 ExpectDictStringValue(base::Int64ToString(record.id), value, "id"); 54 ExpectDictStringValue(base::Int64ToString(record.id), value, "id");
55 if (record.action == ChangeRecord::ACTION_DELETE) { 55 if (record.action == ChangeRecord::ACTION_DELETE) {
56 std::unique_ptr<base::DictionaryValue> expected_extra_value; 56 std::unique_ptr<base::DictionaryValue> expected_extra_value;
57 if (record.extra.get()) { 57 if (record.extra.get()) {
58 expected_extra_value = record.extra->ToValue(); 58 expected_extra_value = record.extra->ToValue();
59 } 59 }
60 const base::Value* extra_value = NULL; 60 const base::Value* extra_value = nullptr;
61 EXPECT_EQ(record.extra.get() != NULL, value.Get("extra", &extra_value)); 61 EXPECT_EQ(record.extra.get() != nullptr, value.Get("extra", &extra_value));
62 EXPECT_TRUE(base::Value::Equals(extra_value, expected_extra_value.get())); 62 EXPECT_TRUE(base::Value::Equals(extra_value, expected_extra_value.get()));
63 63
64 std::unique_ptr<base::DictionaryValue> expected_specifics_value( 64 std::unique_ptr<base::DictionaryValue> expected_specifics_value(
65 EntitySpecificsToValue(record.specifics)); 65 EntitySpecificsToValue(record.specifics));
66 ExpectDictDictionaryValue(*expected_specifics_value, value, "specifics"); 66 ExpectDictDictionaryValue(*expected_specifics_value, value, "specifics");
67 } 67 }
68 } 68 }
69 69
70 class TestExtraChangeRecordData : public ExtraPasswordChangeRecordData { 70 class TestExtraChangeRecordData : public ExtraPasswordChangeRecordData {
71 public: 71 public:
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 extra->set_expected_to_value_calls(2U); 151 extra->set_expected_to_value_calls(2U);
152 152
153 record.extra.reset(extra.release()); 153 record.extra.reset(extra.release());
154 std::unique_ptr<base::DictionaryValue> value(record.ToValue()); 154 std::unique_ptr<base::DictionaryValue> value(record.ToValue());
155 CheckChangeRecordValue(record, *value); 155 CheckChangeRecordValue(record, *value);
156 } 156 }
157 } 157 }
158 158
159 } // namespace 159 } // namespace
160 } // namespace syncer 160 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/syncable/base_transaction.h ('k') | components/sync/syncable/directory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698