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

Side by Side Diff: chrome/browser/sync/test/integration/single_client_bookmarks_sync_test.cc

Issue 2461463002: [Sync] Replacing NULL with nullptr/null throughout sync code. (Closed)
Patch Set: Reverted PROFILE_nullptr mistake. Created 4 years, 1 month 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
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 <utility> 5 #include <utility>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/sync/test/integration/bookmarks_helper.h" 10 #include "chrome/browser/sync/test/integration/bookmarks_helper.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 // -> Wired News (www.wired.com) 127 // -> Wired News (www.wired.com)
128 // -> tier2_b 128 // -> tier2_b
129 // -> tier1_b_url0 129 // -> tier1_b_url0
130 // -> tier3_b 130 // -> tier3_b
131 // -> Toronto Maple Leafs (mapleleafs.nhl.com) 131 // -> Toronto Maple Leafs (mapleleafs.nhl.com)
132 // -> Wynn (www.wynnlasvegas.com) 132 // -> Wynn (www.wynnlasvegas.com)
133 // -> tier1_a_url0 133 // -> tier1_a_url0
134 const BookmarkNode* bar = GetBookmarkBarNode(kSingleProfileIndex); 134 const BookmarkNode* bar = GetBookmarkBarNode(kSingleProfileIndex);
135 const BookmarkNode* cnn = AddURL( 135 const BookmarkNode* cnn = AddURL(
136 kSingleProfileIndex, bar, 0, "CNN", GURL("http://www.cnn.com")); 136 kSingleProfileIndex, bar, 0, "CNN", GURL("http://www.cnn.com"));
137 ASSERT_TRUE(cnn != NULL); 137 ASSERT_TRUE(cnn != nullptr);
138 Move(kSingleProfileIndex, tier1_a, bar, 1); 138 Move(kSingleProfileIndex, tier1_a, bar, 1);
139 139
140 // Wait for the bookmark position change to sync. 140 // Wait for the bookmark position change to sync.
141 ASSERT_TRUE( 141 ASSERT_TRUE(
142 UpdatedProgressMarkerChecker(GetSyncService(kSingleProfileIndex)).Wait()); 142 UpdatedProgressMarkerChecker(GetSyncService(kSingleProfileIndex)).Wait());
143 ASSERT_TRUE(ModelMatchesVerifier(kSingleProfileIndex)); 143 ASSERT_TRUE(ModelMatchesVerifier(kSingleProfileIndex));
144 144
145 const BookmarkNode* porsche = AddURL( 145 const BookmarkNode* porsche = AddURL(
146 kSingleProfileIndex, bar, 2, "Porsche", GURL("http://www.porsche.com")); 146 kSingleProfileIndex, bar, 2, "Porsche", GURL("http://www.porsche.com"));
147 // Rearrange stuff in tier1_a. 147 // Rearrange stuff in tier1_a.
148 ASSERT_EQ(tier1_a, tier1_a_url2->parent()); 148 ASSERT_EQ(tier1_a, tier1_a_url2->parent());
149 ASSERT_EQ(tier1_a, tier1_a_url1->parent()); 149 ASSERT_EQ(tier1_a, tier1_a_url1->parent());
150 Move(kSingleProfileIndex, tier1_a_url2, tier1_a, 0); 150 Move(kSingleProfileIndex, tier1_a_url2, tier1_a, 0);
151 Move(kSingleProfileIndex, tier1_a_url1, tier1_a, 2); 151 Move(kSingleProfileIndex, tier1_a_url1, tier1_a, 2);
152 152
153 // Wait for the rearranged hierarchy to sync. 153 // Wait for the rearranged hierarchy to sync.
154 ASSERT_TRUE( 154 ASSERT_TRUE(
155 UpdatedProgressMarkerChecker(GetSyncService(kSingleProfileIndex)).Wait()); 155 UpdatedProgressMarkerChecker(GetSyncService(kSingleProfileIndex)).Wait());
156 ASSERT_TRUE(ModelMatchesVerifier(kSingleProfileIndex)); 156 ASSERT_TRUE(ModelMatchesVerifier(kSingleProfileIndex));
157 157
158 ASSERT_EQ(1, tier1_a_url0->parent()->GetIndexOf(tier1_a_url0)); 158 ASSERT_EQ(1, tier1_a_url0->parent()->GetIndexOf(tier1_a_url0));
159 Move(kSingleProfileIndex, tier1_a_url0, bar, bar->child_count()); 159 Move(kSingleProfileIndex, tier1_a_url0, bar, bar->child_count());
160 const BookmarkNode* boa = AddURL( 160 const BookmarkNode* boa = AddURL(
161 kSingleProfileIndex, bar, bar->child_count(), 161 kSingleProfileIndex, bar, bar->child_count(),
162 "Bank of America", GURL("https://www.bankofamerica.com")); 162 "Bank of America", GURL("https://www.bankofamerica.com"));
163 ASSERT_TRUE(boa != NULL); 163 ASSERT_TRUE(boa != nullptr);
164 Move(kSingleProfileIndex, tier1_a_url0, top, top->child_count()); 164 Move(kSingleProfileIndex, tier1_a_url0, top, top->child_count());
165 const BookmarkNode* bubble = AddURL( 165 const BookmarkNode* bubble = AddURL(
166 kSingleProfileIndex, bar, bar->child_count(), "Seattle Bubble", 166 kSingleProfileIndex, bar, bar->child_count(), "Seattle Bubble",
167 GURL("http://seattlebubble.com")); 167 GURL("http://seattlebubble.com"));
168 ASSERT_TRUE(bubble != NULL); 168 ASSERT_TRUE(bubble != nullptr);
169 const BookmarkNode* wired = AddURL( 169 const BookmarkNode* wired = AddURL(
170 kSingleProfileIndex, bar, 2, "Wired News", GURL("http://www.wired.com")); 170 kSingleProfileIndex, bar, 2, "Wired News", GURL("http://www.wired.com"));
171 const BookmarkNode* tier2_b = AddFolder( 171 const BookmarkNode* tier2_b = AddFolder(
172 kSingleProfileIndex, tier1_b, 0, "tier2_b"); 172 kSingleProfileIndex, tier1_b, 0, "tier2_b");
173 Move(kSingleProfileIndex, tier1_b_url0, tier2_b, 0); 173 Move(kSingleProfileIndex, tier1_b_url0, tier2_b, 0);
174 Move(kSingleProfileIndex, porsche, bar, 0); 174 Move(kSingleProfileIndex, porsche, bar, 0);
175 SetTitle(kSingleProfileIndex, wired, "News Wired"); 175 SetTitle(kSingleProfileIndex, wired, "News Wired");
176 SetTitle(kSingleProfileIndex, porsche, "ICanHazPorsche?"); 176 SetTitle(kSingleProfileIndex, porsche, "ICanHazPorsche?");
177 177
178 // Wait for the title change to sync. 178 // Wait for the title change to sync.
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 ASSERT_EQ(0, CountFoldersWithTitlesMatching(kSingleProfileIndex, title)); 411 ASSERT_EQ(0, CountFoldersWithTitlesMatching(kSingleProfileIndex, title));
412 412
413 ASSERT_TRUE(SetupSync()); 413 ASSERT_TRUE(SetupSync());
414 414
415 ASSERT_EQ(1, CountFoldersWithTitlesMatching(kSingleProfileIndex, title)); 415 ASSERT_EQ(1, CountFoldersWithTitlesMatching(kSingleProfileIndex, title));
416 } 416 }
417 417
418 IN_PROC_BROWSER_TEST_F(SingleClientBookmarksSyncTest, E2E_ONLY(SanitySetup)) { 418 IN_PROC_BROWSER_TEST_F(SingleClientBookmarksSyncTest, E2E_ONLY(SanitySetup)) {
419 ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; 419 ASSERT_TRUE(SetupSync()) << "SetupSync() failed.";
420 } 420 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698