summaryrefslogtreecommitdiffstats
path: root/chrome/browser/login_prompt_uitest.cc
diff options
context:
space:
mode:
authorIain Merrick <husky@google.com>2010-11-01 12:19:54 +0000
committerIain Merrick <husky@google.com>2010-11-03 10:21:10 +0000
commit731df977c0511bca2206b5f333555b1205ff1f43 (patch)
tree0e750b949b3f00a1ac11fda25d3c2de512f2b465 /chrome/browser/login_prompt_uitest.cc
parent5add15e10e7bb80512f2c597ca57221314abe577 (diff)
downloadexternal_chromium-731df977c0511bca2206b5f333555b1205ff1f43.zip
external_chromium-731df977c0511bca2206b5f333555b1205ff1f43.tar.gz
external_chromium-731df977c0511bca2206b5f333555b1205ff1f43.tar.bz2
Merge Chromium at r63472 : Initial merge by git.
Change-Id: Ifb9ee821af006a5f2211e81471be93ae440a1f5a
Diffstat (limited to 'chrome/browser/login_prompt_uitest.cc')
-rw-r--r--chrome/browser/login_prompt_uitest.cc79
1 files changed, 37 insertions, 42 deletions
diff --git a/chrome/browser/login_prompt_uitest.cc b/chrome/browser/login_prompt_uitest.cc
index 18b9a20..410db2b 100644
--- a/chrome/browser/login_prompt_uitest.cc
+++ b/chrome/browser/login_prompt_uitest.cc
@@ -51,21 +51,14 @@ wstring ExpectedTitleFromAuth(const wstring& username,
return username + L"/" + password;
}
-// FLAKY: http://crbug.com/56670
-#if defined(OS_WIN)
-#define MAYBE_TestBasicAuth FLAKY_TestBasicAuth
-#elif defined(OS_LINUX)
-#define MAYBE_TestBasicAuth FLAKY_TestBasicAuth
-#else
-#define MAYBE_TestBasicAuth TestBasicAuth
-#endif
// Test that "Basic" HTTP authentication works.
-TEST_F(LoginPromptTest, MAYBE_TestBasicAuth) {
+TEST_F(LoginPromptTest, TestBasicAuth) {
ASSERT_TRUE(test_server_.Start());
scoped_refptr<TabProxy> tab(GetActiveTab());
ASSERT_TRUE(tab.get());
- ASSERT_TRUE(tab->NavigateToURL(test_server_.GetURL("auth-basic")));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ tab->NavigateToURL(test_server_.GetURL("auth-basic")));
EXPECT_TRUE(tab->NeedsAuth());
EXPECT_FALSE(tab->SetAuth(username_basic_, password_bad_));
@@ -73,7 +66,8 @@ TEST_F(LoginPromptTest, MAYBE_TestBasicAuth) {
EXPECT_TRUE(tab->CancelAuth());
EXPECT_EQ(L"Denied: wrong password", GetActiveTabTitle());
- ASSERT_TRUE(tab->NavigateToURL(test_server_.GetURL("auth-basic")));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ tab->NavigateToURL(test_server_.GetURL("auth-basic")));
EXPECT_TRUE(tab->NeedsAuth());
EXPECT_TRUE(tab->SetAuth(username_basic_, password_));
@@ -81,21 +75,22 @@ TEST_F(LoginPromptTest, MAYBE_TestBasicAuth) {
GetActiveTabTitle());
}
-// FLAKY: http://crbug.com/56670
// Test that "Digest" HTTP authentication works.
-TEST_F(LoginPromptTest, FLAKY_TestDigestAuth) {
+TEST_F(LoginPromptTest, TestDigestAuth) {
ASSERT_TRUE(test_server_.Start());
scoped_refptr<TabProxy> tab(GetActiveTab());
ASSERT_TRUE(tab.get());
- ASSERT_TRUE(tab->NavigateToURL(test_server_.GetURL("auth-digest")));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ tab->NavigateToURL(test_server_.GetURL("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());
- ASSERT_TRUE(tab->NavigateToURL(test_server_.GetURL("auth-digest")));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ tab->NavigateToURL(test_server_.GetURL("auth-digest")));
EXPECT_TRUE(tab->NeedsAuth());
EXPECT_TRUE(tab->SetAuth(username_digest_, password_));
@@ -109,13 +104,14 @@ TEST_F(LoginPromptTest, TestTwoAuths) {
scoped_refptr<TabProxy> basic_tab(GetActiveTab());
ASSERT_TRUE(basic_tab.get());
- ASSERT_TRUE(basic_tab->NavigateToURL(test_server_.GetURL("auth-basic")));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ basic_tab->NavigateToURL(test_server_.GetURL("auth-basic")));
AppendTab(GURL(chrome::kAboutBlankURL));
scoped_refptr<TabProxy> digest_tab(GetActiveTab());
ASSERT_TRUE(digest_tab.get());
- ASSERT_TRUE(
- digest_tab->NavigateToURL(test_server_.GetURL("auth-digest")));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ digest_tab->NavigateToURL(test_server_.GetURL("auth-digest")));
EXPECT_TRUE(basic_tab->NeedsAuth());
EXPECT_TRUE(basic_tab->SetAuth(username_basic_, password_));
@@ -130,46 +126,45 @@ TEST_F(LoginPromptTest, TestTwoAuths) {
EXPECT_EQ(ExpectedTitleFromAuth(username_digest_, password_), title);
}
-// FLAKY: http://crbug.com/56670
-#if defined(OS_WIN)
-#define MAYBE_TestCancelAuth FLAKY_TestCancelAuth
-#elif defined(OS_LINUX)
-#define MAYBE_TestCancelAuth FLAKY_TestCancelAuth
-#else
-#define MAYBE_TestCancelAuth TestCancelAuth
-#endif
// Test that cancelling authentication works.
-TEST_F(LoginPromptTest, MAYBE_TestCancelAuth) {
+TEST_F(LoginPromptTest, TestCancelAuth) {
ASSERT_TRUE(test_server_.Start());
scoped_refptr<TabProxy> tab(GetActiveTab());
ASSERT_TRUE(tab.get());
// First navigate to a test server page so we have something to go back to.
- ASSERT_TRUE(tab->NavigateToURL(test_server_.GetURL("a")));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS,
+ tab->NavigateToURL(test_server_.GetURL("a")));
// Navigating while auth is requested is the same as cancelling.
- ASSERT_TRUE(tab->NavigateToURL(test_server_.GetURL("auth-basic")));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ tab->NavigateToURL(test_server_.GetURL("auth-basic")));
EXPECT_TRUE(tab->NeedsAuth());
- ASSERT_TRUE(tab->NavigateToURL(test_server_.GetURL("b")));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS,
+ tab->NavigateToURL(test_server_.GetURL("b")));
EXPECT_FALSE(tab->NeedsAuth());
- ASSERT_TRUE(tab->NavigateToURL(test_server_.GetURL("auth-basic")));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ tab->NavigateToURL(test_server_.GetURL("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.
- ASSERT_TRUE(tab->NavigateToURL(test_server_.GetURL("c")));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_SUCCESS,
+ tab->NavigateToURL(test_server_.GetURL("c")));
EXPECT_TRUE(tab->GoBack()); // should bring us back to 'a'
- ASSERT_TRUE(tab->NavigateToURL(test_server_.GetURL("auth-basic")));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ tab->NavigateToURL(test_server_.GetURL("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.
- ASSERT_TRUE(tab->NavigateToURL(test_server_.GetURL("auth-basic")));
+ ASSERT_EQ(AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED,
+ tab->NavigateToURL(test_server_.GetURL("auth-basic")));
EXPECT_TRUE(tab->NeedsAuth());
EXPECT_TRUE(tab->CancelAuth());
EXPECT_FALSE(tab->NeedsAuth());
@@ -183,15 +178,15 @@ TEST_F(LoginPromptTest, SupplyRedundantAuths) {
scoped_refptr<TabProxy> basic_tab1(GetActiveTab());
ASSERT_TRUE(basic_tab1.get());
- ASSERT_TRUE(
- basic_tab1->NavigateToURL(test_server_.GetURL("auth-basic/1")));
+ 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_TRUE(
- basic_tab2->NavigateToURL(test_server_.GetURL("auth-basic/2")));
+ 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).
@@ -216,15 +211,15 @@ TEST_F(LoginPromptTest, CancelRedundantAuths) {
scoped_refptr<TabProxy> basic_tab1(GetActiveTab());
ASSERT_TRUE(basic_tab1.get());
- ASSERT_TRUE(
- basic_tab1->NavigateToURL(test_server_.GetURL("auth-basic/1")));
+ 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_TRUE(
- basic_tab2->NavigateToURL(test_server_.GetURL("auth-basic/2")));
+ 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).