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

Unified Diff: chrome/browser/dom_ui/new_tab_ui_uitest.cc

Issue 4862002: Prevent a crash when visiting about:hang in two NTPs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix indent Created 10 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 | « chrome/browser/dom_ui/dom_ui_factory.cc ('k') | chrome/browser/tab_contents/render_view_host_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
« no previous file with comments | « chrome/browser/dom_ui/dom_ui_factory.cc ('k') | chrome/browser/tab_contents/render_view_host_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698