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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 ppapi::thunk::GetPPB_URLRequestInfo_1_0_Thunk(); | 125 ppapi::thunk::GetPPB_URLRequestInfo_1_0_Thunk(); |
126 EXPECT_TRUE(request_info); | 126 EXPECT_TRUE(request_info); |
127 EXPECT_TRUE(request_info->Create); | 127 EXPECT_TRUE(request_info->Create); |
128 EXPECT_TRUE(request_info->IsURLRequestInfo); | 128 EXPECT_TRUE(request_info->IsURLRequestInfo); |
129 EXPECT_TRUE(request_info->SetProperty); | 129 EXPECT_TRUE(request_info->SetProperty); |
130 EXPECT_TRUE(request_info->AppendDataToBody); | 130 EXPECT_TRUE(request_info->AppendDataToBody); |
131 EXPECT_TRUE(request_info->AppendFileToBody); | 131 EXPECT_TRUE(request_info->AppendFileToBody); |
132 } | 132 } |
133 | 133 |
134 TEST_F(URLRequestInfoTest, AsURLRequestInfo) { | 134 TEST_F(URLRequestInfoTest, AsURLRequestInfo) { |
135 EXPECT_EQ(info_, info_->AsPPB_URLRequestInfo_API()); | 135 EXPECT_EQ(info_.get(), info_->AsPPB_URLRequestInfo_API()); |
136 } | 136 } |
137 | 137 |
138 TEST_F(URLRequestInfoTest, StreamToFile) { | 138 TEST_F(URLRequestInfoTest, StreamToFile) { |
139 SetStringProperty(PP_URLREQUESTPROPERTY_URL, "http://www.google.com"); | 139 SetStringProperty(PP_URLREQUESTPROPERTY_URL, "http://www.google.com"); |
140 | 140 |
141 EXPECT_FALSE(GetDownloadToFile()); | 141 EXPECT_FALSE(GetDownloadToFile()); |
142 | 142 |
143 EXPECT_TRUE(SetBooleanProperty(PP_URLREQUESTPROPERTY_STREAMTOFILE, true)); | 143 EXPECT_TRUE(SetBooleanProperty(PP_URLREQUESTPROPERTY_STREAMTOFILE, true)); |
144 EXPECT_TRUE(GetDownloadToFile()); | 144 EXPECT_TRUE(GetDownloadToFile()); |
145 | 145 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 // Test that we can set multiple header fields using \n delimiter. | 233 // Test that we can set multiple header fields using \n delimiter. |
234 EXPECT_TRUE( | 234 EXPECT_TRUE( |
235 SetStringProperty(PP_URLREQUESTPROPERTY_HEADERS, "foo: bar\nbar: baz")); | 235 SetStringProperty(PP_URLREQUESTPROPERTY_HEADERS, "foo: bar\nbar: baz")); |
236 EXPECT_TRUE(IsExpected(GetHeaderValue("foo"), "bar")); | 236 EXPECT_TRUE(IsExpected(GetHeaderValue("foo"), "bar")); |
237 EXPECT_TRUE(IsExpected(GetHeaderValue("bar"), "baz")); | 237 EXPECT_TRUE(IsExpected(GetHeaderValue("bar"), "baz")); |
238 } | 238 } |
239 | 239 |
240 // TODO(bbudge) Unit tests for AppendDataToBody, AppendFileToBody. | 240 // TODO(bbudge) Unit tests for AppendDataToBody, AppendFileToBody. |
241 | 241 |
242 } // namespace content | 242 } // namespace content |
OLD | NEW |