Chromium Code Reviews| Index: chrome/browser/ui/tests/browser_uitest.cc |
| diff --git a/chrome/browser/ui/tests/browser_uitest.cc b/chrome/browser/ui/tests/browser_uitest.cc |
| index 35a7d8f75996d2436e0728c5e2faee29388dc727..00b4d952efc69bd3d6c8e57f850ad882c211667a 100644 |
| --- a/chrome/browser/ui/tests/browser_uitest.cc |
| +++ b/chrome/browser/ui/tests/browser_uitest.cc |
| @@ -74,116 +74,6 @@ TEST_F(BrowserTest, PosixSessionEnd) { |
| ASSERT_TRUE(exited_cleanly); |
| } |
| -// Test that scripts can fork a new renderer process for a tab in a particular |
| -// case (which matches following a link in Gmail). The script must open a new |
| -// tab, set its window.opener to null, and redirect it to a cross-site URL. |
| -// (Bug 1115708) |
| -// This test can only run if V8 is in use, and not KJS, because KJS will not |
| -// set window.opener to null properly. |
| -#ifdef CHROME_V8 |
|
Charlie Reis
2011/08/25 18:32:20
This ifdef is apparently stale, so this test hasn'
Mihai Parparita -not on Chrome
2011/08/25 18:44:55
Not necessarily in this CL, but were you planning
Charlie Reis
2011/08/25 18:56:53
I actually don't know much about the history of CH
|
| -TEST_F(BrowserTest, NullOpenerRedirectForksProcess) { |
| - net::TestServer test_server(net::TestServer::TYPE_HTTP, |
| - FilePath(FILE_PATH_LITERAL("chrome/test/data"))); |
| - ASSERT_TRUE(test_server.Start()); |
| - |
| - FilePath test_file(test_data_directory_); |
| - scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); |
| - ASSERT_TRUE(window.get()); |
| - scoped_refptr<TabProxy> tab(window->GetActiveTab()); |
| - ASSERT_TRUE(tab.get()); |
| - |
| - // Start with a file:// url |
| - test_file = test_file.AppendASCII("title2.html"); |
| - tab->NavigateToURL(net::FilePathToFileURL(test_file)); |
| - int orig_tab_count = -1; |
| - ASSERT_TRUE(window->GetTabCount(&orig_tab_count)); |
| - int orig_process_count = 0; |
| - ASSERT_TRUE(GetBrowserProcessCount(&orig_process_count)); |
| - ASSERT_GE(orig_process_count, 1); |
| - |
| - // Use JavaScript URL to "fork" a new tab, just like Gmail. (Open tab to a |
| - // blank page, set its opener to null, and redirect it cross-site.) |
| - std::wstring url_prefix(L"javascript:(function(){w=window.open();"); |
| - GURL fork_url(url_prefix + |
| - L"w.opener=null;w.document.location=\"http://localhost:1337\";})()"); |
| - |
| - // Make sure that a new tab has been created and that we have a new renderer |
| - // process for it. |
| - ASSERT_TRUE(tab->NavigateToURLAsync(fork_url)); |
| - PlatformThread::Sleep(TestTimeouts::action_timeout_ms()); |
| - int process_count = 0; |
| - ASSERT_TRUE(GetBrowserProcessCount(&process_count)); |
| - ASSERT_EQ(orig_process_count + 1, process_count); |
| - int new_tab_count = -1; |
| - ASSERT_TRUE(window->GetTabCount(&new_tab_count)); |
| - ASSERT_EQ(orig_tab_count + 1, new_tab_count); |
| -} |
| -#endif // CHROME_V8 |
| - |
| -// This test fails on ChromeOS (it has never been known to work on it). |
| -// Currently flaky on Windows - it has crashed a couple of times. |
| -// http://crbug.com/32799 |
| -#if defined(OS_CHROMEOS) |
| -#define MAYBE_OtherRedirectsDontForkProcess DISABLED_OtherRedirectsDontForkProcess |
| -#else |
| -#define MAYBE_OtherRedirectsDontForkProcess FLAKY_OtherRedirectsDontForkProcess |
| -#endif |
|
Charlie Reis
2011/08/25 18:32:20
Hoping the move to browsertests resolves this flak
Paweł Hajdan Jr.
2011/08/25 18:34:56
Ha ha, it's not that it magically solves all probl
Charlie Reis
2011/08/25 18:44:45
Well, at least it's a chance to get rid of things
|
| - |
| -// Tests that non-Gmail-like script redirects (i.e., non-null window.opener) or |
| -// a same-page-redirect) will not fork a new process. |
| -TEST_F(BrowserTest, MAYBE_OtherRedirectsDontForkProcess) { |
| - net::TestServer test_server(net::TestServer::TYPE_HTTP, |
| - FilePath(FILE_PATH_LITERAL("chrome/test/data"))); |
| - ASSERT_TRUE(test_server.Start()); |
| - |
| - FilePath test_file(test_data_directory_); |
| - scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); |
| - ASSERT_TRUE(window.get()); |
| - scoped_refptr<TabProxy> tab(window->GetActiveTab()); |
| - ASSERT_TRUE(tab.get()); |
| - |
| - // Start with a file:// url |
| - test_file = test_file.AppendASCII("title2.html"); |
| - ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS, |
| - tab->NavigateToURL(net::FilePathToFileURL(test_file))); |
| - int orig_tab_count = -1; |
| - ASSERT_TRUE(window->GetTabCount(&orig_tab_count)); |
| - int orig_process_count = 0; |
| - ASSERT_TRUE(GetBrowserProcessCount(&orig_process_count)); |
| - ASSERT_GE(orig_process_count, 1); |
| - |
| - // Use JavaScript URL to almost fork a new tab, but not quite. (Leave the |
| - // opener non-null.) Should not fork a process. |
| - std::string url_str = "javascript:(function(){w=window.open(); "; |
| - url_str += "w.document.location=\""; |
| - url_str += test_server.GetURL("").spec(); |
| - url_str += "\";})()"; |
| - GURL dont_fork_url(url_str); |
| - |
| - // Make sure that a new tab but not new process has been created. |
| - ASSERT_TRUE(tab->NavigateToURLAsync(dont_fork_url)); |
| - base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms()); |
| - int process_count = 0; |
| - ASSERT_TRUE(GetBrowserProcessCount(&process_count)); |
| - ASSERT_EQ(orig_process_count, process_count); |
| - int new_tab_count = -1; |
| - ASSERT_TRUE(window->GetTabCount(&new_tab_count)); |
| - ASSERT_EQ(orig_tab_count + 1, new_tab_count); |
| - |
| - // Same thing if the current tab tries to redirect itself. |
| - url_str = "javascript:(function(){w=window.open(); "; |
| - url_str += "document.location=\""; |
| - url_str += test_server.GetURL("").spec(); |
| - url_str += "\";})()"; |
| - GURL dont_fork_url2(url_str); |
| - |
| - // Make sure that no new process has been created. |
| - ASSERT_TRUE(tab->NavigateToURLAsync(dont_fork_url2)); |
| - base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms()); |
| - ASSERT_TRUE(GetBrowserProcessCount(&process_count)); |
| - ASSERT_EQ(orig_process_count, process_count); |
| -} |
| - |
| // WindowOpenClose is flaky on ChromeOS and fails consistently on linux views. |
| // See http://crbug.com/85763. |
| #if defined (OS_CHROMEOS) |