| 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" |
| 11 #include "chrome/browser/chromeos/gview_request_interceptor.h" | 11 #include "chrome/browser/chromeos/gview_request_interceptor.h" |
| 12 #include "chrome/browser/plugin_prefs.h" | 12 #include "chrome/browser/plugin_prefs.h" |
| 13 #include "chrome/browser/plugin_prefs_factory.h" | 13 #include "chrome/browser/plugin_prefs_factory.h" |
| 14 #include "chrome/common/chrome_paths.h" | 14 #include "chrome/common/chrome_paths.h" |
| 15 #include "chrome/test/base/testing_pref_service.h" | 15 #include "chrome/test/base/testing_pref_service.h" |
| 16 #include "content/public/browser/plugin_service.h" | 16 #include "content/public/browser/plugin_service.h" |
| 17 #include "content/public/browser/resource_request_info.h" | 17 #include "content/public/browser/resource_request_info.h" |
| 18 #include "content/public/test/mock_resource_context.h" | 18 #include "content/public/test/mock_resource_context.h" |
| 19 #include "content/public/test/test_browser_thread.h" | 19 #include "content/public/test/test_browser_thread.h" |
| 20 #include "net/base/load_flags.h" | 20 #include "net/base/load_flags.h" |
| 21 #include "net/url_request/url_request.h" | 21 #include "net/url_request/url_request.h" |
| 22 #include "net/url_request/url_request_job.h" | 22 #include "net/url_request/url_request_job.h" |
| 23 #include "net/url_request/url_request_job_factory.h" | 23 #include "net/url_request/url_request_job_factory.h" |
| 24 #include "net/url_request/url_request_job_factory_impl.h" |
| 24 #include "net/url_request/url_request_test_job.h" | 25 #include "net/url_request/url_request_test_job.h" |
| 25 #include "net/url_request/url_request_test_util.h" | 26 #include "net/url_request/url_request_test_util.h" |
| 26 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
| 27 #include "webkit/plugins/npapi/mock_plugin_list.h" | 28 #include "webkit/plugins/npapi/mock_plugin_list.h" |
| 28 | 29 |
| 29 using content::BrowserThread; | 30 using content::BrowserThread; |
| 30 using content::PluginService; | 31 using content::PluginService; |
| 31 | 32 |
| 32 namespace chromeos { | 33 namespace chromeos { |
| 33 | 34 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 169 |
| 169 protected: | 170 protected: |
| 170 base::ShadowingAtExitManager at_exit_manager_; // Deletes PluginService. | 171 base::ShadowingAtExitManager at_exit_manager_; // Deletes PluginService. |
| 171 MessageLoopForIO message_loop_; | 172 MessageLoopForIO message_loop_; |
| 172 content::TestBrowserThread ui_thread_; | 173 content::TestBrowserThread ui_thread_; |
| 173 content::TestBrowserThread file_thread_; | 174 content::TestBrowserThread file_thread_; |
| 174 content::TestBrowserThread io_thread_; | 175 content::TestBrowserThread io_thread_; |
| 175 webkit::npapi::MockPluginList plugin_list_; | 176 webkit::npapi::MockPluginList plugin_list_; |
| 176 TestingPrefService prefs_; | 177 TestingPrefService prefs_; |
| 177 scoped_refptr<PluginPrefs> plugin_prefs_; | 178 scoped_refptr<PluginPrefs> plugin_prefs_; |
| 178 net::URLRequestJobFactory job_factory_; | 179 net::URLRequestJobFactoryImpl job_factory_; |
| 179 const net::URLRequestJobFactory* old_factory_; | 180 const net::URLRequestJobFactory* old_factory_; |
| 180 TestDelegate test_delegate_; | 181 TestDelegate test_delegate_; |
| 181 FilePath pdf_path_; | 182 FilePath pdf_path_; |
| 182 content::MockResourceContext resource_context_; | 183 content::MockResourceContext resource_context_; |
| 183 }; | 184 }; |
| 184 | 185 |
| 185 TEST_F(GViewRequestInterceptorTest, DoNotInterceptHtml) { | 186 TEST_F(GViewRequestInterceptorTest, DoNotInterceptHtml) { |
| 186 net::URLRequest request( | 187 net::URLRequest request( |
| 187 GURL(kHtmlUrl), &test_delegate_, resource_context_.GetRequestContext()); | 188 GURL(kHtmlUrl), &test_delegate_, resource_context_.GetRequestContext()); |
| 188 SetupRequest(&request); | 189 SetupRequest(&request); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 SetupRequest(&request); | 280 SetupRequest(&request); |
| 280 request.Start(); | 281 request.Start(); |
| 281 MessageLoop::current()->Run(); | 282 MessageLoop::current()->Run(); |
| 282 EXPECT_EQ(0, test_delegate_.received_redirect_count()); | 283 EXPECT_EQ(0, test_delegate_.received_redirect_count()); |
| 283 EXPECT_EQ(GURL(kPdfBlob), request.url()); | 284 EXPECT_EQ(GURL(kPdfBlob), request.url()); |
| 284 } | 285 } |
| 285 | 286 |
| 286 } // namespace | 287 } // namespace |
| 287 | 288 |
| 288 } // namespace chromeos | 289 } // namespace chromeos |
| OLD | NEW |