Index: content/browser/browser_plugin/browser_plugin_host_browsertest.cc |
diff --git a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc |
index ba8007530802bf9b70563a5bd4b61f7543322b2a..5c4ef6524c350f4d8d1d6575f674194f7a7256d5 100644 |
--- a/content/browser/browser_plugin/browser_plugin_host_browsertest.cc |
+++ b/content/browser/browser_plugin/browser_plugin_host_browsertest.cc |
@@ -609,4 +609,38 @@ IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, ReloadEmbedder) { |
} |
} |
+IN_PROC_BROWSER_TEST_F(BrowserPluginHostTest, LoadRedirect) { |
+ const char* kEmbedderURL = "files/browser_plugin_embedder.html"; |
+ StartBrowserPluginTest(kEmbedderURL, kHTMLForGuest, true, ""); |
+ RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>( |
+ test_embedder()->web_contents()->GetRenderViewHost()); |
+ |
+ // Navigate with a redirect and wait until the title changes. |
+ const char* redirectURL = "client-redirect?files/title2.html"; |
+ { |
+ const string16 expected_title = ASCIIToUTF16("Title Of Awesomeness"); |
+ content::TitleWatcher title_watcher(test_guest()->web_contents(), |
+ expected_title); |
+ |
+ rvh->ExecuteJavascriptAndGetValue( |
+ string16(), |
+ ASCIIToUTF16(StringPrintf("RedirectTo('%s');", redirectURL))); |
+ |
+ string16 actual_title = title_watcher.WaitAndGetTitle(); |
Charlie Reis
2012/10/04 00:46:42
The test is hanging here, as if the navigation nev
Fady Samuel
2012/10/04 03:07:06
The issue is you can't pass this partial URL. You
Charlie Reis
2012/10/04 19:05:58
Thanks. The rest of the test wasn't working becau
|
+ EXPECT_EQ(expected_title, actual_title); |
+ } |
+ |
+ // Verify that we heard a loadRedirect during the navigation. |
+ base::Value* v = rvh->ExecuteJavascriptAndGetValue( |
+ string16(), ASCIIToUTF16("redirectOldUrl")); |
+ std::string result; |
+ EXPECT_TRUE(v->GetAsString(&result)); |
+ EXPECT_EQ(redirectURL, result); |
+ |
+ v = rvh->ExecuteJavascriptAndGetValue( |
+ string16(), ASCIIToUTF16("redirectNewUrl")); |
+ EXPECT_TRUE(v->GetAsString(&result)); |
+ EXPECT_EQ("files/title2.html", result); |
+} |
+ |
} // namespace content |