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

Unified Diff: chrome/browser/extensions/process_management_browsertest.cc

Issue 2736863003: Test that no crash happens with the CWS error page.
Patch Set: Prevent crash of the renderer. Created 3 years, 9 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: chrome/browser/extensions/process_management_browsertest.cc
diff --git a/chrome/browser/extensions/process_management_browsertest.cc b/chrome/browser/extensions/process_management_browsertest.cc
index c446d02a0310698067466a7ec1888924299f3a70..02d9f40bc1d5ba0fc134875680a5c02f68fe3450 100644
--- a/chrome/browser/extensions/process_management_browsertest.cc
+++ b/chrome/browser/extensions/process_management_browsertest.cc
@@ -29,6 +29,7 @@
#include "extensions/browser/extension_host.h"
#include "extensions/browser/process_manager.h"
#include "extensions/browser/process_map.h"
+#include "extensions/common/extension_urls.h"
#include "extensions/common/switches.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
@@ -458,3 +459,33 @@ IN_PROC_BROWSER_TEST_F(ExtensionBrowserTest,
EXPECT_EQ(new_site_instance->GetProcess(),
web_contents->GetSiteInstance()->GetProcess());
}
+
+// This problem is similar to https://crbug.com/622385. It happens when an
+// iframe error page with the Chrome Web Store URL is displayed and the iframe
+// and its parent reside in the same process. In this case, the renderer
+// process is killed with the RFH_CAN_COMMIT_URL_BLOCKED error code. This test
+// asserts that the renderer is still alive after the navigation.
+IN_PROC_BROWSER_TEST_F(ChromeWebStoreProcessTest,
+ ChromeWebStoreBlockedByFrameSrc) {
+ GURL url =
+ embedded_test_server()->GetURL("/extensions/iframe-child-src-none.html");
+ ui_test_utils::NavigateToURL(browser(), url);
+
+ WebContents* web_contents =
+ browser()->tab_strip_model()->GetActiveWebContents();
+
+ // Make the iframe navigate to the Chrome Web Store and wait for the 'load'
+ // event. This is also a check that the renderer is still alive after the
+ // navigation.
+ std::string message;
+ EXPECT_TRUE(ExecuteScriptAndExtractString(
+ web_contents,
+ "var iframe = document.getElementById('test');"
+ "iframe.onload = function() {"
+ " domAutomationController.send('iframe loaded');"
+ "};"
+ "iframe.src = '" +
+ std::string(extension_urls::kChromeWebstoreBaseURL) + "';",
+ &message));
+ EXPECT_EQ("iframe loaded", message);
+}

Powered by Google App Engine
This is Rietveld 408576698