| 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 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "chrome/browser/chrome_plugin_service_filter.h" | 10 #include "chrome/browser/chrome_plugin_service_filter.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 net::URLRequest* request, net::NetworkDelegate* network_delegate) const { | 91 net::URLRequest* request, net::NetworkDelegate* network_delegate) const { |
| 92 return new GViewURLRequestTestJob(request, network_delegate); | 92 return new GViewURLRequestTestJob(request, network_delegate); |
| 93 } | 93 } |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 class GViewRequestInterceptorTest : public testing::Test { | 96 class GViewRequestInterceptorTest : public testing::Test { |
| 97 public: | 97 public: |
| 98 GViewRequestInterceptorTest() | 98 GViewRequestInterceptorTest() |
| 99 : ui_thread_(BrowserThread::UI, &message_loop_), | 99 : ui_thread_(BrowserThread::UI, &message_loop_), |
| 100 file_thread_(BrowserThread::FILE, &message_loop_), | 100 file_thread_(BrowserThread::FILE, &message_loop_), |
| 101 io_thread_(BrowserThread::IO, &message_loop_), | 101 io_thread_(BrowserThread::IO, &message_loop_) {} |
| 102 plugin_list_(NULL, 0) {} | |
| 103 | 102 |
| 104 virtual void SetUp() { | 103 virtual void SetUp() { |
| 105 net::URLRequestContext* request_context = | 104 net::URLRequestContext* request_context = |
| 106 resource_context_.GetRequestContext(); | 105 resource_context_.GetRequestContext(); |
| 107 old_factory_ = request_context->job_factory(); | 106 old_factory_ = request_context->job_factory(); |
| 108 job_factory_.SetProtocolHandler("http", new GViewRequestProtocolFactory); | 107 job_factory_.SetProtocolHandler("http", new GViewRequestProtocolFactory); |
| 109 job_factory_.AddInterceptor(new GViewRequestInterceptor); | 108 job_factory_.AddInterceptor(new GViewRequestInterceptor); |
| 110 request_context->set_job_factory(&job_factory_); | 109 request_context->set_job_factory(&job_factory_); |
| 111 plugin_prefs_ = PluginPrefs::GetForTestingProfile(&profile_); | 110 plugin_prefs_ = PluginPrefs::GetForTestingProfile(&profile_); |
| 112 PluginPrefsFactory::GetInstance()->RegisterUserPrefsOnProfile(&profile_); | 111 PluginPrefsFactory::GetInstance()->RegisterUserPrefsOnProfile(&profile_); |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 SetupRequest(&request); | 286 SetupRequest(&request); |
| 288 request.Start(); | 287 request.Start(); |
| 289 MessageLoop::current()->Run(); | 288 MessageLoop::current()->Run(); |
| 290 EXPECT_EQ(0, test_delegate_.received_redirect_count()); | 289 EXPECT_EQ(0, test_delegate_.received_redirect_count()); |
| 291 EXPECT_EQ(GURL(kPdfBlob), request.url()); | 290 EXPECT_EQ(GURL(kPdfBlob), request.url()); |
| 292 } | 291 } |
| 293 | 292 |
| 294 } // namespace | 293 } // namespace |
| 295 | 294 |
| 296 } // namespace chromeos | 295 } // namespace chromeos |
| OLD | NEW |