OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/login_prompt.h" | 5 #include "chrome/browser/ui/login/login_prompt.h" |
6 #include "googleurl/src/gurl.h" | 6 #include "googleurl/src/gurl.h" |
7 #include "net/base/auth.h" | 7 #include "net/base/auth.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 | 10 |
11 TEST(LoginPromptTest, GetSignonRealm) { | 11 TEST(LoginPromptTest, GetSignonRealm) { |
12 scoped_refptr<net::AuthChallengeInfo> auth_info = new net::AuthChallengeInfo; | 12 scoped_refptr<net::AuthChallengeInfo> auth_info = new net::AuthChallengeInfo; |
13 auth_info->is_proxy = false; // server auth | 13 auth_info->is_proxy = false; // server auth |
14 // auth_info->host is intentionally left empty. | 14 // auth_info->host is intentionally left empty. |
15 auth_info->scheme = L"Basic"; | 15 auth_info->scheme = L"Basic"; |
(...skipping 17 matching lines...) Expand all Loading... |
33 "https://www.nowhere.org/WallyWorld", | 33 "https://www.nowhere.org/WallyWorld", |
34 "https://www.nowhere.org/WallyWorld", | 34 "https://www.nowhere.org/WallyWorld", |
35 "https://www.nowhere.org/WallyWorld" | 35 "https://www.nowhere.org/WallyWorld" |
36 }; | 36 }; |
37 | 37 |
38 for (size_t i = 0; i < arraysize(url); i++) { | 38 for (size_t i = 0; i < arraysize(url); i++) { |
39 std::string key = GetSignonRealm(GURL(url[i]), *auth_info); | 39 std::string key = GetSignonRealm(GURL(url[i]), *auth_info); |
40 EXPECT_EQ(expected[i], key); | 40 EXPECT_EQ(expected[i], key); |
41 } | 41 } |
42 } | 42 } |
OLD | NEW |