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

Side by Side Diff: net/proxy/proxy_info_unittest.cc

Issue 10310179: Track sources of proxy settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update copyright Created 8 years, 6 months 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
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 "net/proxy/proxy_info.h"
6 #include "testing/gtest/include/gtest/gtest.h"
7
8 namespace net {
9 namespace {
10
11 TEST(ProxyInfoTest, ProxyInfoIsDirectOnly) {
12 // Test the is_direct_only() predicate.
13 ProxyInfo info;
14
15 // An empty ProxyInfo is not considered direct.
16 EXPECT_FALSE(info.is_direct_only());
17
18 info.UseDirect();
19 EXPECT_TRUE(info.is_direct_only());
20
21 info.UsePacString("DIRECT");
22 EXPECT_TRUE(info.is_direct_only());
23
24 info.UsePacString("PROXY myproxy:80");
25 EXPECT_FALSE(info.is_direct_only());
26
27 info.UsePacString("DIRECT; PROXY myproxy:80");
28 EXPECT_TRUE(info.is_direct());
29 EXPECT_FALSE(info.is_direct_only());
30
31 info.UsePacString("PROXY myproxy:80; DIRECT");
32 EXPECT_FALSE(info.is_direct());
33 EXPECT_FALSE(info.is_direct_only());
34 // After falling back to direct, we shouldn't consider it DIRECT only.
35 EXPECT_TRUE(info.Fallback(BoundNetLog()));
36 EXPECT_TRUE(info.is_direct());
37 EXPECT_FALSE(info.is_direct_only());
38 }
39
40 } // namespace
41 } // namespace net
OLDNEW
« net/proxy/proxy_info.cc ('K') | « net/proxy/proxy_info.cc ('k') | net/proxy/proxy_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698