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" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
14 #include "base/time.h" | 14 #include "base/time.h" |
15 #include "chrome/browser/safe_browsing/client_side_detection_service.h" | 15 #include "chrome/browser/safe_browsing/client_side_detection_service.h" |
16 #include "chrome/common/safe_browsing/client_model.pb.h" | 16 #include "chrome/common/safe_browsing/client_model.pb.h" |
17 #include "chrome/common/safe_browsing/csd.pb.h" | 17 #include "chrome/common/safe_browsing/csd.pb.h" |
18 #include "content/test/test_browser_thread.h" | 18 #include "content/public/test/test_browser_thread.h" |
19 #include "content/test/test_url_fetcher_factory.h" | 19 #include "content/test/test_url_fetcher_factory.h" |
20 #include "crypto/sha2.h" | 20 #include "crypto/sha2.h" |
21 #include "googleurl/src/gurl.h" | 21 #include "googleurl/src/gurl.h" |
22 #include "net/url_request/url_request_status.h" | 22 #include "net/url_request/url_request_status.h" |
23 #include "testing/gmock/include/gmock/gmock.h" | 23 #include "testing/gmock/include/gmock/gmock.h" |
24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
25 | 25 |
26 using ::testing::_; | 26 using ::testing::_; |
27 using ::testing::Invoke; | 27 using ::testing::Invoke; |
28 using ::testing::Mock; | 28 using ::testing::Mock; |
(...skipping 627 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 |