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

Unified Diff: chrome/browser/login_prompt_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
« no previous file with comments | « chrome/browser/interstitial_page_uitest.cc ('k') | chrome/browser/printing/printing_layout_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/login_prompt_uitest.cc
===================================================================
--- chrome/browser/login_prompt_uitest.cc (revision 7499)
+++ chrome/browser/login_prompt_uitest.cc (working copy)
@@ -62,9 +62,11 @@
// Test that "Basic" HTTP authentication works.
TEST_F(LoginPromptTest, TestBasicAuth) {
- 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"auth-basic"));
+ NavigateTab(tab.get(), server->TestServerPageW(L"auth-basic"));
EXPECT_TRUE(tab->NeedsAuth());
EXPECT_FALSE(tab->SetAuth(username_basic_, password_bad_));
@@ -72,7 +74,7 @@
EXPECT_TRUE(tab->CancelAuth());
EXPECT_EQ(L"Denied: wrong password", GetActiveTabTitle());
- NavigateTab(tab.get(), server.TestServerPageW(L"auth-basic"));
+ NavigateTab(tab.get(), server->TestServerPageW(L"auth-basic"));
EXPECT_TRUE(tab->NeedsAuth());
EXPECT_TRUE(tab->SetAuth(username_basic_, password_));
@@ -82,16 +84,18 @@
// Test that "Digest" HTTP authentication works.
TEST_F(LoginPromptTest, TestDigestAuth) {
- 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"auth-digest"));
+ NavigateTab(tab.get(), server->TestServerPageW(L"auth-digest"));
EXPECT_TRUE(tab->NeedsAuth());
EXPECT_FALSE(tab->SetAuth(username_digest_, password_bad_));
EXPECT_TRUE(tab->CancelAuth());
EXPECT_EQ(L"Denied: wrong password", GetActiveTabTitle());
- NavigateTab(tab.get(), server.TestServerPageW(L"auth-digest"));
+ NavigateTab(tab.get(), server->TestServerPageW(L"auth-digest"));
EXPECT_TRUE(tab->NeedsAuth());
EXPECT_TRUE(tab->SetAuth(username_digest_, password_));
@@ -101,14 +105,16 @@
// Test that logging in on 2 tabs at once works.
TEST_F(LoginPromptTest, TestTwoAuths) {
- TestServer server(kDocRoot);
+ scoped_refptr<HTTPTestServer> server =
+ HTTPTestServer::CreateServer(kDocRoot);
+ ASSERT_TRUE(NULL != server.get());
::scoped_ptr<TabProxy> basic_tab(GetActiveTabProxy());
- NavigateTab(basic_tab.get(), server.TestServerPageW(L"auth-basic"));
+ NavigateTab(basic_tab.get(), server->TestServerPageW(L"auth-basic"));
AppendTab(GURL("about:blank"));
::scoped_ptr<TabProxy> digest_tab(GetActiveTabProxy());
- NavigateTab(digest_tab.get(), server.TestServerPageW(L"auth-digest"));
+ NavigateTab(digest_tab.get(), server->TestServerPageW(L"auth-digest"));
// TODO(devint): http://b/1158262 basic_tab is not active, so this logs in to
// a page whose tab isn't active, which isn't actually possible for the user
@@ -129,34 +135,36 @@
// Test that cancelling authentication works.
TEST_F(LoginPromptTest, TestCancelAuth) {
- TestServer server(kDocRoot);
+ scoped_refptr<HTTPTestServer> server =
+ HTTPTestServer::CreateServer(kDocRoot);
+ ASSERT_TRUE(NULL != server.get());
::scoped_ptr<TabProxy> tab(GetActiveTabProxy());
// First navigate to a test server page so we have something to go back to.
- EXPECT_TRUE(tab->NavigateToURL(server.TestServerPageW(L"a")));
+ EXPECT_TRUE(tab->NavigateToURL(server->TestServerPageW(L"a")));
// Navigating while auth is requested is the same as cancelling.
- NavigateTab(tab.get(), server.TestServerPageW(L"auth-basic"));
+ NavigateTab(tab.get(), server->TestServerPageW(L"auth-basic"));
EXPECT_TRUE(tab->NeedsAuth());
- EXPECT_TRUE(tab->NavigateToURL(server.TestServerPageW(L"b")));
+ EXPECT_TRUE(tab->NavigateToURL(server->TestServerPageW(L"b")));
EXPECT_FALSE(tab->NeedsAuth());
- NavigateTab(tab.get(), server.TestServerPageW(L"auth-basic"));
+ NavigateTab(tab.get(), server->TestServerPageW(L"auth-basic"));
EXPECT_TRUE(tab->NeedsAuth());
EXPECT_TRUE(tab->GoBack()); // should bring us back to 'a'
EXPECT_FALSE(tab->NeedsAuth());
// Now add a page and go back, so we have something to go forward to.
- EXPECT_TRUE(tab->NavigateToURL(server.TestServerPageW(L"c")));
+ EXPECT_TRUE(tab->NavigateToURL(server->TestServerPageW(L"c")));
EXPECT_TRUE(tab->GoBack()); // should bring us back to 'a'
- NavigateTab(tab.get(), server.TestServerPageW(L"auth-basic"));
+ NavigateTab(tab.get(), server->TestServerPageW(L"auth-basic"));
EXPECT_TRUE(tab->NeedsAuth());
EXPECT_TRUE(tab->GoForward()); // should bring us to 'c'
EXPECT_FALSE(tab->NeedsAuth());
// Now test that cancelling works as expected.
- NavigateTab(tab.get(), server.TestServerPageW(L"auth-basic"));
+ NavigateTab(tab.get(), server->TestServerPageW(L"auth-basic"));
EXPECT_TRUE(tab->NeedsAuth());
EXPECT_TRUE(tab->CancelAuth());
EXPECT_FALSE(tab->NeedsAuth());
« no previous file with comments | « chrome/browser/interstitial_page_uitest.cc ('k') | chrome/browser/printing/printing_layout_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698