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

Unified Diff: chrome/browser/session_history_uitest.cc

Issue 16490: Add FTP unit test in preparation for portable FTP implementation.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years 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
Index: chrome/browser/session_history_uitest.cc
===================================================================
--- chrome/browser/session_history_uitest.cc (revision 7499)
+++ chrome/browser/session_history_uitest.cc (working copy)
@@ -107,22 +107,24 @@
} // namespace
TEST_F(SessionHistoryTest, BasicBackForward) {
- TestServer server(kDocRoot);
+ scoped_refptr<HTTPTestServer> server =
+ HTTPTestServer::CreateServer(kDocRoot);
+ ASSERT_TRUE(NULL != server.get());
// about:blank should be loaded first.
ASSERT_FALSE(tab_->GoBack());
EXPECT_EQ(L"", GetTabTitle());
ASSERT_TRUE(tab_->NavigateToURL(
- server.TestServerPage("files/session_history/bot1.html")));
+ server->TestServerPage("files/session_history/bot1.html")));
EXPECT_EQ(L"bot1", GetTabTitle());
ASSERT_TRUE(tab_->NavigateToURL(
- server.TestServerPage("files/session_history/bot2.html")));
+ server->TestServerPage("files/session_history/bot2.html")));
EXPECT_EQ(L"bot2", GetTabTitle());
ASSERT_TRUE(tab_->NavigateToURL(
- server.TestServerPage("files/session_history/bot3.html")));
+ server->TestServerPage("files/session_history/bot3.html")));
EXPECT_EQ(L"bot3", GetTabTitle());
// history is [blank, bot1, bot2, *bot3]
@@ -140,7 +142,7 @@
EXPECT_EQ(L"bot1", GetTabTitle());
ASSERT_TRUE(tab_->NavigateToURL(
- server.TestServerPage("files/session_history/bot3.html")));
+ server->TestServerPage("files/session_history/bot3.html")));
EXPECT_EQ(L"bot3", GetTabTitle());
// history is [blank, bot1, *bot3]
@@ -171,7 +173,9 @@
if (win_util::GetWinVersion() <= win_util::WINVERSION_2000)
return;
- TestServer server(kDocRoot);
+ scoped_refptr<HTTPTestServer> server =
+ HTTPTestServer::CreateServer(kDocRoot);
+ ASSERT_TRUE(NULL != server.get());
// about:blank should be loaded first.
GURL home(homepage_);
@@ -179,7 +183,7 @@
EXPECT_EQ(L"", GetTabTitle());
EXPECT_EQ(home, GetTabURL());
- GURL frames(server.TestServerPage("files/session_history/frames.html"));
+ GURL frames(server->TestServerPage("files/session_history/frames.html"));
ASSERT_TRUE(tab_->NavigateToURL(frames));
EXPECT_EQ(L"bot1", GetTabTitle());
EXPECT_EQ(frames, GetTabURL());
@@ -235,13 +239,15 @@
// Test that back/forward preserves POST data and document state in subframes.
TEST_F(SessionHistoryTest, FrameFormBackForward) {
- TestServer server(kDocRoot);
+ scoped_refptr<HTTPTestServer> server =
+ HTTPTestServer::CreateServer(kDocRoot);
+ ASSERT_TRUE(NULL != server.get());
// about:blank should be loaded first.
ASSERT_FALSE(tab_->GoBack());
EXPECT_EQ(L"", GetTabTitle());
- GURL frames(server.TestServerPage("files/session_history/frames.html"));
+ GURL frames(server->TestServerPage("files/session_history/frames.html"));
ASSERT_TRUE(tab_->NavigateToURL(frames));
EXPECT_EQ(L"bot1", GetTabTitle());
@@ -295,13 +301,15 @@
// Test that back/forward preserves POST data and document state when navigating
// across frames (ie, from frame -> nonframe).
TEST_F(SessionHistoryTest, CrossFrameFormBackForward) {
- TestServer server(kDocRoot);
+ scoped_refptr<HTTPTestServer> server =
+ HTTPTestServer::CreateServer(kDocRoot);
+ ASSERT_TRUE(NULL != server.get());
// about:blank should be loaded first.
ASSERT_FALSE(tab_->GoBack());
EXPECT_EQ(L"", GetTabTitle());
- GURL frames(server.TestServerPage("files/session_history/frames.html"));
+ GURL frames(server->TestServerPage("files/session_history/frames.html"));
ASSERT_TRUE(tab_->NavigateToURL(frames));
EXPECT_EQ(L"bot1", GetTabTitle());
@@ -337,16 +345,18 @@
}
#endif
-// Test that back/forward entries are created for reference fragment navigations.
-// Bug 730379.
+// Test that back/forward entries are created for reference fragment
+// navigations. Bug 730379.
TEST_F(SessionHistoryTest, FragmentBackForward) {
- TestServer server(kDocRoot);
+ scoped_refptr<HTTPTestServer> server =
+ HTTPTestServer::CreateServer(kDocRoot);
+ ASSERT_TRUE(NULL != server.get());
// about:blank should be loaded first.
ASSERT_FALSE(tab_->GoBack());
EXPECT_EQ(L"", GetTabTitle());
- GURL fragment(server.TestServerPage("files/session_history/fragment.html"));
+ GURL fragment(server->TestServerPage("files/session_history/fragment.html"));
ASSERT_TRUE(tab_->NavigateToURL(fragment));
EXPECT_EQ(L"fragment", GetTabTitle());
EXPECT_EQ(fragment, GetTabURL());
@@ -385,7 +395,7 @@
ASSERT_TRUE(tab_->GoForward());
EXPECT_EQ(fragment_a, GetTabURL());
- GURL bot3(server.TestServerPage("files/session_history/bot3.html"));
+ GURL bot3(server->TestServerPage("files/session_history/bot3.html"));
ASSERT_TRUE(tab_->NavigateToURL(bot3));
EXPECT_EQ(L"bot3", GetTabTitle());
EXPECT_EQ(bot3, GetTabURL());
@@ -408,22 +418,24 @@
// means the test will hang if it attempts to navigate too far forward or back,
// since we'll be waiting forever for a load stop event.
TEST_F(SessionHistoryTest, JavascriptHistory) {
- TestServer server(kDocRoot);
+ scoped_refptr<HTTPTestServer> server =
+ HTTPTestServer::CreateServer(kDocRoot);
+ ASSERT_TRUE(NULL != server.get());
// about:blank should be loaded first.
ASSERT_FALSE(tab_->GoBack());
EXPECT_EQ(L"", GetTabTitle());
ASSERT_TRUE(tab_->NavigateToURL(
- server.TestServerPage("files/session_history/bot1.html")));
+ server->TestServerPage("files/session_history/bot1.html")));
EXPECT_EQ(L"bot1", GetTabTitle());
ASSERT_TRUE(tab_->NavigateToURL(
- server.TestServerPage("files/session_history/bot2.html")));
+ server->TestServerPage("files/session_history/bot2.html")));
EXPECT_EQ(L"bot2", GetTabTitle());
ASSERT_TRUE(tab_->NavigateToURL(
- server.TestServerPage("files/session_history/bot3.html")));
+ server->TestServerPage("files/session_history/bot3.html")));
EXPECT_EQ(L"bot3", GetTabTitle());
// history is [blank, bot1, bot2, *bot3]
@@ -455,7 +467,7 @@
EXPECT_EQ(L"bot1", GetTabTitle());
ASSERT_TRUE(tab_->NavigateToURL(
- server.TestServerPage("files/session_history/bot3.html")));
+ server->TestServerPage("files/session_history/bot3.html")));
EXPECT_EQ(L"bot3", GetTabTitle());
// history is [blank, bot1, *bot3]
@@ -489,10 +501,12 @@
TEST_F(SessionHistoryTest, LocationReplace) {
// Test that using location.replace doesn't leave the title of the old page
// visible.
- TestServer server(kDocRoot);
+ scoped_refptr<HTTPTestServer> server =
+ HTTPTestServer::CreateServer(kDocRoot);
+ ASSERT_TRUE(NULL != server.get());
- ASSERT_TRUE(tab_->NavigateToURL(
- server.TestServerPage("files/session_history/replace.html?no-title.html")));
+ ASSERT_TRUE(tab_->NavigateToURL(server->TestServerPage(
+ "files/session_history/replace.html?no-title.html")));
EXPECT_EQ(L"", GetTabTitle());
}
« no previous file with comments | « chrome/browser/renderer_host/resource_dispatcher_host_uitest.cc ('k') | chrome/browser/sessions/session_restore_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698