diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-17 20:07:11 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-17 20:07:11 +0000 |
commit | 95409e1020037b0bbfbce17f861d3de090d10186 (patch) | |
tree | 90a893af1247b1d4a3767c5ab14aae797f467946 /chrome/browser/repost_form_warning_uitest.cc | |
parent | 701e869b30deffda579c5c413cf1d73defee34fa (diff) | |
download | chromium_src-95409e1020037b0bbfbce17f861d3de090d10186.zip chromium_src-95409e1020037b0bbfbce17f861d3de090d10186.tar.gz chromium_src-95409e1020037b0bbfbce17f861d3de090d10186.tar.bz2 |
Test server cleanup patch of death:
- reduce the number of different classes
- clean up the internal code
- modify the interface to expose less internal details
(this will allow more flexibility with port numbers)
TEST=many
BUG=49680
Review URL: http://codereview.chromium.org/3080029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56405 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/repost_form_warning_uitest.cc')
-rw-r--r-- | chrome/browser/repost_form_warning_uitest.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/chrome/browser/repost_form_warning_uitest.cc b/chrome/browser/repost_form_warning_uitest.cc index 8f779c7..c6e9514 100644 --- a/chrome/browser/repost_form_warning_uitest.cc +++ b/chrome/browser/repost_form_warning_uitest.cc @@ -15,7 +15,7 @@ namespace { -const wchar_t kDocRoot[] = L"chrome/test/data"; +const FilePath::CharType kDocRoot[] = FILE_PATH_LITERAL("chrome/test/data"); } // namespace @@ -29,9 +29,9 @@ typedef UITest RepostFormWarningTest; #endif TEST_F(RepostFormWarningTest, MAYBE_TestDoubleReload) { - scoped_refptr<net::HTTPTestServer> server( - net::HTTPTestServer::CreateServer(kDocRoot)); - ASSERT_TRUE(NULL != server.get()); + net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot)); + ASSERT_TRUE(test_server.Start()); + scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); ASSERT_TRUE(browser.get()); @@ -39,7 +39,7 @@ TEST_F(RepostFormWarningTest, MAYBE_TestDoubleReload) { ASSERT_TRUE(tab.get()); // Load a form. - ASSERT_TRUE(tab->NavigateToURL(server->TestServerPage("files/form.html"))); + ASSERT_TRUE(tab->NavigateToURL(test_server.GetURL("files/form.html"))); // Submit it. ASSERT_TRUE(tab->NavigateToURL(GURL( "javascript:document.getElementById('form').submit()"))); @@ -49,7 +49,7 @@ TEST_F(RepostFormWarningTest, MAYBE_TestDoubleReload) { tab->ReloadAsync(); // Navigate away from the page (this is when the test usually crashes). - ASSERT_TRUE(tab->NavigateToURL(server->TestServerPage("bar"))); + ASSERT_TRUE(tab->NavigateToURL(test_server.GetURL("bar"))); } #if defined(OS_WIN) @@ -60,9 +60,9 @@ TEST_F(RepostFormWarningTest, MAYBE_TestDoubleReload) { #endif TEST_F(RepostFormWarningTest, MAYBE_TestLoginAfterRepost) { - scoped_refptr<net::HTTPTestServer> server( - net::HTTPTestServer::CreateServer(kDocRoot)); - ASSERT_TRUE(NULL != server.get()); + net::TestServer test_server(net::TestServer::TYPE_HTTP, FilePath(kDocRoot)); + ASSERT_TRUE(test_server.Start()); + scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); ASSERT_TRUE(browser.get()); @@ -70,7 +70,7 @@ TEST_F(RepostFormWarningTest, MAYBE_TestLoginAfterRepost) { ASSERT_TRUE(tab.get()); // Load a form. - ASSERT_TRUE(tab->NavigateToURL(server->TestServerPage("files/form.html"))); + ASSERT_TRUE(tab->NavigateToURL(test_server.GetURL("files/form.html"))); // Submit it. ASSERT_TRUE(tab->NavigateToURL(GURL( "javascript:document.getElementById('form').submit()"))); @@ -80,11 +80,11 @@ TEST_F(RepostFormWarningTest, MAYBE_TestLoginAfterRepost) { // Navigate to a page that requires authentication, bringing up another // tab-modal sheet. - ASSERT_TRUE(tab->NavigateToURL(server->TestServerPage("auth-basic"))); + ASSERT_TRUE(tab->NavigateToURL(test_server.GetURL("auth-basic"))); // Try to reload it again. tab->ReloadAsync(); // Navigate away from the page. - ASSERT_TRUE(tab->NavigateToURL(server->TestServerPage("bar"))); + ASSERT_TRUE(tab->NavigateToURL(test_server.GetURL("bar"))); } |