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

Side by Side Diff: ios/chrome/test/app/sync_test_util.mm

Issue 2803463003: [Sync] Use un-expired time for testing (Closed)
Patch Set: add fix back Created 3 years, 8 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 | « ios/chrome/browser/ui/sync/sync_fake_server_egtest.mm ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #import "ios/chrome/test/app/sync_test_util.h" 5 #import "ios/chrome/test/app/sync_test_util.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 return result == testing::AssertionSuccess(); 242 return result == testing::AssertionSuccess();
243 } 243 }
244 244
245 void AddTypedURLOnClient(const GURL& url) { 245 void AddTypedURLOnClient(const GURL& url) {
246 ios::ChromeBrowserState* browser_state = 246 ios::ChromeBrowserState* browser_state =
247 chrome_test_util::GetOriginalBrowserState(); 247 chrome_test_util::GetOriginalBrowserState();
248 history::HistoryService* historyService = 248 history::HistoryService* historyService =
249 ios::HistoryServiceFactory::GetForBrowserState( 249 ios::HistoryServiceFactory::GetForBrowserState(
250 browser_state, ServiceAccessType::EXPLICIT_ACCESS); 250 browser_state, ServiceAccessType::EXPLICIT_ACCESS);
251 251
252 historyService->AddPage(url, base::Time::UnixEpoch(), nullptr, 1, GURL(), 252 historyService->AddPage(url, base::Time::Now(), nullptr, 1, GURL(),
253 history::RedirectList(), ui::PAGE_TRANSITION_TYPED, 253 history::RedirectList(), ui::PAGE_TRANSITION_TYPED,
254 history::SOURCE_BROWSED, false); 254 history::SOURCE_BROWSED, false);
255 } 255 }
256 256
257 void InjectTypedURLOnFakeSyncServer(const std::string& url) { 257 void InjectTypedURLOnFakeSyncServer(const std::string& url) {
258 DCHECK(gSyncFakeServer); 258 DCHECK(gSyncFakeServer);
259 sync_pb::EntitySpecifics entitySpecifics; 259 sync_pb::EntitySpecifics entitySpecifics;
260 sync_pb::TypedUrlSpecifics* typedUrl = entitySpecifics.mutable_typed_url(); 260 sync_pb::TypedUrlSpecifics* typedUrl = entitySpecifics.mutable_typed_url();
261 typedUrl->set_url(url); 261 typedUrl->set_url(url);
262 typedUrl->set_title(url); 262 typedUrl->set_title(url);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 } 342 }
343 } 343 }
344 if (!entity_id.empty()) { 344 if (!entity_id.empty()) {
345 std::unique_ptr<fake_server::FakeServerEntity> entity; 345 std::unique_ptr<fake_server::FakeServerEntity> entity;
346 entity = fake_server::TombstoneEntity::Create(entity_id, std::string()); 346 entity = fake_server::TombstoneEntity::Create(entity_id, std::string());
347 gSyncFakeServer->InjectEntity(std::move(entity)); 347 gSyncFakeServer->InjectEntity(std::move(entity));
348 } 348 }
349 } 349 }
350 350
351 } // namespace chrome_test_util 351 } // namespace chrome_test_util
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/sync/sync_fake_server_egtest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698