Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(682)

Unified Diff: content/renderer/pepper/pepper_url_request_unittest.cc

Issue 23548008: Don't set the request target type to object when navigating from a Pepper plug-in. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698