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 7524313c8f28e5fb96524bd61c0001e7d70ed592..0bdd59aeb13be08f89c3fc25f3e111ed94dc9741 100644 |
--- a/content/renderer/browser_plugin/browser_plugin_browsertest.cc |
+++ b/content/renderer/browser_plugin/browser_plugin_browsertest.cc |
@@ -202,12 +202,14 @@ TEST_F(BrowserPluginTest, InitialResize) { |
BrowserPluginHostMsg_Attach_Params params; |
MockBrowserPlugin* browser_plugin = GetCurrentPluginWithAttachParams(¶ms); |
- EXPECT_EQ(640, params.resize_guest_params.view_rect.width()); |
- EXPECT_EQ(480, params.resize_guest_params.view_rect.height()); |
+ // Since the browser plugin is now created detached, its initial width/ |
+ // height geometry is 0 x 0. |
+ EXPECT_EQ(0, params.resize_guest_params.view_rect.width()); |
+ EXPECT_EQ(0, params.resize_guest_params.view_rect.height()); |
ASSERT_TRUE(browser_plugin); |
// Now the browser plugin is expecting a UpdateRect resize. |
int instance_id = browser_plugin->guest_instance_id(); |
- EXPECT_TRUE(browser_plugin->pending_damage_buffer_.get()); |
+ EXPECT_FALSE(browser_plugin->pending_damage_buffer_.get()); |
// Send the BrowserPlugin an UpdateRect equal to its container size with |
// the same damage buffer. That should clear |pending_damage_buffer_|. |
@@ -304,7 +306,7 @@ TEST_F(BrowserPluginTest, ResizeFlowControl) { |
MockBrowserPlugin* browser_plugin = GetCurrentPlugin(); |
ASSERT_TRUE(browser_plugin); |
int instance_id = browser_plugin->guest_instance_id(); |
- EXPECT_TRUE(browser_plugin->pending_damage_buffer_.get()); |
+ EXPECT_FALSE(browser_plugin->pending_damage_buffer_.get()); |
// Send an UpdateRect to the BrowserPlugin to make it use the pending damage |
// buffer. |
{ |
@@ -403,7 +405,9 @@ TEST_F(BrowserPluginTest, RemovePlugin) { |
ExecuteJavaScript("x = document.getElementById('browserplugin'); " |
"x.parentNode.removeChild(x);"); |
ProcessPendingMessages(); |
- EXPECT_TRUE(browser_plugin_manager()->sink().GetUniqueMessageMatching( |
+ // Since BrowserPlugin persis, there will be no plugin destroyed message |
+ // until the owning DOM element is destroyed. |
+ EXPECT_FALSE(browser_plugin_manager()->sink().GetUniqueMessageMatching( |
BrowserPluginHostMsg_PluginDestroyed::ID)); |
} |