| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |