| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/extensions/extension_info_map.h" | 10 #include "chrome/browser/extensions/extension_info_map.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 } | 94 } |
| 95 | 95 |
| 96 void StartRequest(net::URLRequest* request, | 96 void StartRequest(net::URLRequest* request, |
| 97 ResourceType::Type resource_type) { | 97 ResourceType::Type resource_type) { |
| 98 content::ResourceRequestInfo::AllocateForTesting(request, | 98 content::ResourceRequestInfo::AllocateForTesting(request, |
| 99 resource_type, | 99 resource_type, |
| 100 &resource_context_, | 100 &resource_context_, |
| 101 -1, | 101 -1, |
| 102 -1); | 102 -1); |
| 103 request->Start(); | 103 request->Start(); |
| 104 MessageLoop::current()->Run(); | 104 base::MessageLoop::current()->Run(); |
| 105 } | 105 } |
| 106 | 106 |
| 107 protected: | 107 protected: |
| 108 MessageLoopForIO message_loop_; | 108 base::MessageLoopForIO message_loop_; |
| 109 content::TestBrowserThread ui_thread_; | 109 content::TestBrowserThread ui_thread_; |
| 110 content::TestBrowserThread file_thread_; | 110 content::TestBrowserThread file_thread_; |
| 111 content::TestBrowserThread io_thread_; | 111 content::TestBrowserThread io_thread_; |
| 112 scoped_refptr<ExtensionInfoMap> extension_info_map_; | 112 scoped_refptr<ExtensionInfoMap> extension_info_map_; |
| 113 net::URLRequestJobFactoryImpl job_factory_; | 113 net::URLRequestJobFactoryImpl job_factory_; |
| 114 const net::URLRequestJobFactory* old_factory_; | 114 const net::URLRequestJobFactory* old_factory_; |
| 115 net::TestDelegate test_delegate_; | 115 net::TestDelegate test_delegate_; |
| 116 content::MockResourceContext resource_context_; | 116 content::MockResourceContext resource_context_; |
| 117 }; | 117 }; |
| 118 | 118 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 { | 210 { |
| 211 net::URLRequest request(extension->GetResourceURL("webstore_icon_16.png"), | 211 net::URLRequest request(extension->GetResourceURL("webstore_icon_16.png"), |
| 212 &test_delegate_, | 212 &test_delegate_, |
| 213 resource_context_.GetRequestContext()); | 213 resource_context_.GetRequestContext()); |
| 214 StartRequest(&request, ResourceType::MEDIA); | 214 StartRequest(&request, ResourceType::MEDIA); |
| 215 EXPECT_EQ(net::URLRequestStatus::SUCCESS, request.status().status()); | 215 EXPECT_EQ(net::URLRequestStatus::SUCCESS, request.status().status()); |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 | 218 |
| 219 } // namespace extensions | 219 } // namespace extensions |
| OLD | NEW |