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

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

Issue 6335014: Ensure that normal URLs are not loaded in the NTP process in process-per-tab. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 months 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 | 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 5caf23e195db28ca6fa657ca39b55e0ee83c199a..f912db02b148c3bf01c989e5eacf0e75b1224cde 100644
--- a/chrome/browser/dom_ui/new_tab_ui_uitest.cc
+++ b/chrome/browser/dom_ui/new_tab_ui_uitest.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/dom_ui/new_tab_ui.h"
#include "chrome/browser/prefs/pref_value_store.h"
#include "chrome/browser/sync/signin_manager.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/json_pref_store.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
@@ -109,6 +110,42 @@ TEST_F(NewTabUITest, AboutHangInNTP) {
ASSERT_TRUE(tab2->NavigateToURLAsync(GURL(chrome::kAboutHangURL)));
}
+// Allows testing NTP in process-per-tab mode.
+class NewTabUIProcessPerTabTest : public NewTabUITest {
+ public:
+ NewTabUIProcessPerTabTest() : NewTabUITest() {}
+
+ protected:
+ virtual void SetUp() {
+ launch_arguments_.AppendSwitch(switches::kProcessPerTab);
+ UITest::SetUp();
+ }
+};
+
+// Navigates away from NTP before it commits, in process-per-tab mode.
+// Ensures that we don't load the normal page in the NTP process (and thus
+// crash), as in http://crbug.com/69224.
+TEST_F(NewTabUIProcessPerTabTest, NavBeforeNTPCommits) {
+ 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 a normal URL in another NTP that hasn't committed.
+ ASSERT_TRUE(window->RunCommand(IDC_NEW_TAB));
+ scoped_refptr<TabProxy> tab2 = window->GetActiveTab();
+ ASSERT_TRUE(tab2.get());
+ ASSERT_TRUE(tab2->NavigateToURL(GURL("data:text/html,hello world")));
+}
+
// 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 | « no previous file | chrome/browser/tab_contents/render_view_host_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698