Chromium Code Reviews| 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/thunk/thunk.h" | 5 #include "ppapi/thunk/thunk.h" |
| 6 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 6 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" | 7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h" |
| 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" | 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" |
| 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 10 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 10 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 static TestWebFrameClient web_frame_client_; | 95 static TestWebFrameClient web_frame_client_; |
| 96 static WebView* web_view_; | 96 static WebView* web_view_; |
| 97 static WebFrame* frame_; | 97 static WebFrame* frame_; |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 TestWebFrameClient URLRequestInfoTest::web_frame_client_; | 100 TestWebFrameClient URLRequestInfoTest::web_frame_client_; |
| 101 WebView* URLRequestInfoTest::web_view_; | 101 WebView* URLRequestInfoTest::web_view_; |
| 102 WebFrame* URLRequestInfoTest::frame_; | 102 WebFrame* URLRequestInfoTest::frame_; |
| 103 | 103 |
| 104 TEST_F(URLRequestInfoTest, GetInterface) { | 104 TEST_F(URLRequestInfoTest, GetInterface) { |
| 105 const PPB_URLRequestInfo* interface = | 105 const PPB_URLRequestInfo* iface = |
|
jeanluc1
2011/08/22 22:20:24
We're supposed to avoid abbeviation and 'iface' is
Jói
2011/08/24 13:56:33
Done.
| |
| 106 ::ppapi::thunk::GetPPB_URLRequestInfo_Thunk(); | 106 ::ppapi::thunk::GetPPB_URLRequestInfo_Thunk(); |
| 107 ASSERT_TRUE(interface); | 107 ASSERT_TRUE(iface); |
| 108 ASSERT_TRUE(interface->Create); | 108 ASSERT_TRUE(iface->Create); |
| 109 ASSERT_TRUE(interface->IsURLRequestInfo); | 109 ASSERT_TRUE(iface->IsURLRequestInfo); |
| 110 ASSERT_TRUE(interface->SetProperty); | 110 ASSERT_TRUE(iface->SetProperty); |
| 111 ASSERT_TRUE(interface->AppendDataToBody); | 111 ASSERT_TRUE(iface->AppendDataToBody); |
| 112 ASSERT_TRUE(interface->AppendFileToBody); | 112 ASSERT_TRUE(iface->AppendFileToBody); |
| 113 ASSERT_TRUE(interface->Create); | 113 ASSERT_TRUE(iface->Create); |
| 114 ASSERT_TRUE(interface->Create); | 114 ASSERT_TRUE(iface->Create); |
| 115 } | 115 } |
| 116 | 116 |
| 117 TEST_F(URLRequestInfoTest, AsURLRequestInfo) { | 117 TEST_F(URLRequestInfoTest, AsURLRequestInfo) { |
| 118 ASSERT_EQ(info_, info_->AsPPB_URLRequestInfo_API()); | 118 ASSERT_EQ(info_, info_->AsPPB_URLRequestInfo_API()); |
| 119 } | 119 } |
| 120 | 120 |
| 121 TEST_F(URLRequestInfoTest, StreamToFile) { | 121 TEST_F(URLRequestInfoTest, StreamToFile) { |
| 122 info_->SetStringProperty(PP_URLREQUESTPROPERTY_URL, "http://www.google.com"); | 122 info_->SetStringProperty(PP_URLREQUESTPROPERTY_URL, "http://www.google.com"); |
| 123 | 123 |
| 124 ASSERT_FALSE(GetDownloadToFile()); | 124 ASSERT_FALSE(GetDownloadToFile()); |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 279 ASSERT_FALSE(info_->SetStringProperty( | 279 ASSERT_FALSE(info_->SetStringProperty( |
| 280 PP_URLREQUESTPROPERTY_HEADERS, "foo: bar\ncookie: foo")); | 280 PP_URLREQUESTPROPERTY_HEADERS, "foo: bar\ncookie: foo")); |
| 281 ASSERT_TRUE(IsNullOrEmpty(GetHeaderValue("cookie"))); | 281 ASSERT_TRUE(IsNullOrEmpty(GetHeaderValue("cookie"))); |
| 282 } | 282 } |
| 283 | 283 |
| 284 // TODO(bbudge) Unit tests for AppendDataToBody, AppendFileToBody. | 284 // TODO(bbudge) Unit tests for AppendDataToBody, AppendFileToBody. |
| 285 | 285 |
| 286 } // namespace ppapi | 286 } // namespace ppapi |
| 287 } // namespace webkit | 287 } // namespace webkit |
| 288 | 288 |
| OLD | NEW |