| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/task.h" | 13 #include "base/task.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/browser/browser_thread.h" | 18 #include "content/browser/browser_thread.h" |
| 19 #include "content/common/net/url_fetcher.h" | |
| 20 #include "content/test/test_url_fetcher_factory.h" | 19 #include "content/test/test_url_fetcher_factory.h" |
| 21 #include "crypto/sha2.h" | 20 #include "crypto/sha2.h" |
| 22 #include "googleurl/src/gurl.h" | 21 #include "googleurl/src/gurl.h" |
| 23 #include "net/url_request/url_request_status.h" | 22 #include "net/url_request/url_request_status.h" |
| 24 #include "testing/gmock/include/gmock/gmock.h" | 23 #include "testing/gmock/include/gmock/gmock.h" |
| 25 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
| 26 | 25 |
| 27 using ::testing::_; | 26 using ::testing::_; |
| 28 using ::testing::Invoke; | 27 using ::testing::Invoke; |
| 29 using ::testing::Mock; | 28 using ::testing::Mock; |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 EXPECT_TRUE(ClientSideDetectionService::IsFalsePositiveResponse( | 685 EXPECT_TRUE(ClientSideDetectionService::IsFalsePositiveResponse( |
| 687 url, response)); | 686 url, response)); |
| 688 | 687 |
| 689 // If an entry in the whitelist matches the URL it should return true. | 688 // If an entry in the whitelist matches the URL it should return true. |
| 690 response.clear_whitelist_expression(); | 689 response.clear_whitelist_expression(); |
| 691 response.add_whitelist_expression("www.google.com/a/b.html"); | 690 response.add_whitelist_expression("www.google.com/a/b.html"); |
| 692 EXPECT_TRUE(ClientSideDetectionService::IsFalsePositiveResponse( | 691 EXPECT_TRUE(ClientSideDetectionService::IsFalsePositiveResponse( |
| 693 url, response)); | 692 url, response)); |
| 694 } | 693 } |
| 695 } // namespace safe_browsing | 694 } // namespace safe_browsing |
| OLD | NEW |