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

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

Issue 2519333007: <webview> Fix crash when closing chrome://chrome-signin (Closed)
Patch Set: 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 | 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 340a9b9b27f878a3ef211b4a88886e6a6b7f319d..43c5fa0146343481d114cebb74eb76e21a18a860 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"
@@ -3860,3 +3861,49 @@ IN_PROC_BROWSER_TEST_P(WebViewFocusTest, TouchFocusesEmbedder) {
EXPECT_TRUE(aura_webview->HasFocus());
}
#endif
+
+class ChromeSignInWebViewTest : public WebViewTestBase {
Charlie Reis 2016/11/23 23:45:24 Maybe add a comment that this runs with the OOPIF
avallee 2016/11/24 17:53:58 Done.
+ 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");
+ }
+};
+
+
+// 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());
+}
« 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