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 "base/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
6 #include "content/public/common/user_agent.h" | 6 #include "content/public/common/user_agent.h" |
7 #include "content/public/test/render_view_test.h" | 7 #include "content/public/test/render_view_test.h" |
8 #include "content/renderer/pepper/url_request_info_util.h" | 8 #include "content/renderer/pepper/url_request_info_util.h" |
9 #include "ppapi/proxy/connection.h" | 9 #include "ppapi/proxy/connection.h" |
10 #include "ppapi/proxy/url_request_info_resource.h" | 10 #include "ppapi/proxy/url_request_info_resource.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 test_globals_.GetResourceTracker()->DidCreateInstance(pp_instance_); | 64 test_globals_.GetResourceTracker()->DidCreateInstance(pp_instance_); |
65 | 65 |
66 // This resource doesn't do IPC, so a null connection is fine. | 66 // This resource doesn't do IPC, so a null connection is fine. |
67 info_ = new URLRequestInfoResource( | 67 info_ = new URLRequestInfoResource( |
68 ppapi::proxy::Connection(), pp_instance_, URLRequestInfoData()); | 68 ppapi::proxy::Connection(), pp_instance_, URLRequestInfoData()); |
69 } | 69 } |
70 | 70 |
71 void TearDown() override { | 71 void TearDown() override { |
72 test_globals_.GetResourceTracker()->DidDeleteInstance(pp_instance_); | 72 test_globals_.GetResourceTracker()->DidDeleteInstance(pp_instance_); |
73 // Turn locking back to the default for tests that run later. | |
74 ppapi::ProxyLock::EnableLockingOnThreadForTest(); | |
75 RenderViewTest::TearDown(); | 73 RenderViewTest::TearDown(); |
76 } | 74 } |
77 | 75 |
78 bool GetDownloadToFile() { | 76 bool GetDownloadToFile() { |
79 WebURLRequest web_request; | 77 WebURLRequest web_request; |
80 URLRequestInfoData data = info_->GetData(); | 78 URLRequestInfoData data = info_->GetData(); |
81 if (!CreateWebURLRequest(pp_instance_, &data, GetMainFrame(), &web_request)) | 79 if (!CreateWebURLRequest(pp_instance_, &data, GetMainFrame(), &web_request)) |
82 return false; | 80 return false; |
83 return web_request.downloadToFile(); | 81 return web_request.downloadToFile(); |
84 } | 82 } |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 // Test that we can set multiple header fields using \n delimiter. | 233 // Test that we can set multiple header fields using \n delimiter. |
236 EXPECT_TRUE( | 234 EXPECT_TRUE( |
237 SetStringProperty(PP_URLREQUESTPROPERTY_HEADERS, "foo: bar\nbar: baz")); | 235 SetStringProperty(PP_URLREQUESTPROPERTY_HEADERS, "foo: bar\nbar: baz")); |
238 EXPECT_TRUE(IsExpected(GetHeaderValue("foo"), "bar")); | 236 EXPECT_TRUE(IsExpected(GetHeaderValue("foo"), "bar")); |
239 EXPECT_TRUE(IsExpected(GetHeaderValue("bar"), "baz")); | 237 EXPECT_TRUE(IsExpected(GetHeaderValue("bar"), "baz")); |
240 } | 238 } |
241 | 239 |
242 // TODO(bbudge) Unit tests for AppendDataToBody, AppendFileToBody. | 240 // TODO(bbudge) Unit tests for AppendDataToBody, AppendFileToBody. |
243 | 241 |
244 } // namespace content | 242 } // namespace content |
OLD | NEW |