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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 class MockSafeBrowsingUIManager : public SafeBrowsingUIManager { | 131 class MockSafeBrowsingUIManager : public SafeBrowsingUIManager { |
132 public: | 132 public: |
133 explicit MockSafeBrowsingUIManager(SafeBrowsingService* service) | 133 explicit MockSafeBrowsingUIManager(SafeBrowsingService* service) |
134 : SafeBrowsingUIManager(service) { } | 134 : SafeBrowsingUIManager(service) { } |
135 | 135 |
136 MOCK_METHOD1(DisplayBlockingPage, void(const UnsafeResource& resource)); | 136 MOCK_METHOD1(DisplayBlockingPage, void(const UnsafeResource& resource)); |
137 | 137 |
138 // Helper function which calls OnBlockingPageComplete for this client | 138 // Helper function which calls OnBlockingPageComplete for this client |
139 // object. | 139 // object. |
140 void InvokeOnBlockingPageComplete(const UrlCheckCallback& callback) { | 140 void InvokeOnBlockingPageComplete(const UrlCheckCallback& callback) { |
141 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 141 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
142 // Note: this will delete the client object in the case of the CsdClient | 142 // Note: this will delete the client object in the case of the CsdClient |
143 // implementation. | 143 // implementation. |
144 if (!callback.is_null()) | 144 if (!callback.is_null()) |
145 callback.Run(false); | 145 callback.Run(false); |
146 } | 146 } |
147 | 147 |
148 protected: | 148 protected: |
149 virtual ~MockSafeBrowsingUIManager() { } | 149 virtual ~MockSafeBrowsingUIManager() { } |
150 | 150 |
151 private: | 151 private: |
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 EXPECT_EQ(url, resource.url); | 1141 EXPECT_EQ(url, resource.url); |
1142 EXPECT_EQ(url, resource.original_url); | 1142 EXPECT_EQ(url, resource.original_url); |
1143 | 1143 |
1144 ExpectStartPhishingDetection(NULL); | 1144 ExpectStartPhishingDetection(NULL); |
1145 | 1145 |
1146 // Showing a phishing warning will invalidate all the weak pointers which | 1146 // Showing a phishing warning will invalidate all the weak pointers which |
1147 // means we will not extract malware features. | 1147 // means we will not extract malware features. |
1148 ExpectShouldClassifyForMalwareResult(false); | 1148 ExpectShouldClassifyForMalwareResult(false); |
1149 } | 1149 } |
1150 } // namespace safe_browsing | 1150 } // namespace safe_browsing |
OLD | NEW |