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

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

Issue 11412279: Browser Plugin: Only update src attribute on top-level navigations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated BrowserPluginTest.CustomEvents to cover this change Created 8 years, 1 month 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
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e59c2a56963973031ce12054b4bbfecfa5e99edb..2503fa5ebf54a5b8d717ead8c47ede2df094dc22 100644
--- a/content/renderer/browser_plugin/browser_plugin_browsertest.cc
+++ b/content/renderer/browser_plugin/browser_plugin_browsertest.cc
@@ -391,6 +391,8 @@ TEST_F(BrowserPluginTest, CustomEvents) {
" removeEventListener('-internal-loadcommit', nav);";
const char* kGetProcessID =
"document.getElementById('browserplugin').getProcessId()";
+ const char* kGetSrc =
+ "document.getElementById('browserplugin').src";
const char* kGoogleURL = "http://www.google.com/";
const char* kGoogleNewsURL = "http://news.google.com/";
@@ -412,21 +414,26 @@ TEST_F(BrowserPluginTest, CustomEvents) {
{
BrowserPluginMsg_LoadCommit_Params navigate_params;
+ navigate_params.is_top_level = true;
navigate_params.url = GURL(kGoogleURL);
navigate_params.process_id = 1337;
browser_plugin->LoadCommit(navigate_params);
EXPECT_EQ(kGoogleURL, ExecuteScriptAndReturnString("url"));
+ EXPECT_EQ(kGoogleURL, ExecuteScriptAndReturnString(kGetSrc));
EXPECT_EQ(1337, ExecuteScriptAndReturnInt(kGetProcessID));
}
ExecuteJavaScript(kRemoveEventListener);
{
BrowserPluginMsg_LoadCommit_Params navigate_params;
+ navigate_params.is_top_level = false;
navigate_params.url = GURL(kGoogleNewsURL);
navigate_params.process_id = 42;
browser_plugin->LoadCommit(navigate_params);
// The URL variable should not change because we've removed the event
// listener.
EXPECT_EQ(kGoogleURL, ExecuteScriptAndReturnString("url"));
+ // The src attribute should not change if this is a top-level navigation.
+ EXPECT_EQ(kGoogleURL, ExecuteScriptAndReturnString(kGetSrc));
EXPECT_EQ(42, ExecuteScriptAndReturnInt(kGetProcessID));
}
}
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698