| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "chrome/browser/chromeos/gview_request_interceptor.h" | 7 #include "chrome/browser/chromeos/gview_request_interceptor.h" |
| 8 #include "chrome/browser/plugin_service.h" | 8 #include "chrome/browser/plugin_service.h" |
| 9 #include "chrome/common/chrome_paths.h" | 9 #include "chrome/common/chrome_paths.h" |
| 10 #include "net/base/load_flags.h" | 10 #include "net/base/load_flags.h" |
| 11 #include "net/url_request/url_request.h" | 11 #include "net/url_request/url_request.h" |
| 12 #include "net/url_request/url_request_job.h" | 12 #include "net/url_request/url_request_job.h" |
| 13 #include "net/url_request/url_request_test_job.h" | 13 #include "net/url_request/url_request_test_job.h" |
| 14 #include "net/url_request/url_request_unittest.h" | 14 #include "net/url_request/url_request_test_util.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 #include "webkit/glue/plugins/plugin_list.h" | 16 #include "webkit/glue/plugins/plugin_list.h" |
| 17 | 17 |
| 18 namespace chromeos { | 18 namespace chromeos { |
| 19 | 19 |
| 20 class GViewURLRequestTestJob : public net::URLRequestTestJob { | 20 class GViewURLRequestTestJob : public net::URLRequestTestJob { |
| 21 public: | 21 public: |
| 22 explicit GViewURLRequestTestJob(net::URLRequest* request) | 22 explicit GViewURLRequestTestJob(net::URLRequest* request) |
| 23 : net::URLRequestTestJob(request, true) { | 23 : net::URLRequestTestJob(request, true) { |
| 24 } | 24 } |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 TEST_F(GViewRequestInterceptorTest, InterceptPowerpoint) { | 174 TEST_F(GViewRequestInterceptorTest, InterceptPowerpoint) { |
| 175 net::URLRequest request(GURL("http://foo.com/file.ppt"), &test_delegate_); | 175 net::URLRequest request(GURL("http://foo.com/file.ppt"), &test_delegate_); |
| 176 request.Start(); | 176 request.Start(); |
| 177 MessageLoop::current()->Run(); | 177 MessageLoop::current()->Run(); |
| 178 EXPECT_EQ(1, test_delegate_.received_redirect_count()); | 178 EXPECT_EQ(1, test_delegate_.received_redirect_count()); |
| 179 EXPECT_EQ(GURL("http://docs.google.com/gview?url=http%3A//foo.com/file.ppt"), | 179 EXPECT_EQ(GURL("http://docs.google.com/gview?url=http%3A//foo.com/file.ppt"), |
| 180 request.url()); | 180 request.url()); |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace chromeos | 183 } // namespace chromeos |
| OLD | NEW |