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

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

Issue 10978028: Propagate storage partition id and persistence to the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merging with incoming changes (159475). Created 8 years, 3 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
« 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 c992aa767683cf4f97285225b9bcc622d01b81ac..47a74868713fbd44a6ac010e7faeb76758d65dba 100644
--- a/content/renderer/browser_plugin/browser_plugin_browsertest.cc
+++ b/content/renderer/browser_plugin/browser_plugin_browsertest.cc
@@ -133,6 +133,12 @@ TEST_F(BrowserPluginTest, SrcAttribute) {
// Verify that we're reporting the correct URL to navigate to based on the
// src attribute.
{
+ // Ensure we get a CreateGuest on the initial navigation.
+ const IPC::Message* create_msg =
+ browser_plugin_manager()->sink().GetUniqueMessageMatching(
+ BrowserPluginHostMsg_CreateGuest::ID);
+ ASSERT_TRUE(create_msg);
+
const IPC::Message* msg =
browser_plugin_manager()->sink().GetUniqueMessageMatching(
BrowserPluginHostMsg_NavigateGuest::ID);
@@ -155,6 +161,12 @@ TEST_F(BrowserPluginTest, SrcAttribute) {
// Verify that the src attribute is updated as well.
ExecuteJavaScript("document.getElementById('browserplugin').src = 'bar'");
{
+ // Verify that we do not get a CreateGuest on subsequent navigations.
+ const IPC::Message* create_msg =
+ browser_plugin_manager()->sink().GetUniqueMessageMatching(
+ BrowserPluginHostMsg_CreateGuest::ID);
+ ASSERT_FALSE(create_msg);
+
const IPC::Message* msg =
browser_plugin_manager()->sink().GetUniqueMessageMatching(
BrowserPluginHostMsg_NavigateGuest::ID);
@@ -426,6 +438,22 @@ TEST_F(BrowserPluginTest, ImmutableAttributesAfterNavigation) {
ExecuteJavaScript("document.getElementById('browserplugin').src = 'bar'");
{
+ const IPC::Message* create_msg =
+ browser_plugin_manager()->sink().GetUniqueMessageMatching(
+ BrowserPluginHostMsg_CreateGuest::ID);
+ ASSERT_TRUE(create_msg);
+
+ int create_instance_id;
+ std::string storage_partition;
+ bool persist_storage = true;
+ BrowserPluginHostMsg_CreateGuest::Read(
+ create_msg,
+ &create_instance_id,
+ &storage_partition,
+ &persist_storage);
+ EXPECT_STREQ("storage", storage_partition.c_str());
+ EXPECT_FALSE(persist_storage);
+
const IPC::Message* msg =
browser_plugin_manager()->sink().GetUniqueMessageMatching(
BrowserPluginHostMsg_NavigateGuest::ID);
@@ -440,6 +468,7 @@ TEST_F(BrowserPluginTest, ImmutableAttributesAfterNavigation) {
&src,
&resize_params);
EXPECT_STREQ("bar", src.c_str());
+ EXPECT_EQ(create_instance_id, instance_id);
}
// Setting the partition should throw an exception and the value should not
« 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