| Index: webkit/glue/plugins/test/plugin_geturl_test.cc
|
| ===================================================================
|
| --- webkit/glue/plugins/test/plugin_geturl_test.cc (revision 33607)
|
| +++ webkit/glue/plugins/test/plugin_geturl_test.cc (working copy)
|
| @@ -46,14 +46,20 @@
|
| if (page_not_found_url) {
|
| page_not_found_url_ = page_not_found_url;
|
| expect_404_response_ = true;
|
| - } else {
|
| - const char* fail_write_url = GetArgValue("fail_write_url", argc,
|
| - argn, argv);
|
| - if (fail_write_url) {
|
| - fail_write_url_ = fail_write_url;
|
| - }
|
| }
|
|
|
| + const char* fail_write_url = GetArgValue("fail_write_url", argc,
|
| + argn, argv);
|
| + if (fail_write_url) {
|
| + fail_write_url_ = fail_write_url;
|
| + }
|
| +
|
| + const char* referrer_target_url = GetArgValue("ref_target", argc,
|
| + argn, argv);
|
| + if (referrer_target_url) {
|
| + referrer_target_url_ = referrer_target_url;
|
| + }
|
| +
|
| return PluginTest::New(mode, argc, argn, argv, saved);
|
| }
|
|
|
| @@ -69,6 +75,11 @@
|
| } else if (!fail_write_url_.empty()) {
|
| HostFunctions()->geturl(id(), fail_write_url_.c_str(), NULL);
|
| return NPERR_NO_ERROR;
|
| + } else if (!referrer_target_url_.empty()) {
|
| + HostFunctions()->pushpopupsenabledstate(id(), true);
|
| + HostFunctions()->geturl(id(), referrer_target_url_.c_str(), "_blank");
|
| + HostFunctions()->poppopupsenabledstate(id());
|
| + return NPERR_NO_ERROR;
|
| }
|
|
|
| std::string url = SELF_URL;
|
| @@ -94,6 +105,10 @@
|
| return PluginTest::NewStream(type, stream, seekable, stype);
|
| }
|
|
|
| + if (!referrer_target_url_.empty()) {
|
| + return NPERR_NO_ERROR;
|
| + }
|
| +
|
| COMPILE_ASSERT(sizeof(unsigned long) <= sizeof(stream->notifyData),
|
| cast_validity_check);
|
|
|
| @@ -160,6 +175,10 @@
|
| return PluginTest::WriteReady(stream);
|
| }
|
|
|
| + if (!referrer_target_url_.empty()) {
|
| + return STREAM_CHUNK;
|
| + }
|
| +
|
| COMPILE_ASSERT(sizeof(unsigned long) <= sizeof(stream->notifyData),
|
| cast_validity_check);
|
| unsigned long stream_id = reinterpret_cast<unsigned long>(
|
| @@ -181,6 +200,10 @@
|
| return -1;
|
| }
|
|
|
| + if (!referrer_target_url_.empty()) {
|
| + return len;
|
| + }
|
| +
|
| if (stream == NULL) {
|
| SetError("Write got null stream");
|
| return -1;
|
| @@ -244,6 +267,10 @@
|
| return NPERR_NO_ERROR;
|
| }
|
|
|
| + if (!referrer_target_url_.empty()) {
|
| + return NPERR_NO_ERROR;
|
| + }
|
| +
|
| unsigned long stream_id =
|
| reinterpret_cast<unsigned long>(stream->notifyData);
|
| switch (stream_id) {
|
|
|