diff options
author | erikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-30 21:49:21 +0000 |
---|---|---|
committer | erikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-30 21:49:21 +0000 |
commit | baf9e25f103eb1138fcd41d917728faee80e62e2 (patch) | |
tree | 8d9b78fc3afb7e9c79570873b2c7d5529d1a02be /chrome/browser/interstitial_page_uitest.cc | |
parent | 1ea316d7174804dd49c43fe4abcb15620b248634 (diff) | |
download | chromium_src-baf9e25f103eb1138fcd41d917728faee80e62e2.zip chromium_src-baf9e25f103eb1138fcd41d917728faee80e62e2.tar.gz chromium_src-baf9e25f103eb1138fcd41d917728faee80e62e2.tar.bz2 |
Add FTP unit test in preparation for portable FTP implementation.
Clean up test server code.
Originally from issue 12939, written by Ibrar Ahmed (ibrar.ahmed@gmail.com)
Review URL: http://codereview.chromium.org/16490
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7508 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/interstitial_page_uitest.cc')
-rw-r--r-- | chrome/browser/interstitial_page_uitest.cc | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/chrome/browser/interstitial_page_uitest.cc b/chrome/browser/interstitial_page_uitest.cc index a50908c9..c3d675c 100644 --- a/chrome/browser/interstitial_page_uitest.cc +++ b/chrome/browser/interstitial_page_uitest.cc @@ -52,10 +52,13 @@ class InterstitialPageTest : public UITest { // causes the actual navigation entry (title) to be modified by the content of // the interstitial. TEST_F(InterstitialPageTest, TestShowHideInterstitial) { - TestServer server(kDocRoot); + scoped_refptr<HTTPTestServer> server = + HTTPTestServer::CreateServer(kDocRoot); + ASSERT_TRUE(NULL != server.get()); + ::scoped_ptr<TabProxy> tab(GetActiveTabProxy()); NavigateTab(tab.get(), - server.TestServerPageW(L"files/interstitial_page/google.html")); + server->TestServerPageW(L"files/interstitial_page/google.html")); NavigationEntry::PageType page_type; EXPECT_TRUE(tab->GetPageType(&page_type)); EXPECT_EQ(NavigationEntry::NORMAL_PAGE, page_type); @@ -78,10 +81,13 @@ TEST_F(InterstitialPageTest, TestShowHideInterstitial) { // the interstitial. In the mean time, we are treating Back like cancelling // the interstitial, which breaks this test because no notification occurs. TEST_F(InterstitialPageTest, DISABLED_TestShowInterstitialThenBack) { - TestServer server(kDocRoot); + scoped_refptr<HTTPTestServer> server = + HTTPTestServer::CreateServer(kDocRoot); + ASSERT_TRUE(NULL != server.get()); + ::scoped_ptr<TabProxy> tab(GetActiveTabProxy()); NavigateTab(tab.get(), - server.TestServerPageW(L"files/interstitial_page/google.html")); + server->TestServerPageW(L"files/interstitial_page/google.html")); EXPECT_EQ(L"Google", GetActiveTabTitle()); tab->ShowInterstitialPage(kInterstitialPageHTMLText, action_timeout_ms()); @@ -94,26 +100,31 @@ TEST_F(InterstitialPageTest, DISABLED_TestShowInterstitialThenBack) { // Shows an interstitial page then navigates to a new URL. // Flacky on Windows 2000 bot. Disabled for now bug #1173138. TEST_F(InterstitialPageTest, DISABLED_TestShowInterstitialThenNavigate) { - TestServer server(kDocRoot); + scoped_refptr<HTTPTestServer> server = + HTTPTestServer::CreateServer(kDocRoot); + ASSERT_TRUE(NULL != server.get()); + ::scoped_ptr<TabProxy> tab(GetActiveTabProxy()); NavigateTab(tab.get(), - server.TestServerPageW(L"files/interstitial_page/google.html")); + server->TestServerPageW(L"files/interstitial_page/google.html")); EXPECT_EQ(L"Google", GetActiveTabTitle()); tab->ShowInterstitialPage(kInterstitialPageHTMLText, action_timeout_ms()); EXPECT_EQ(L"Interstitial page", GetActiveTabTitle()); tab->NavigateToURL( - server.TestServerPageW(L"files/interstitial_page/shopping.html")); + server->TestServerPageW(L"files/interstitial_page/shopping.html")); EXPECT_EQ(L"Google Product Search", GetActiveTabTitle()); } // Shows an interstitial page then closes the tab (to make sure we don't crash). TEST_F(InterstitialPageTest, TestShowInterstitialThenCloseTab) { - TestServer server(kDocRoot); + scoped_refptr<HTTPTestServer> server = + HTTPTestServer::CreateServer(kDocRoot); + ASSERT_TRUE(NULL != server.get()); // Create 2 tabs so closing one does not close the browser. - AppendTab(server.TestServerPageW(L"files/interstitial_page/google.html")); + AppendTab(server->TestServerPageW(L"files/interstitial_page/google.html")); ::scoped_ptr<TabProxy> tab(GetActiveTabProxy()); EXPECT_EQ(L"Google", GetActiveTabTitle()); @@ -126,11 +137,13 @@ TEST_F(InterstitialPageTest, TestShowInterstitialThenCloseTab) { // crash). // This test is disabled. See bug #1119448. TEST_F(InterstitialPageTest, DISABLED_TestShowInterstitialThenCloseBrowser) { - TestServer server(kDocRoot); + scoped_refptr<HTTPTestServer> server = + HTTPTestServer::CreateServer(kDocRoot); + ASSERT_TRUE(NULL != server.get()); ::scoped_ptr<TabProxy> tab(GetActiveTabProxy()); tab->NavigateToURL( - server.TestServerPageW(L"files/interstitial_page/google.html")); + server->TestServerPageW(L"files/interstitial_page/google.html")); EXPECT_EQ(L"Google", GetActiveTabTitle()); tab->ShowInterstitialPage(kInterstitialPageHTMLText, action_timeout_ms()); |