| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/browsing_data/core/counters/history_counter.h" | 5 #include "components/browsing_data/core/counters/history_counter.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "chrome/browser/history/history_service_factory.h" | 10 #include "chrome/browser/history/history_service_factory.h" |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 EXPECT_FALSE(HasSyncedVisits()); | 376 EXPECT_FALSE(HasSyncedVisits()); |
| 377 } | 377 } |
| 378 | 378 |
| 379 // Test that the counting restarts when history sync state changes. | 379 // Test that the counting restarts when history sync state changes. |
| 380 // TODO(crbug.com/553421): Enable this test and move it to the | 380 // TODO(crbug.com/553421): Enable this test and move it to the |
| 381 // sync/test/integration directory. | 381 // sync/test/integration directory. |
| 382 IN_PROC_BROWSER_TEST_F(HistoryCounterTest, DISABLED_RestartOnSyncChange) { | 382 IN_PROC_BROWSER_TEST_F(HistoryCounterTest, DISABLED_RestartOnSyncChange) { |
| 383 // Set up the Sync client. | 383 // Set up the Sync client. |
| 384 ASSERT_TRUE(SetupClients()); | 384 ASSERT_TRUE(SetupClients()); |
| 385 static const int kFirstProfileIndex = 0; | 385 static const int kFirstProfileIndex = 0; |
| 386 ProfileSyncService* sync_service = GetSyncService(kFirstProfileIndex); | 386 browser_sync::ProfileSyncService* sync_service = |
| 387 GetSyncService(kFirstProfileIndex); |
| 387 Profile* profile = GetProfile(kFirstProfileIndex); | 388 Profile* profile = GetProfile(kFirstProfileIndex); |
| 388 | 389 |
| 389 // Set up the fake web history service and the counter. | 390 // Set up the fake web history service and the counter. |
| 390 | 391 |
| 391 browsing_data::HistoryCounter counter( | 392 browsing_data::HistoryCounter counter( |
| 392 GetHistoryService(), | 393 GetHistoryService(), |
| 393 base::Bind(&HistoryCounterTest::GetFakeWebHistoryService, | 394 base::Bind(&HistoryCounterTest::GetFakeWebHistoryService, |
| 394 base::Unretained(this), | 395 base::Unretained(this), |
| 395 base::Unretained(profile), | 396 base::Unretained(profile), |
| 396 true), | 397 true), |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 // history deletion did not change. However, in reality we can get two | 452 // history deletion did not change. However, in reality we can get two |
| 452 // notifications, one that history sync has stopped and another that it is | 453 // notifications, one that history sync has stopped and another that it is |
| 453 // active again. | 454 // active again. |
| 454 | 455 |
| 455 // Stopping the Sync service triggers a restart. | 456 // Stopping the Sync service triggers a restart. |
| 456 sync_service->RequestStop(sync_driver::SyncService::CLEAR_DATA); | 457 sync_service->RequestStop(sync_driver::SyncService::CLEAR_DATA); |
| 457 WaitForCountingOrConfirmFinished(); | 458 WaitForCountingOrConfirmFinished(); |
| 458 } | 459 } |
| 459 | 460 |
| 460 } // namespace | 461 } // namespace |
| OLD | NEW |