Index: content/renderer/pepper/pepper_url_request_unittest.cc |
diff --git a/content/renderer/pepper/pepper_url_request_unittest.cc b/content/renderer/pepper/pepper_url_request_unittest.cc |
index 080c884726d625461e6e58fdc801e47da9f00a84..3d37fed5294a1d00923b77d2b067e6c956fd3042 100644 |
--- a/content/renderer/pepper/pepper_url_request_unittest.cc |
+++ b/content/renderer/pepper/pepper_url_request_unittest.cc |
@@ -76,43 +76,51 @@ class URLRequestInfoTest : public RenderViewTest { |
bool GetDownloadToFile() { |
WebURLRequest web_request; |
- URLRequestInfoData data = info_->GetData(); |
- if (!CreateWebURLRequest(&data, GetMainFrame(), &web_request)) |
+ if (!CreateWebURLRequestInternal(&web_request)) |
return false; |
+ |
return web_request.downloadToFile(); |
} |
WebCString GetURL() { |
WebURLRequest web_request; |
- URLRequestInfoData data = info_->GetData(); |
- if (!CreateWebURLRequest(&data, GetMainFrame(), &web_request)) |
+ if (!CreateWebURLRequestInternal(&web_request)) |
return WebCString(); |
+ |
return web_request.url().spec(); |
} |
WebString GetMethod() { |
WebURLRequest web_request; |
- URLRequestInfoData data = info_->GetData(); |
- if (!CreateWebURLRequest(&data, GetMainFrame(), &web_request)) |
+ if (!CreateWebURLRequestInternal(&web_request)) |
return WebString(); |
+ |
return web_request.httpMethod(); |
} |
WebString GetHeaderValue(const char* field) { |
WebURLRequest web_request; |
- URLRequestInfoData data = info_->GetData(); |
- if (!CreateWebURLRequest(&data, GetMainFrame(), &web_request)) |
+ if (!CreateWebURLRequestInternal(&web_request)) |
return WebString(); |
+ |
return web_request.httpHeaderField(WebString::fromUTF8(field)); |
} |
bool SetBooleanProperty(PP_URLRequestProperty prop, bool b) { |
return info_->SetBooleanProperty(prop, b); |
} |
+ |
bool SetStringProperty(PP_URLRequestProperty prop, const std::string& s) { |
return info_->SetStringProperty(prop, s); |
} |
+ protected: |
+ bool CreateWebURLRequestInternal(WebURLRequest* web_request) { |
+ URLRequestInfoData data = info_->GetData(); |
+ return CreateWebURLRequest( |
+ &data, WebURLRequest::TargetIsUnspecified, GetMainFrame(), web_request); |
+ } |
+ |
PP_Instance pp_instance_; |
// Needs to be alive for resource tracking to work. |