Commit 967f5be8 authored by Jochen Eisinger's avatar Jochen Eisinger Committed by Commit Bot

Change BrowserTest.WindowOpenClose to use multiple processes

It looks like HTML parsing on win dbg is so slow that the final
task that will end the test might get delayed for more than 30s
resulting in flaky timeouts.

Test this theory by opening the new tabs in new processes, so the
tasks has a higher likelihood of being executed on time.

R=mkwst@chromium.org
BUG=753691

Change-Id: Ia745e531a9a3f01851af199344b6863ca41758fa
Reviewed-on: https://chromium-review.googlesource.com/833939
Commit-Queue: Mike West <mkwst@chromium.org>
Reviewed-by: default avatarMike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/master@{#525287}
parent f84dd037
......@@ -1856,8 +1856,8 @@ IN_PROC_BROWSER_TEST_F(BrowserTest2, NoTabsInPopups) {
IN_PROC_BROWSER_TEST_F(BrowserTest, WindowOpenClose1) {
base::CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kDisablePopupBlocking);
GURL url = ui_test_utils::GetTestUrl(
base::FilePath(), base::FilePath().AppendASCII("window.close.html"));
ASSERT_TRUE(embedded_test_server()->Start());
GURL url = embedded_test_server()->GetURL("/window.close.html");
GURL::Replacements add_query;
std::string query("test1");
add_query.SetQuery(query.c_str(), url::Component(0, query.length()));
......@@ -1873,8 +1873,8 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, WindowOpenClose1) {
IN_PROC_BROWSER_TEST_F(BrowserTest, WindowOpenClose2) {
base::CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kDisablePopupBlocking);
GURL url = ui_test_utils::GetTestUrl(
base::FilePath(), base::FilePath().AppendASCII("window.close.html"));
ASSERT_TRUE(embedded_test_server()->Start());
GURL url = embedded_test_server()->GetURL("/window.close.html");
GURL::Replacements add_query;
std::string query("test2");
add_query.SetQuery(query.c_str(), url::Component(0, query.length()));
......@@ -1890,8 +1890,8 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, WindowOpenClose2) {
IN_PROC_BROWSER_TEST_F(BrowserTest, WindowOpenClose3) {
base::CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kDisablePopupBlocking);
GURL url = ui_test_utils::GetTestUrl(
base::FilePath(), base::FilePath().AppendASCII("window.close.html"));
ASSERT_TRUE(embedded_test_server()->Start());
GURL url = embedded_test_server()->GetURL("/window.close.html");
GURL::Replacements add_query;
std::string query("test3");
add_query.SetQuery(query.c_str(), url::Component(0, query.length()));
......
......@@ -4,12 +4,21 @@
<script>
var popup, popup2, popup3, popup4;
function WindowOpen(file, name, attr) {
// Force windows to open in a new process. See https://crbug.com/153363.
var url = 'http://example.com:' + location.port + '/' + file;
var w = window.open('', name, attr);
w.opener = null;
w.location.href = url;
return w;
}
// window.open, window.close should be synchronous
function test1() {
popup = window.open('title1.html', 'name');
popup = WindowOpen('title1.html', 'name');
popup.close();
popup = window.open('title2.html', 'name', 'width=200,height=200');
popup = WindowOpen('title2.html', 'name', 'width=200,height=200');
popup.close();
document.location = 'title2.html'
}
......@@ -33,10 +42,10 @@
}
function openPopups() {
popup = window.open('title1.html', 'name');
popup2 = window.open('title1.html', 'name2');
popup3 = window.open('title1.html', 'name3');
popup4 = window.open('title1.html', 'name4');
popup = WindowOpen('title1.html', 'name');
popup2 = WindowOpen('title1.html', 'name2');
popup3 = WindowOpen('title1.html', 'name3');
popup4 = WindowOpen('title1.html', 'name4');
}
function closePopups() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment