content/renderer/browser_plugin/browser_plugin_browsertest.cc
TEST_F(BrowserPluginTest, RemovePluginBeforeNavigation) {
  std::string html = base::StringPrintf(kHTMLForSourcelessPluginObject,
                                        kBrowserPluginMimeType);
  LoadHTML(html.c_str());
  EXPECT_FALSE(browser_plugin_manager()->sink().GetUniqueMessageMatching(
      BrowserPluginHostMsg_PluginDestroyed::ID));
  ExecuteJavaScript("x = document.getElementById('browserplugin'); "
                    "x.parentNode.removeChild(x);");
  ProcessPendingMessages();
  EXPECT_FALSE(browser_plugin_manager()->sink().GetUniqueMessageMatching(
      BrowserPluginHostMsg_PluginDestroyed::ID));
}
// This test verifies that PluginDestroyed messages do not get sent from a
// BrowserPlugin that has never navigated.
This test verifies that PluginDestroyed messages do not get sent from a
BrowserPlugin that has never navigated.
This test verifies that PluginDestroyed messages do not get sent from a BrowserPlugin that has never navigated .
TEST_F(BrowserPluginTest, RemovePluginBeforeNavigation) {
  std::string html = base::StringPrintf(kHTMLForSourcelessPluginObject,
                                        kBrowserPluginMimeType);
  LoadHTML(html.c_str());
  EXPECT_FALSE(browser_plugin_manager()->sink().GetUniqueMessageMatching(
      BrowserPluginHostMsg_PluginDestroyed::ID));
  ExecuteJavaScript("x = document.getElementById('browserplugin'); "
                    "x.parentNode.removeChild(x);");
  ProcessPendingMessages();
  EXPECT_FALSE(browser_plugin_manager()->sink().GetUniqueMessageMatching(
      BrowserPluginHostMsg_PluginDestroyed::ID));
}
TEST_F ( BrowserPluginTest , RemovePluginBeforeNavigation ) { std :: string html = base :: StringPrintf ( kHTMLForSourcelessPluginObject , kBrowserPluginMimeType ) ; LoadHTML ( html . c_str ( ) ) ; EXPECT_FALSE ( browser_plugin_manager ( ) -> sink ( ) . GetUniqueMessageMatching ( BrowserPluginHostMsg_PluginDestroyed :: ID ) ) ; ExecuteJavaScript ( " " " " ) ; ProcessPendingMessages ( ) ; EXPECT_FALSE ( browser_plugin_manager ( ) -> sink ( ) . GetUniqueMessageMatching ( BrowserPluginHostMsg_PluginDestroyed :: ID ) ) ; }
This test verifies that PluginDestroyed messages do not get sent from a
BrowserPlugin that has never navigated.
This test verifies that PluginDestroyed messages do not get sent from a BrowserPlugin that has never navigated .