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

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

Issue 618823002: GuestView: Move lifetime management out of content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comment Created 6 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
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 6abede33bcf22341eb949a5725ecd01ee6c39a4f..bb0719fec7e410381b0977ccabe9ef5663c79e78 100644
--- a/content/renderer/browser_plugin/browser_plugin_browsertest.cc
+++ b/content/renderer/browser_plugin/browser_plugin_browsertest.cc
@@ -31,9 +31,6 @@ const char kHTMLForBrowserPluginObject[] =
" src='foo' type='%s'></object>"
"<script>document.querySelector('object').nonExistentAttribute;</script>";
-const char kHTMLForSourcelessPluginObject[] =
- "<object id='browserplugin' width='640px' height='480px' type='%s'>";
-
std::string GetHTMLForBrowserPluginObject() {
return base::StringPrintf(kHTMLForBrowserPluginObject,
kBrowserPluginMimeType);
@@ -173,33 +170,4 @@ TEST_F(BrowserPluginTest, InitialResize) {
ASSERT_TRUE(browser_plugin);
}
-TEST_F(BrowserPluginTest, RemovePlugin) {
- LoadHTML(GetHTMLForBrowserPluginObject().c_str());
- MockBrowserPlugin* browser_plugin = GetCurrentPlugin();
- ASSERT_TRUE(browser_plugin);
-
- EXPECT_FALSE(browser_plugin_manager()->sink().GetUniqueMessageMatching(
- BrowserPluginHostMsg_PluginDestroyed::ID));
- ExecuteJavaScript("x = document.getElementById('browserplugin'); "
- "x.parentNode.removeChild(x);");
- ProcessPendingMessages();
- EXPECT_TRUE(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.
-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));
-}
-
} // namespace content
« no previous file with comments | « content/renderer/browser_plugin/browser_plugin.cc ('k') | extensions/browser/api/guest_view/guest_view_internal_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698