diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-03 07:57:44 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-03 07:57:44 +0000 |
commit | 4adf556dec57f4a937a3a03b9b3a3d9ffdf7a49e (patch) | |
tree | 7425f8ca3a9411f5b07a408253b951ff320aef1f /chrome/test | |
parent | 3d248b2db2eae7c805ada987f997caa0929700c7 (diff) | |
download | chromium_src-4adf556dec57f4a937a3a03b9b3a3d9ffdf7a49e.zip chromium_src-4adf556dec57f4a937a3a03b9b3a3d9ffdf7a49e.tar.gz chromium_src-4adf556dec57f4a937a3a03b9b3a3d9ffdf7a49e.tar.bz2 |
Don't set referrers on outgoing plugin requests if the load_manually flag is set. This emulates the
behavior of other browsers and fixes http://code.google.com/p/chromium/issues/detail?id=28800
I added a UI test to validate that the plugin source URL is set on outgoing GetURL requests issued
by the plugin. To validate that the document URL is set as the referrer on the initial URL request
would take some more work. Will try and add that in a future CL.
I also changed the WebPluginImpl::RouteToFrame function to set the referrer on similar lines.
Bug=28800
Test=Covered by UI test
Review URL: http://codereview.chromium.org/459003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33673 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
4 files changed, 62 insertions, 0 deletions
diff --git a/chrome/test/data/npapi/plugin_ref_target_page.html b/chrome/test/data/npapi/plugin_ref_target_page.html new file mode 100644 index 0000000..89ee354 --- /dev/null +++ b/chrome/test/data/npapi/plugin_ref_target_page.html @@ -0,0 +1,19 @@ +<html> +<head><title>Target page for validating referrers in URL requests issued by <br /> +plugins +</title> + +<script src="npapi.js"></script> + +<script> +function onLoad() { + if (document.referrer == "http://mock.http/dummy_plugin_referrer") + onSuccess("plugin_referrer_test", 1); + else + onFailure("plugin_referrer_test", 1, "Unexpected referrer value"); +} +</script> +</head> + +<body onload="onLoad()">Plugin referrer test page.</body> +</html> diff --git a/chrome/test/data/npapi/plugin_ref_target_page.html.mock-http-headers b/chrome/test/data/npapi/plugin_ref_target_page.html.mock-http-headers new file mode 100644 index 0000000..57fae25 --- /dev/null +++ b/chrome/test/data/npapi/plugin_ref_target_page.html.mock-http-headers @@ -0,0 +1,2 @@ +HTTP/1.0 200 OK +Content-type: text/html diff --git a/chrome/test/data/npapi/plugin_url_request_referrer_test.html b/chrome/test/data/npapi/plugin_url_request_referrer_test.html new file mode 100644 index 0000000..e5589e6 --- /dev/null +++ b/chrome/test/data/npapi/plugin_url_request_referrer_test.html @@ -0,0 +1,26 @@ +<html> + +<head> +<script src="npapi.js"></script> +</head> + + +<body> +<div id="statusPanel" style="border: 1px solid red; width: 100%"> +Test running.... +</div> + + +Plugin URL request referrer test<p> +This test verifies that the HTTP referrer value is set correctly in HTTP<br> +requests issued by plugins. + +<embed type="application/vnd.npapi-test" + ref_target="http://mock.http/npapi/plugin_ref_target_page.html" + name="plugin_referrer_test" + id="1" + mode="np_embed" + src="http://mock.http/dummy_plugin_referrer" +> +</body> +</html> diff --git a/chrome/test/ui/npapi_uitest.cc b/chrome/test/ui/npapi_uitest.cc index f910646..3148c10 100644 --- a/chrome/test/ui/npapi_uitest.cc +++ b/chrome/test/ui/npapi_uitest.cc @@ -407,3 +407,18 @@ TEST_F(NPAPITester, NPObjectSetException) { kTestCompleteCookie, kTestCompleteSuccess, kShortWaitTimeout); } + +TEST_F(NPAPIVisiblePluginTester, PluginReferrerTest) { + if (UITest::in_process_renderer()) + return; + + GURL url(URLRequestMockHTTPJob::GetMockUrl( + FilePath(FILE_PATH_LITERAL( + "npapi/plugin_url_request_referrer_test.html")))); + + NavigateToURL(url); + + WaitForFinish("plugin_referrer_test", "1", url, kTestCompleteCookie, + kTestCompleteSuccess, kShortWaitTimeout); +} + |