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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/pickle.h" | 8 #include "base/pickle.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "chrome/browser/history/history.h" | 10 #include "chrome/browser/history/history.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 std::string empty; | 116 std::string empty; |
117 WriteToEntry(cache, kMalwareURL, kMalwareHeaders, kMalwareData); | 117 WriteToEntry(cache, kMalwareURL, kMalwareHeaders, kMalwareData); |
118 WriteToEntry(cache, kLandingURL, kLandingHeaders, kLandingData); | 118 WriteToEntry(cache, kLandingURL, kLandingHeaders, kLandingData); |
119 } | 119 } |
120 | 120 |
121 void QuitUIMessageLoop() { | 121 void QuitUIMessageLoop() { |
122 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 122 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
123 BrowserThread::PostTask(BrowserThread::UI, | 123 BrowserThread::PostTask(BrowserThread::UI, |
124 FROM_HERE, | 124 FROM_HERE, |
125 new MessageLoop::QuitTask()); | 125 MessageLoop::QuitClosure()); |
126 } | 126 } |
127 | 127 |
128 // Lets us provide a MockURLRequestContext with an HTTP Cache we pre-populate. | 128 // Lets us provide a MockURLRequestContext with an HTTP Cache we pre-populate. |
129 // Also exposes the constructor. | 129 // Also exposes the constructor. |
130 class MalwareDetailsWrap : public MalwareDetails { | 130 class MalwareDetailsWrap : public MalwareDetails { |
131 public: | 131 public: |
132 MalwareDetailsWrap(SafeBrowsingService* sb_service, | 132 MalwareDetailsWrap(SafeBrowsingService* sb_service, |
133 TabContents* tab_contents, | 133 TabContents* tab_contents, |
134 const SafeBrowsingService::UnsafeResource& unsafe_resource, | 134 const SafeBrowsingService::UnsafeResource& unsafe_resource, |
135 net::URLRequestContextGetter* request_context_getter) | 135 net::URLRequestContextGetter* request_context_getter) |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 pb_resource = expected.add_resources(); | 679 pb_resource = expected.add_resources(); |
680 pb_resource->set_id(2); | 680 pb_resource->set_id(2); |
681 pb_resource->set_parent_id(3); | 681 pb_resource->set_parent_id(3); |
682 pb_resource->set_url(kSecondRedirectURL); | 682 pb_resource->set_url(kSecondRedirectURL); |
683 pb_resource = expected.add_resources(); | 683 pb_resource = expected.add_resources(); |
684 pb_resource->set_id(3); | 684 pb_resource->set_id(3); |
685 pb_resource->set_url(kFirstRedirectURL); | 685 pb_resource->set_url(kFirstRedirectURL); |
686 | 686 |
687 VerifyResults(actual, expected); | 687 VerifyResults(actual, expected); |
688 } | 688 } |
OLD | NEW |