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

Unified Diff: content/renderer/browser_plugin/browser_plugin_browsertest.cc

Issue 11092023: Browser Plugin: Implement CanGoBack/CanGoForward (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed creis@'s comments Created 8 years, 2 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/browser_plugin/browser_plugin_browsertest.cc
diff --git a/content/renderer/browser_plugin/browser_plugin_browsertest.cc b/content/renderer/browser_plugin/browser_plugin_browsertest.cc
index 3aa752720954c3b52658fa8dfeecc2ba8b3bb5a2..b03bc31382f91b59adbf17d985b2300a06ba3481 100644
--- a/content/renderer/browser_plugin/browser_plugin_browsertest.cc
+++ b/content/renderer/browser_plugin/browser_plugin_browsertest.cc
@@ -312,8 +312,8 @@ TEST_F(BrowserPluginTest, RemovePlugin) {
TEST_F(BrowserPluginTest, CustomEvents) {
const char* kAddEventListener =
"var url;"
- "function nav(u) {"
- " url = u;"
+ "function nav(e) {"
+ " url = e.url;"
"}"
"document.getElementById('browserplugin')."
" addEventListener('navigation', nav);";
@@ -342,16 +342,25 @@ TEST_F(BrowserPluginTest, CustomEvents) {
browser_plugin_manager()->GetBrowserPlugin(instance_id));
ASSERT_TRUE(browser_plugin);
- browser_plugin->DidNavigate(GURL(kGoogleURL), 1337);
- EXPECT_EQ(kGoogleURL, ExecuteScriptAndReturnString("url"));
- EXPECT_EQ(1337, ExecuteScriptAndReturnInt(kGetProcessID));
-
+ {
+ BrowserPluginMsg_DidNavigate_Params navigate_params;
+ navigate_params.url = GURL(kGoogleURL);
+ navigate_params.process_id = 1337;
+ browser_plugin->DidNavigate(navigate_params);
+ EXPECT_EQ(kGoogleURL, ExecuteScriptAndReturnString("url"));
+ EXPECT_EQ(1337, ExecuteScriptAndReturnInt(kGetProcessID));
+ }
ExecuteJavaScript(kRemoveEventListener);
- browser_plugin->DidNavigate(GURL(kGoogleNewsURL), 42);
- // The URL variable should not change because we've removed the event
- // listener.
- EXPECT_EQ(kGoogleURL, ExecuteScriptAndReturnString("url"));
- EXPECT_EQ(42, ExecuteScriptAndReturnInt(kGetProcessID));
+ {
+ BrowserPluginMsg_DidNavigate_Params navigate_params;
+ navigate_params.url = GURL(kGoogleNewsURL);
+ navigate_params.process_id = 42;
+ browser_plugin->DidNavigate(navigate_params);
+ // The URL variable should not change because we've removed the event
+ // listener.
+ EXPECT_EQ(kGoogleURL, ExecuteScriptAndReturnString("url"));
+ EXPECT_EQ(42, ExecuteScriptAndReturnInt(kGetProcessID));
+ }
}
TEST_F(BrowserPluginTest, StopMethod) {

Powered by Google App Engine
This is Rietveld 408576698