| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/extensions/test_blacklist_state_fetcher.h" | 5 #include "chrome/browser/extensions/test_blacklist_state_fetcher.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "net/url_request/url_request_test_util.h" | 9 #include "net/url_request/url_request_test_util.h" |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 } | 30 } |
| 31 | 31 |
| 32 } // namespace | 32 } // namespace |
| 33 | 33 |
| 34 TestBlacklistStateFetcher::TestBlacklistStateFetcher( | 34 TestBlacklistStateFetcher::TestBlacklistStateFetcher( |
| 35 BlacklistStateFetcher* fetcher) : fetcher_(fetcher) { | 35 BlacklistStateFetcher* fetcher) : fetcher_(fetcher) { |
| 36 fetcher_->SetSafeBrowsingConfig(CreateSafeBrowsingProtocolConfig()); | 36 fetcher_->SetSafeBrowsingConfig(CreateSafeBrowsingProtocolConfig()); |
| 37 scoped_refptr<net::TestURLRequestContextGetter> context = | 37 scoped_refptr<net::TestURLRequestContextGetter> context = |
| 38 new net::TestURLRequestContextGetter( | 38 new net::TestURLRequestContextGetter( |
| 39 base::MessageLoopProxy::current()); | 39 base::MessageLoopProxy::current()); |
| 40 fetcher_->SetURLRequestContextForTest(context); | 40 fetcher_->SetURLRequestContextForTest(context.get()); |
| 41 } | 41 } |
| 42 | 42 |
| 43 TestBlacklistStateFetcher::~TestBlacklistStateFetcher() { | 43 TestBlacklistStateFetcher::~TestBlacklistStateFetcher() { |
| 44 } | 44 } |
| 45 | 45 |
| 46 void TestBlacklistStateFetcher::SetBlacklistVerdict( | 46 void TestBlacklistStateFetcher::SetBlacklistVerdict( |
| 47 const std::string& id, ClientCRXListInfoResponse_Verdict state) { | 47 const std::string& id, ClientCRXListInfoResponse_Verdict state) { |
| 48 verdicts_[id] = state; | 48 verdicts_[id] = state; |
| 49 } | 49 } |
| 50 | 50 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 72 | 72 |
| 73 url_fetcher->set_status(net::URLRequestStatus()); | 73 url_fetcher->set_status(net::URLRequestStatus()); |
| 74 url_fetcher->set_response_code(200); | 74 url_fetcher->set_response_code(200); |
| 75 url_fetcher->SetResponseString(response_str); | 75 url_fetcher->SetResponseString(response_str); |
| 76 url_fetcher->delegate()->OnURLFetchComplete(url_fetcher); | 76 url_fetcher->delegate()->OnURLFetchComplete(url_fetcher); |
| 77 | 77 |
| 78 return true; | 78 return true; |
| 79 } | 79 } |
| 80 | 80 |
| 81 } // namespace extensions | 81 } // namespace extensions |
| OLD | NEW |