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

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

Issue 23591016: BrowserPlugin/WebView - Move plugin lifetime to DOM (Chromium-side) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update BrowserPlugin tests to reflect new behaviour. Created 6 years, 8 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 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(&params);
- 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));
}

Powered by Google App Engine
This is Rietveld 408576698