summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui
diff options
context:
space:
mode:
authorcreis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-06 00:45:18 +0000
committercreis@chromium.org <creis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-06 00:45:18 +0000
commit0d220839eeeb94724f785b7c030c80e2b9e2cc4b (patch)
tree6ca17c31714243193b6ea862d4408e303d8cc477 /chrome/browser/dom_ui
parentdef1171cbb6c8857fd528736eb20dad5a3b50ecb (diff)
downloadchromium_src-0d220839eeeb94724f785b7c030c80e2b9e2cc4b.zip
chromium_src-0d220839eeeb94724f785b7c030c80e2b9e2cc4b.tar.gz
chromium_src-0d220839eeeb94724f785b7c030c80e2b9e2cc4b.tar.bz2
Fixes navigations chrome-internal: to actually show the NTP.
We now rewrite chrome-internal: (the old NTP URL) to chrome://newtab. Before, we were not properly showing the NTP for this URL, which caused some problems with further navigations (particularly form submissions) from that tab. Also, the default kHomePage string is now chrome://newtab instead of the outdated chrome-internal:. The logic in GeneralPageView is already designed to not show this URL in the preferences dialog. BUG=6564 TEST=NewTabUITest.ChromeInternalLoadsNTP Review URL: http://codereview.chromium.org/363019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31182 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r--chrome/browser/dom_ui/new_tab_ui_uitest.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/chrome/browser/dom_ui/new_tab_ui_uitest.cc b/chrome/browser/dom_ui/new_tab_ui_uitest.cc
index 83a5ef7..14cda31 100644
--- a/chrome/browser/dom_ui/new_tab_ui_uitest.cc
+++ b/chrome/browser/dom_ui/new_tab_ui_uitest.cc
@@ -59,6 +59,29 @@ TEST_F(NewTabUITest, NTPHasThumbnails) {
EXPECT_EQ(0, filler_thumbnails_count);
}
+TEST_F(NewTabUITest, ChromeInternalLoadsNTP) {
+ scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0));
+ ASSERT_TRUE(window.get());
+
+ int tab_count = -1;
+ ASSERT_TRUE(window->GetTabCount(&tab_count));
+ ASSERT_EQ(1, tab_count);
+
+ // Go to the "new tab page" using its old url, rather than chrome://newtab.
+ scoped_refptr<TabProxy> tab = window->GetTab(0);
+ tab->NavigateToURLAsync(GURL("chrome-internal:"));
+ int load_time;
+ ASSERT_TRUE(automation()->WaitForInitialNewTabUILoad(&load_time));
+
+ // Ensure there are some thumbnails loaded in the page.
+ int thumbnails_count = -1;
+ ASSERT_TRUE(tab->ExecuteAndExtractInt(L"",
+ L"window.domAutomationController.send("
+ L"document.getElementsByClassName('thumbnail-container').length)",
+ &thumbnails_count));
+ EXPECT_GT(thumbnails_count, 0);
+}
+
TEST_F(NewTabUITest, UpdateUserPrefsVersion) {
PrefService prefs((FilePath()));