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

Unified Diff: chrome/browser/chrome_site_per_process_browsertest.cc

Issue 2525473002: Extending "ChromeSitePerProcessPDFTest.EmbeddedPDFInsideCrossOriginFrame" to verify guest destructi… (Closed)
Patch Set: Addressing alexmos@'s comments Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_site_per_process_browsertest.cc
diff --git a/chrome/browser/chrome_site_per_process_browsertest.cc b/chrome/browser/chrome_site_per_process_browsertest.cc
index 788eb657d69eaae9da460526a4825f8bf4612d8e..e385c9ef3c642142343c7b2e1b041f800d99cfc4 100644
--- a/chrome/browser/chrome_site_per_process_browsertest.cc
+++ b/chrome/browser/chrome_site_per_process_browsertest.cc
@@ -330,7 +330,8 @@ class ChromeSitePerProcessPDFTest : public ChromeSitePerProcessTest {
EmbeddedPDFInsideCrossOriginFrame
#endif
// This test verifies that when navigating an OOPIF to a page with <embed>-ed
-// PDF, the guest is properly created (https://crbug.com/649856).
+// PDF, the guest is properly created, and by removing the embedder frame, the
+// guest is properly destroyed (https://crbug.com/649856).
IN_PROC_BROWSER_TEST_F(ChromeSitePerProcessPDFTest,
MAYBE_EmbeddedPDFInsideCrossOriginFrame) {
// Navigate to a page with an <iframe>.
@@ -350,5 +351,14 @@ IN_PROC_BROWSER_TEST_F(ChromeSitePerProcessPDFTest,
EXPECT_TRUE(NavigateIframeToURL(active_web_contents, "test", frame_url));
// Wait until the guest for PDF is created.
- test_guest_view_manager()->WaitForSingleGuestCreated();
+ content::WebContents* guest_web_contents =
+ test_guest_view_manager()->WaitForSingleGuestCreated();
+
+ // Now detach the frame and observe that the guest is destroyed.
+ content::WebContentsDestroyedWatcher observer(guest_web_contents);
+ EXPECT_TRUE(ExecuteScript(
+ active_web_contents,
+ "document.body.removeChild(document.querySelector('iframe'));"));
+ observer.Wait();
+ EXPECT_EQ(0U, test_guest_view_manager()->GetNumGuestsActive());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698