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

Side by Side Diff: chrome/browser/login_prompt_unittest.cc

Issue 5606002: Move:... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/login_prompt_uitest.cc ('k') | chrome/browser/login_prompt_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/login_prompt.h"
6 #include "googleurl/src/gurl.h"
7 #include "net/base/auth.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10
11 TEST(LoginPromptTest, GetSignonRealm) {
12 scoped_refptr<net::AuthChallengeInfo> auth_info = new net::AuthChallengeInfo;
13 auth_info->is_proxy = false; // server auth
14 // auth_info->host is intentionally left empty.
15 auth_info->scheme = L"Basic";
16 auth_info->realm = L"WallyWorld";
17
18 std::string url[] = {
19 "https://www.nowhere.org/dir/index.html",
20 "https://www.nowhere.org:443/dir/index.html", // default port
21 "https://www.nowhere.org:8443/dir/index.html", // non-default port
22 "https://www.nowhere.org", // no trailing slash
23 "https://foo:bar@www.nowhere.org/dir/index.html", // username:password
24 "https://www.nowhere.org/dir/index.html?id=965362", // query
25 "https://www.nowhere.org/dir/index.html#toc", // reference
26 };
27
28 std::string expected[] = {
29 "https://www.nowhere.org/WallyWorld",
30 "https://www.nowhere.org/WallyWorld",
31 "https://www.nowhere.org:8443/WallyWorld",
32 "https://www.nowhere.org/WallyWorld",
33 "https://www.nowhere.org/WallyWorld",
34 "https://www.nowhere.org/WallyWorld",
35 "https://www.nowhere.org/WallyWorld"
36 };
37
38 for (size_t i = 0; i < arraysize(url); i++) {
39 std::string key = GetSignonRealm(GURL(url[i]), *auth_info);
40 EXPECT_EQ(expected[i], key);
41 }
42 }
OLDNEW
« no previous file with comments | « chrome/browser/login_prompt_uitest.cc ('k') | chrome/browser/login_prompt_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698