OLD | NEW |
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 <map> | 5 #include <map> |
6 #include <queue> | 6 #include <queue> |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 } | 58 } |
59 | 59 |
60 } // namespace | 60 } // namespace |
61 | 61 |
62 class ClientSideDetectionServiceTest : public testing::Test { | 62 class ClientSideDetectionServiceTest : public testing::Test { |
63 protected: | 63 protected: |
64 virtual void SetUp() { | 64 virtual void SetUp() { |
65 file_thread_.reset(new content::TestBrowserThread(BrowserThread::FILE, | 65 file_thread_.reset(new content::TestBrowserThread(BrowserThread::FILE, |
66 &msg_loop_)); | 66 &msg_loop_)); |
67 | 67 |
68 factory_.reset(new net::FakeURLFetcherFactory()); | 68 factory_.reset(new net::FakeURLFetcherFactory(NULL)); |
69 | 69 |
70 browser_thread_.reset(new content::TestBrowserThread(BrowserThread::UI, | 70 browser_thread_.reset(new content::TestBrowserThread(BrowserThread::UI, |
71 &msg_loop_)); | 71 &msg_loop_)); |
72 } | 72 } |
73 | 73 |
74 virtual void TearDown() { | 74 virtual void TearDown() { |
75 msg_loop_.RunUntilIdle(); | 75 msg_loop_.RunUntilIdle(); |
76 csd_service_.reset(); | 76 csd_service_.reset(); |
77 file_thread_.reset(); | 77 file_thread_.reset(); |
78 browser_thread_.reset(); | 78 browser_thread_.reset(); |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 EXPECT_CALL(*service, ScheduleFetchModel(_)) | 656 EXPECT_CALL(*service, ScheduleFetchModel(_)) |
657 .WillOnce(Invoke(service, &MockClientSideDetectionService::Schedule)); | 657 .WillOnce(Invoke(service, &MockClientSideDetectionService::Schedule)); |
658 EXPECT_CALL(*service, EndFetchModel( | 658 EXPECT_CALL(*service, EndFetchModel( |
659 ClientSideDetectionService::MODEL_NOT_CHANGED)) | 659 ClientSideDetectionService::MODEL_NOT_CHANGED)) |
660 .WillOnce(Invoke(service, &MockClientSideDetectionService::Disable)); | 660 .WillOnce(Invoke(service, &MockClientSideDetectionService::Disable)); |
661 csd_service_->SetEnabledAndRefreshState(true); | 661 csd_service_->SetEnabledAndRefreshState(true); |
662 EXPECT_FALSE(SendClientReportPhishingRequest(GURL("http://a.com/"), 0.4f)); | 662 EXPECT_FALSE(SendClientReportPhishingRequest(GURL("http://a.com/"), 0.4f)); |
663 Mock::VerifyAndClearExpectations(service); | 663 Mock::VerifyAndClearExpectations(service); |
664 } | 664 } |
665 } // namespace safe_browsing | 665 } // namespace safe_browsing |
OLD | NEW |