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 "ppapi/shared_impl/url_request_info_impl.h" | 5 #include "ppapi/shared_impl/url_request_info_impl.h" |
6 #include "ppapi/thunk/thunk.h" | 6 #include "ppapi/thunk/thunk.h" |
7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" | 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" |
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 static TestWebFrameClient web_frame_client_; | 112 static TestWebFrameClient web_frame_client_; |
113 static WebView* web_view_; | 113 static WebView* web_view_; |
114 static WebFrame* frame_; | 114 static WebFrame* frame_; |
115 }; | 115 }; |
116 | 116 |
117 TestWebFrameClient URLRequestInfoTest::web_frame_client_; | 117 TestWebFrameClient URLRequestInfoTest::web_frame_client_; |
118 WebView* URLRequestInfoTest::web_view_; | 118 WebView* URLRequestInfoTest::web_view_; |
119 WebFrame* URLRequestInfoTest::frame_; | 119 WebFrame* URLRequestInfoTest::frame_; |
120 | 120 |
121 TEST_F(URLRequestInfoTest, GetInterface) { | 121 TEST_F(URLRequestInfoTest, GetInterface) { |
122 const PPB_URLRequestInfo* interface = | 122 const PPB_URLRequestInfo* request_info = |
123 ::ppapi::thunk::GetPPB_URLRequestInfo_Thunk(); | 123 ::ppapi::thunk::GetPPB_URLRequestInfo_Thunk(); |
124 EXPECT_TRUE(interface); | 124 EXPECT_TRUE(request_info); |
125 EXPECT_TRUE(interface->Create); | 125 EXPECT_TRUE(request_info->Create); |
126 EXPECT_TRUE(interface->IsURLRequestInfo); | 126 EXPECT_TRUE(request_info->IsURLRequestInfo); |
127 EXPECT_TRUE(interface->SetProperty); | 127 EXPECT_TRUE(request_info->SetProperty); |
128 EXPECT_TRUE(interface->AppendDataToBody); | 128 EXPECT_TRUE(request_info->AppendDataToBody); |
129 EXPECT_TRUE(interface->AppendFileToBody); | 129 EXPECT_TRUE(request_info->AppendFileToBody); |
130 EXPECT_TRUE(interface->Create); | 130 EXPECT_TRUE(request_info->Create); |
131 EXPECT_TRUE(interface->Create); | 131 EXPECT_TRUE(request_info->Create); |
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_, 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()); |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 // Test that forbidden header can't be set with an allowed one. | 320 // Test that forbidden header can't be set with an allowed one. |
321 SetStringProperty(PP_URLREQUESTPROPERTY_HEADERS, "foo: bar\ncookie: foo"); | 321 SetStringProperty(PP_URLREQUESTPROPERTY_HEADERS, "foo: bar\ncookie: foo"); |
322 EXPECT_TRUE(IsNullOrEmpty(GetHeaderValue("cookie"))); | 322 EXPECT_TRUE(IsNullOrEmpty(GetHeaderValue("cookie"))); |
323 } | 323 } |
324 | 324 |
325 // TODO(bbudge) Unit tests for AppendDataToBody, AppendFileToBody. | 325 // TODO(bbudge) Unit tests for AppendDataToBody, AppendFileToBody. |
326 | 326 |
327 } // namespace ppapi | 327 } // namespace ppapi |
328 } // namespace webkit | 328 } // namespace webkit |
329 | 329 |
OLD | NEW |