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

Unified Diff: chrome/browser/ui/login/login_prompt_uitest.cc

Issue 8305004: Fix HTTP auth multi-profile handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment fix Created 9 years, 1 month 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/ui/login/login_prompt_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/login/login_prompt_uitest.cc
diff --git a/chrome/browser/ui/login/login_prompt_uitest.cc b/chrome/browser/ui/login/login_prompt_uitest.cc
index 484055de780dde04809d24e82707a0092f7ef85d..c70afdb39cec5e187c0f3616a8e875683917de6e 100644
--- a/chrome/browser/ui/login/login_prompt_uitest.cc
+++ b/chrome/browser/ui/login/login_prompt_uitest.cc
@@ -135,72 +135,3 @@ TEST_F(LoginPromptTest, TestTwoAuths) {
EXPECT_EQ(ExpectedTitleFromAuth(username_digest_, password_),
WideToUTF16Hack(title));
}
-
-// If multiple tabs are looking for the same auth, the user should only have to
-// enter it once.
-TEST_F(LoginPromptTest, SupplyRedundantAuths) {
- ASSERT_TRUE(test_server_.Start());
-
- scoped_refptr<TabProxy> basic_tab1(GetActiveTab());
- ASSERT_TRUE(basic_tab1.get());
- ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
- basic_tab1->NavigateToURL(test_server_.GetURL("auth-basic/1")));
- EXPECT_TRUE(basic_tab1->NeedsAuth());
-
- AppendTab(GURL(chrome::kAboutBlankURL));
- scoped_refptr<TabProxy> basic_tab2(GetActiveTab());
- ASSERT_TRUE(basic_tab2.get());
- ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
- basic_tab2->NavigateToURL(test_server_.GetURL("auth-basic/2")));
- EXPECT_TRUE(basic_tab2->NeedsAuth());
-
- // Set the auth in only one of the tabs (but wait for the other to load).
- int64 last_navigation_time;
- ASSERT_TRUE(basic_tab2->GetLastNavigationTime(&last_navigation_time));
- EXPECT_TRUE(basic_tab1->SetAuth(UTF16ToWideHack(username_basic_),
- UTF16ToWideHack(password_)));
- EXPECT_TRUE(basic_tab2->WaitForNavigation(last_navigation_time));
-
- // Now both tabs have loaded.
- wstring title1;
- EXPECT_TRUE(basic_tab1->GetTabTitle(&title1));
- EXPECT_EQ(ExpectedTitleFromAuth(username_basic_, password_),
- WideToUTF16Hack(title1));
- wstring title2;
- EXPECT_TRUE(basic_tab2->GetTabTitle(&title2));
- EXPECT_EQ(ExpectedTitleFromAuth(username_basic_, password_),
- WideToUTF16Hack(title2));
-}
-
-// If multiple tabs are looking for the same auth, and one is cancelled, the
-// other should be cancelled as well.
-TEST_F(LoginPromptTest, CancelRedundantAuths) {
- ASSERT_TRUE(test_server_.Start());
-
- scoped_refptr<TabProxy> basic_tab1(GetActiveTab());
- ASSERT_TRUE(basic_tab1.get());
- ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
- basic_tab1->NavigateToURL(test_server_.GetURL("auth-basic/1")));
- EXPECT_TRUE(basic_tab1->NeedsAuth());
-
- AppendTab(GURL(chrome::kAboutBlankURL));
- scoped_refptr<TabProxy> basic_tab2(GetActiveTab());
- ASSERT_TRUE(basic_tab2.get());
- ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
- basic_tab2->NavigateToURL(test_server_.GetURL("auth-basic/2")));
- EXPECT_TRUE(basic_tab2->NeedsAuth());
-
- // Cancel the auth in only one of the tabs (but wait for the other to load).
- int64 last_navigation_time;
- ASSERT_TRUE(basic_tab2->GetLastNavigationTime(&last_navigation_time));
- EXPECT_TRUE(basic_tab1->CancelAuth());
- EXPECT_TRUE(basic_tab2->WaitForNavigation(last_navigation_time));
-
- // Now both tabs have been denied.
- wstring title1;
- EXPECT_TRUE(basic_tab1->GetTabTitle(&title1));
- EXPECT_EQ(L"Denied: no auth", title1);
- wstring title2;
- EXPECT_TRUE(basic_tab2->GetTabTitle(&title2));
- EXPECT_EQ(L"Denied: no auth", title2);
-}
« no previous file with comments | « chrome/browser/ui/login/login_prompt_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698