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

Unified Diff: chrome/browser/apps/guest_view/web_view_browsertest.cc

Issue 2546523004: <webview> Fix crash when closing chrome://chrome-signin (Closed)
Patch Set: Created 4 years 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 | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/apps/guest_view/web_view_browsertest.cc
diff --git a/chrome/browser/apps/guest_view/web_view_browsertest.cc b/chrome/browser/apps/guest_view/web_view_browsertest.cc
index 0328c36ef8d3d1ed504f3f17d88eed9f055eb361..d9ddb777ac03eb5c0984e22cbf4b28e3818e7b36 100644
--- a/chrome/browser/apps/guest_view/web_view_browsertest.cc
+++ b/chrome/browser/apps/guest_view/web_view_browsertest.cc
@@ -39,6 +39,7 @@
#include "chrome/browser/renderer_context_menu/render_view_context_menu_test_util.h"
#include "chrome/browser/task_manager/task_manager_browsertest_util.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -3859,3 +3860,53 @@ IN_PROC_BROWSER_TEST_P(WebViewFocusTest, TouchFocusesEmbedder) {
EXPECT_TRUE(aura_webview->HasFocus());
}
#endif
+
+// This runs the chrome://chrome-signin page which includes an OOPIF-<webview>
+// of accounts.google.com.
+class ChromeSignInWebViewTest : public WebViewTestBase {
+ public:
+ ChromeSignInWebViewTest() {}
+ ~ChromeSignInWebViewTest() override {}
+
+ protected:
+ void SetUpCommandLine(base::CommandLine* command_line) override {
+ command_line->AppendSwitchASCII(
+ switches::kEnableFeatures,
+ ::features::kGuestViewCrossProcessFrames.name);
+ }
+
+ void WaitForWebViewInDom() {
+ auto* web_contents = browser()->tab_strip_model()->GetActiveWebContents();
+ auto* script =
+ "var count = 10;"
+ "var interval;"
+ "interval = setInterval(function(){"
+ " if (document.getElementsByTagName('webview').length) {"
+ " document.title = 'success';"
+ " console.log('FOUND webview');"
+ " clearInterval(interval);"
+ " } else if (count == 0) {"
+ " document.title = 'error';"
+ " clearInterval(interval);"
+ " } else {"
+ " count -= 1;"
+ " }"
+ "}, 1000);";
+ ExecuteScriptWaitForTitle(web_contents, script, "success");
+ }
+};
+
+#if (defined(OS_LINUX) && !defined(OS_CHROMEOS)) || defined(OS_MACOSX) || \
+ defined(OS_WIN)
+// This verifies the fix for http://crbug.com/667708.
+IN_PROC_BROWSER_TEST_F(ChromeSignInWebViewTest,
+ ClosingChromeSignInShouldNotCrash) {
+ GURL signin_url{"chrome://chrome-signin"};
+
+ AddTabAtIndex(0, signin_url, ui::PAGE_TRANSITION_TYPED);
+ AddTabAtIndex(1, signin_url, ui::PAGE_TRANSITION_TYPED);
+ WaitForWebViewInDom();
+
+ chrome::CloseTab(browser());
+}
+#endif
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698