OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "net/proxy/proxy_config_service_linux.h" | 5 #include "net/proxy/proxy_config_service_linux.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 | 674 |
675 ProxyConfigService::CONFIG_VALID, | 675 ProxyConfigService::CONFIG_VALID, |
676 false, // auto_detect | 676 false, // auto_detect |
677 GURL(), // pac_url | 677 GURL(), // pac_url |
678 ProxyRulesExpectation::Single( | 678 ProxyRulesExpectation::Single( |
679 "www.google.com:80", // single proxy | 679 "www.google.com:80", // single proxy |
680 "*.google.com"), // bypass rules | 680 "*.google.com"), // bypass rules |
681 }, | 681 }, |
682 }; | 682 }; |
683 | 683 |
684 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { | 684 for (size_t i = 0; i < arraysize(tests); ++i) { |
685 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "] %s", i, | 685 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "] %s", i, |
686 tests[i].description.c_str())); | 686 tests[i].description.c_str())); |
687 MockEnvironment* env = new MockEnvironment; | 687 MockEnvironment* env = new MockEnvironment; |
688 MockSettingGetter* setting_getter = new MockSettingGetter; | 688 MockSettingGetter* setting_getter = new MockSettingGetter; |
689 SynchConfigGetter sync_config_getter( | 689 SynchConfigGetter sync_config_getter( |
690 new ProxyConfigServiceLinux(env, setting_getter)); | 690 new ProxyConfigServiceLinux(env, setting_getter)); |
691 ProxyConfig config; | 691 ProxyConfig config; |
692 setting_getter->values = tests[i].values; | 692 setting_getter->values = tests[i].values; |
693 sync_config_getter.SetupAndInitialFetch(); | 693 sync_config_getter.SetupAndInitialFetch(); |
694 ProxyConfigService::ConfigAvailability availability = | 694 ProxyConfigService::ConfigAvailability availability = |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 // Expected result. | 982 // Expected result. |
983 ProxyConfigService::CONFIG_VALID, | 983 ProxyConfigService::CONFIG_VALID, |
984 false, // auto_detect | 984 false, // auto_detect |
985 GURL(), // pac_url | 985 GURL(), // pac_url |
986 ProxyRulesExpectation::Single( | 986 ProxyRulesExpectation::Single( |
987 "www.google.com:80", | 987 "www.google.com:80", |
988 "*.google.com,*foo.com:99,1.2.3.4:22,127.0.0.1/8"), | 988 "*.google.com,*foo.com:99,1.2.3.4:22,127.0.0.1/8"), |
989 }, | 989 }, |
990 }; | 990 }; |
991 | 991 |
992 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { | 992 for (size_t i = 0; i < arraysize(tests); ++i) { |
993 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "] %s", i, | 993 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "] %s", i, |
994 tests[i].description.c_str())); | 994 tests[i].description.c_str())); |
995 MockEnvironment* env = new MockEnvironment; | 995 MockEnvironment* env = new MockEnvironment; |
996 MockSettingGetter* setting_getter = new MockSettingGetter; | 996 MockSettingGetter* setting_getter = new MockSettingGetter; |
997 SynchConfigGetter sync_config_getter( | 997 SynchConfigGetter sync_config_getter( |
998 new ProxyConfigServiceLinux(env, setting_getter)); | 998 new ProxyConfigServiceLinux(env, setting_getter)); |
999 ProxyConfig config; | 999 ProxyConfig config; |
1000 env->values = tests[i].values; | 1000 env->values = tests[i].values; |
1001 sync_config_getter.SetupAndInitialFetch(); | 1001 sync_config_getter.SetupAndInitialFetch(); |
1002 ProxyConfigService::ConfigAvailability availability = | 1002 ProxyConfigService::ConfigAvailability availability = |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1486 GURL(), // pac_url | 1486 GURL(), // pac_url |
1487 ProxyRulesExpectation::PerScheme( | 1487 ProxyRulesExpectation::PerScheme( |
1488 "www.normal.com:80", // http | 1488 "www.normal.com:80", // http |
1489 "www.secure.com:80", // https | 1489 "www.secure.com:80", // https |
1490 "ftp.foo.com:80", // ftp | 1490 "ftp.foo.com:80", // ftp |
1491 "*.google.com,*.kde.org"), // bypass rules | 1491 "*.google.com,*.kde.org"), // bypass rules |
1492 }, | 1492 }, |
1493 | 1493 |
1494 }; | 1494 }; |
1495 | 1495 |
1496 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { | 1496 for (size_t i = 0; i < arraysize(tests); ++i) { |
1497 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "] %s", i, | 1497 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "] %s", i, |
1498 tests[i].description.c_str())); | 1498 tests[i].description.c_str())); |
1499 MockEnvironment* env = new MockEnvironment; | 1499 MockEnvironment* env = new MockEnvironment; |
1500 env->values = tests[i].env_values; | 1500 env->values = tests[i].env_values; |
1501 // Force the KDE getter to be used and tell it where the test is. | 1501 // Force the KDE getter to be used and tell it where the test is. |
1502 env->values.DESKTOP_SESSION = "kde4"; | 1502 env->values.DESKTOP_SESSION = "kde4"; |
1503 env->values.KDEHOME = kde_home_.value().c_str(); | 1503 env->values.KDEHOME = kde_home_.value().c_str(); |
1504 SynchConfigGetter sync_config_getter( | 1504 SynchConfigGetter sync_config_getter( |
1505 new ProxyConfigServiceLinux(env)); | 1505 new ProxyConfigServiceLinux(env)); |
1506 ProxyConfig config; | 1506 ProxyConfig config; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1611 ProxyConfig config; | 1611 ProxyConfig config; |
1612 sync_config_getter.SetupAndInitialFetch(); | 1612 sync_config_getter.SetupAndInitialFetch(); |
1613 EXPECT_EQ(ProxyConfigService::CONFIG_VALID, | 1613 EXPECT_EQ(ProxyConfigService::CONFIG_VALID, |
1614 sync_config_getter.SyncGetLatestProxyConfig(&config)); | 1614 sync_config_getter.SyncGetLatestProxyConfig(&config)); |
1615 EXPECT_TRUE(config.auto_detect()); | 1615 EXPECT_TRUE(config.auto_detect()); |
1616 EXPECT_EQ(GURL(), config.pac_url()); | 1616 EXPECT_EQ(GURL(), config.pac_url()); |
1617 } | 1617 } |
1618 } | 1618 } |
1619 | 1619 |
1620 } // namespace net | 1620 } // namespace net |
OLD | NEW |