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/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "base/threading/thread_task_runner_handle.h" | 8 #include "base/threading/thread_task_runner_handle.h" |
9 #include "net/url_request/url_request_test_util.h" | 9 #include "net/url_request/url_request_test_util.h" |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 return false; | 55 return false; |
56 | 56 |
57 const std::string& request_str = url_fetcher->upload_data(); | 57 const std::string& request_str = url_fetcher->upload_data(); |
58 ClientCRXListInfoRequest request; | 58 ClientCRXListInfoRequest request; |
59 if (!request.ParseFromString(request_str)) | 59 if (!request.ParseFromString(request_str)) |
60 return false; | 60 return false; |
61 | 61 |
62 std::string id = request.id(); | 62 std::string id = request.id(); |
63 | 63 |
64 ClientCRXListInfoResponse response; | 64 ClientCRXListInfoResponse response; |
65 if (ContainsKey(verdicts_, id)) | 65 if (base::ContainsKey(verdicts_, id)) |
66 response.set_verdict(verdicts_[id]); | 66 response.set_verdict(verdicts_[id]); |
67 else | 67 else |
68 response.set_verdict(ClientCRXListInfoResponse::NOT_IN_BLACKLIST); | 68 response.set_verdict(ClientCRXListInfoResponse::NOT_IN_BLACKLIST); |
69 | 69 |
70 std::string response_str; | 70 std::string response_str; |
71 response.SerializeToString(&response_str); | 71 response.SerializeToString(&response_str); |
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 |