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 16 matching lines...) Expand all Loading... |
27 #include "url/gurl.h" | 27 #include "url/gurl.h" |
28 | 28 |
29 namespace { | 29 namespace { |
30 | 30 |
31 using browsing_data::BrowsingDataCounter; | 31 using browsing_data::BrowsingDataCounter; |
32 using browsing_data::HistoryCounter; | 32 using browsing_data::HistoryCounter; |
33 | 33 |
34 class HistoryCounterTest : public InProcessBrowserTest { | 34 class HistoryCounterTest : public InProcessBrowserTest { |
35 public: | 35 public: |
36 HistoryCounterTest() {} | 36 HistoryCounterTest() {} |
37 ~HistoryCounterTest() override {}; | 37 ~HistoryCounterTest() override {} |
38 | 38 |
39 void SetUpOnMainThread() override { | 39 void SetUpOnMainThread() override { |
40 time_ = base::Time::Now(); | 40 time_ = base::Time::Now(); |
41 history_service_ = HistoryServiceFactory::GetForProfileWithoutCreating( | 41 history_service_ = HistoryServiceFactory::GetForProfileWithoutCreating( |
42 browser()->profile()); | 42 browser()->profile()); |
43 fake_web_history_service_.reset(new history::FakeWebHistoryService( | 43 fake_web_history_service_.reset(new history::FakeWebHistoryService( |
44 ProfileOAuth2TokenServiceFactory::GetForProfile(browser()->profile()), | 44 ProfileOAuth2TokenServiceFactory::GetForProfile(browser()->profile()), |
45 SigninManagerFactory::GetForProfile(browser()->profile()), | 45 SigninManagerFactory::GetForProfile(browser()->profile()), |
46 browser()->profile()->GetRequestContext())); | 46 browser()->profile()->GetRequestContext())); |
47 | 47 |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 // Nonzero local count, empty sync. | 350 // Nonzero local count, empty sync. |
351 service->ClearSyncedVisits(); | 351 service->ClearSyncedVisits(); |
352 service->SetupFakeResponse(true /* success */, net::HTTP_OK); | 352 service->SetupFakeResponse(true /* success */, net::HTTP_OK); |
353 counter.Restart(); | 353 counter.Restart(); |
354 WaitForCounting(); | 354 WaitForCounting(); |
355 EXPECT_EQ(2u, GetLocalResult()); | 355 EXPECT_EQ(2u, GetLocalResult()); |
356 EXPECT_FALSE(HasSyncedVisits()); | 356 EXPECT_FALSE(HasSyncedVisits()); |
357 } | 357 } |
358 | 358 |
359 } // namespace | 359 } // namespace |
OLD | NEW |