diff options
author | erikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-08 20:45:27 +0000 |
---|---|---|
committer | erikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-08 20:45:27 +0000 |
commit | dd26501ef315e241911a31a8a98027c9bbb65560 (patch) | |
tree | 1c02dfce0035199f0c073ebf793607d6e7934be5 /chrome/browser/views/find_bar_win_uitest.cc | |
parent | 7ecec17feb965bab7cd348ab16a9da8d772f70dc (diff) | |
download | chromium_src-dd26501ef315e241911a31a8a98027c9bbb65560.zip chromium_src-dd26501ef315e241911a31a8a98027c9bbb65560.tar.gz chromium_src-dd26501ef315e241911a31a8a98027c9bbb65560.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)
(take 2)
Review URL: http://codereview.chromium.org/17040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7755 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/find_bar_win_uitest.cc')
-rw-r--r-- | chrome/browser/views/find_bar_win_uitest.cc | 54 |
1 files changed, 36 insertions, 18 deletions
diff --git a/chrome/browser/views/find_bar_win_uitest.cc b/chrome/browser/views/find_bar_win_uitest.cc index ac534b4..94906b8 100644 --- a/chrome/browser/views/find_bar_win_uitest.cc +++ b/chrome/browser/views/find_bar_win_uitest.cc @@ -25,10 +25,12 @@ const std::wstring kTooFewMatchesPage = L"files/find_in_page/bug_1155639.html"; // This test loads a page with frames and starts FindInPage requests TEST_F(FindInPageControllerTest, FindInPageFrames) { - TestServer server(L"chrome/test/data"); + scoped_refptr<HTTPTestServer> server = + HTTPTestServer::CreateServer(L"chrome/test/data"); + ASSERT_TRUE(NULL != server.get()); // First we navigate to our frames page. - GURL url = server.TestServerPageW(kFramePage); + GURL url = server->TestServerPageW(kFramePage); scoped_ptr<TabProxy> tab(GetActiveTab()); ASSERT_TRUE(tab->NavigateToURL(url)); WaitUntilTabCount(1); @@ -76,10 +78,12 @@ TEST_F(FindInPageControllerTest, FindInPageFrames) { // This test loads a single-frame page and makes sure the ordinal returned makes // sense as we FindNext over all the items. TEST_F(FindInPageControllerTest, FindInPageOrdinal) { - TestServer server(L"chrome/test/data"); + scoped_refptr<HTTPTestServer> server = + HTTPTestServer::CreateServer(L"chrome/test/data"); + ASSERT_TRUE(NULL != server.get()); // First we navigate to our frames page. - GURL url = server.TestServerPageW(kFrameData); + GURL url = server->TestServerPageW(kFrameData); scoped_ptr<TabProxy> tab(GetActiveTab()); ASSERT_TRUE(tab->NavigateToURL(url)); WaitUntilTabCount(1); @@ -112,10 +116,12 @@ TEST_F(FindInPageControllerTest, FindInPageOrdinal) { // This test loads a page with frames and makes sure the ordinal returned makes // sense. TEST_F(FindInPageControllerTest, FindInPageMultiFramesOrdinal) { - TestServer server(L"chrome/test/data"); + scoped_refptr<HTTPTestServer> server = + HTTPTestServer::CreateServer(L"chrome/test/data"); + ASSERT_TRUE(NULL != server.get()); // First we navigate to our frames page. - GURL url = server.TestServerPageW(kFramePage); + GURL url = server->TestServerPageW(kFramePage); scoped_ptr<TabProxy> tab(GetActiveTab()); ASSERT_TRUE(tab->NavigateToURL(url)); WaitUntilTabCount(1); @@ -156,10 +162,12 @@ TEST_F(FindInPageControllerTest, FindInPageMultiFramesOrdinal) { // We could get ordinals out of whack when restarting search in subframes. // See http://crbug.com/5132 TEST_F(FindInPageControllerTest, FindInPage_Issue5132) { - TestServer server(L"chrome/test/data"); + scoped_refptr<HTTPTestServer> server = + HTTPTestServer::CreateServer(L"chrome/test/data"); + ASSERT_TRUE(NULL != server.get()); // First we navigate to our frames page. - GURL url = server.TestServerPageW(kFramePage); + GURL url = server->TestServerPageW(kFramePage); scoped_ptr<TabProxy> tab(GetActiveTab()); ASSERT_TRUE(tab->NavigateToURL(url)); WaitUntilTabCount(1); @@ -185,9 +193,11 @@ TEST_F(FindInPageControllerTest, FindInPage_Issue5132) { // Load a page with no selectable text and make sure we don't crash. TEST_F(FindInPageControllerTest, FindUnSelectableText) { - TestServer server(L"chrome/test/data"); + scoped_refptr<HTTPTestServer> server = + HTTPTestServer::CreateServer(L"chrome/test/data"); + ASSERT_TRUE(NULL != server.get()); - GURL url = server.TestServerPageW(kUserSelectPage); + GURL url = server->TestServerPageW(kUserSelectPage); scoped_ptr<TabProxy> tab(GetActiveTab()); ASSERT_TRUE(tab->NavigateToURL(url)); WaitUntilTabCount(1); @@ -199,9 +209,11 @@ TEST_F(FindInPageControllerTest, FindUnSelectableText) { // Try to reproduce the crash seen in issue 1341577. TEST_F(FindInPageControllerTest, FindCrash_Issue1341577) { - TestServer server(L"chrome/test/data"); + scoped_refptr<HTTPTestServer> server = + HTTPTestServer::CreateServer(L"chrome/test/data"); + ASSERT_TRUE(NULL != server.get()); - GURL url = server.TestServerPageW(kCrashPage); + GURL url = server->TestServerPageW(kCrashPage); scoped_ptr<TabProxy> tab(GetActiveTab()); ASSERT_TRUE(tab->NavigateToURL(url)); WaitUntilTabCount(1); @@ -229,9 +241,11 @@ TEST_F(FindInPageControllerTest, FindCrash_Issue1341577) { // ms) to find one or more of those matches (so Find times out and has to try // again from where it left off). TEST_F(FindInPageControllerTest, FindEnoughMatches_Issue1155639) { - TestServer server(L"chrome/test/data"); + scoped_refptr<HTTPTestServer> server = + HTTPTestServer::CreateServer(L"chrome/test/data"); + ASSERT_TRUE(NULL != server.get()); - GURL url = server.TestServerPageW(kTooFewMatchesPage); + GURL url = server->TestServerPageW(kTooFewMatchesPage); scoped_ptr<TabProxy> tab(GetActiveTab()); ASSERT_TRUE(tab->NavigateToURL(url)); WaitUntilTabCount(1); @@ -244,9 +258,11 @@ TEST_F(FindInPageControllerTest, FindEnoughMatches_Issue1155639) { // The find window should not change its location just because we open and close // a new tab. TEST_F(FindInPageControllerTest, FindMovesOnTabClose_Issue1343052) { - TestServer server(L"chrome/test/data"); + scoped_refptr<HTTPTestServer> server = + HTTPTestServer::CreateServer(L"chrome/test/data"); + ASSERT_TRUE(NULL != server.get()); - GURL url = server.TestServerPageW(kFramePage); + GURL url = server->TestServerPageW(kFramePage); scoped_ptr<TabProxy> tabA(GetActiveTab()); ASSERT_TRUE(tabA->NavigateToURL(url)); WaitUntilTabCount(1); @@ -303,9 +319,11 @@ TEST_F(FindInPageControllerTest, FindMovesOnTabClose_Issue1343052) { // Make sure Find box disappears on Navigate but not on Refresh. TEST_F(FindInPageControllerTest, FindDisappearOnNavigate) { - TestServer server(L"chrome/test/data"); + scoped_refptr<HTTPTestServer> server = + HTTPTestServer::CreateServer(L"chrome/test/data"); + ASSERT_TRUE(NULL != server.get()); - GURL url = server.TestServerPageW(kUserSelectPage); + GURL url = server->TestServerPageW(kUserSelectPage); scoped_ptr<TabProxy> tab(GetActiveTab()); ASSERT_TRUE(tab->NavigateToURL(url)); WaitUntilTabCount(1); |