| Index: chrome/browser/dom_ui/new_tab_ui_uitest.cc
|
| diff --git a/chrome/browser/dom_ui/new_tab_ui_uitest.cc b/chrome/browser/dom_ui/new_tab_ui_uitest.cc
|
| index 5be42f5c6b20937904c112034f7cba6a13e97b0a..f50e179bbd09864b85affaf941d9b6d2fc9ca8f3 100644
|
| --- a/chrome/browser/dom_ui/new_tab_ui_uitest.cc
|
| +++ b/chrome/browser/dom_ui/new_tab_ui_uitest.cc
|
| @@ -11,6 +11,7 @@
|
| #include "chrome/browser/sync/signin_manager.h"
|
| #include "chrome/common/json_pref_store.h"
|
| #include "chrome/common/pref_names.h"
|
| +#include "chrome/common/url_constants.h"
|
| #include "chrome/test/automation/browser_proxy.h"
|
| #include "chrome/test/automation/tab_proxy.h"
|
| #include "chrome/test/automation/window_proxy.h"
|
| @@ -83,6 +84,30 @@ TEST_F(NewTabUITest, NTPHasLoginName) {
|
| EXPECT_EQ(L"user@gmail.com", displayed_username);
|
| }
|
|
|
| +// Loads about:hang into two NTP tabs, ensuring we don't crash.
|
| +// See http://crbug.com/59859.
|
| +TEST_F(NewTabUITest, AboutHangInNTP) {
|
| + scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0));
|
| + ASSERT_TRUE(window.get());
|
| +
|
| + // Bring up a new tab page.
|
| + ASSERT_TRUE(window->RunCommand(IDC_NEW_TAB));
|
| + int load_time;
|
| + ASSERT_TRUE(automation()->WaitForInitialNewTabUILoad(&load_time));
|
| + scoped_refptr<TabProxy> tab = window->GetActiveTab();
|
| + ASSERT_TRUE(tab.get());
|
| +
|
| + // Navigate to about:hang to stall the process.
|
| + ASSERT_TRUE(tab->NavigateToURLAsync(GURL(chrome::kAboutHangURL)));
|
| +
|
| + // Visit about:hang again in another NTP. Don't bother waiting for the
|
| + // NTP to load, because it's hung.
|
| + ASSERT_TRUE(window->RunCommand(IDC_NEW_TAB));
|
| + scoped_refptr<TabProxy> tab2 = window->GetActiveTab();
|
| + ASSERT_TRUE(tab2.get());
|
| + ASSERT_TRUE(tab2->NavigateToURLAsync(GURL(chrome::kAboutHangURL)));
|
| +}
|
| +
|
| // Fails about ~5% of the time on all platforms. http://crbug.com/45001
|
| TEST_F(NewTabUITest, FLAKY_ChromeInternalLoadsNTP) {
|
| scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0));
|
|
|