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 "chrome/browser/chromeos/proxy_config_service_impl.h" | 5 #include "chrome/browser/chromeos/proxy_config_service_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 TestingPrefServiceSimple pref_service_; | 327 TestingPrefServiceSimple pref_service_; |
328 | 328 |
329 private: | 329 private: |
330 ScopedTestDeviceSettingsService test_device_settings_service_; | 330 ScopedTestDeviceSettingsService test_device_settings_service_; |
331 ScopedTestCrosSettings test_cros_settings_; | 331 ScopedTestCrosSettings test_cros_settings_; |
332 content::TestBrowserThread ui_thread_; | 332 content::TestBrowserThread ui_thread_; |
333 content::TestBrowserThread io_thread_; | 333 content::TestBrowserThread io_thread_; |
334 }; | 334 }; |
335 | 335 |
336 TEST_F(ProxyConfigServiceImplTest, NetworkProxy) { | 336 TEST_F(ProxyConfigServiceImplTest, NetworkProxy) { |
337 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { | 337 for (size_t i = 0; i < arraysize(tests); ++i) { |
338 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "] %s", i, | 338 SCOPED_TRACE(base::StringPrintf("Test[%" PRIuS "] %s", i, |
339 tests[i].description.c_str())); | 339 tests[i].description.c_str())); |
340 | 340 |
341 base::DictionaryValue test_config; | 341 base::DictionaryValue test_config; |
342 InitConfigWithTestInput(tests[i].input, &test_config); | 342 InitConfigWithTestInput(tests[i].input, &test_config); |
343 SetConfig(&test_config); | 343 SetConfig(&test_config); |
344 | 344 |
345 net::ProxyConfig config; | 345 net::ProxyConfig config; |
346 SyncGetLatestProxyConfig(&config); | 346 SyncGetLatestProxyConfig(&config); |
347 | 347 |
(...skipping 21 matching lines...) Expand all Loading... |
369 { 5, 4, 6, }, | 369 { 5, 4, 6, }, |
370 { 5, 6, 7, }, | 370 { 5, 6, 7, }, |
371 { 5, 7, 6, }, | 371 { 5, 7, 6, }, |
372 { 7, 6, 5, }, | 372 { 7, 6, 5, }, |
373 { 6, 5, 7, }, | 373 { 6, 5, 7, }, |
374 { 6, 7, 8, }, | 374 { 6, 7, 8, }, |
375 { 6, 8, 7, }, | 375 { 6, 8, 7, }, |
376 { 8, 7, 6, }, | 376 { 8, 7, 6, }, |
377 { 7, 6, 8, }, | 377 { 7, 6, 8, }, |
378 }; | 378 }; |
379 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(proxies); ++i) { | 379 for (size_t i = 0; i < arraysize(proxies); ++i) { |
380 const TestParams& managed_params = tests[proxies[i][0]]; | 380 const TestParams& managed_params = tests[proxies[i][0]]; |
381 const TestParams& recommended_params = tests[proxies[i][1]]; | 381 const TestParams& recommended_params = tests[proxies[i][1]]; |
382 const TestParams& network_params = tests[proxies[i][2]]; | 382 const TestParams& network_params = tests[proxies[i][2]]; |
383 | 383 |
384 SCOPED_TRACE(base::StringPrintf( | 384 SCOPED_TRACE(base::StringPrintf( |
385 "Test[%" PRIuS "] managed=[%s], recommended=[%s], network=[%s]", i, | 385 "Test[%" PRIuS "] managed=[%s], recommended=[%s], network=[%s]", i, |
386 managed_params.description.c_str(), | 386 managed_params.description.c_str(), |
387 recommended_params.description.c_str(), | 387 recommended_params.description.c_str(), |
388 network_params.description.c_str())); | 388 network_params.description.c_str())); |
389 | 389 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 pref_service_.RemoveRecommendedPref(prefs::kProxy); | 445 pref_service_.RemoveRecommendedPref(prefs::kProxy); |
446 SyncGetLatestProxyConfig(&actual_config); | 446 SyncGetLatestProxyConfig(&actual_config); |
447 EXPECT_EQ(network_params.auto_detect, actual_config.auto_detect()); | 447 EXPECT_EQ(network_params.auto_detect, actual_config.auto_detect()); |
448 EXPECT_EQ(network_params.pac_url, actual_config.pac_url()); | 448 EXPECT_EQ(network_params.pac_url, actual_config.pac_url()); |
449 EXPECT_TRUE(network_params.proxy_rules.Matches( | 449 EXPECT_TRUE(network_params.proxy_rules.Matches( |
450 actual_config.proxy_rules())); | 450 actual_config.proxy_rules())); |
451 } | 451 } |
452 } | 452 } |
453 | 453 |
454 } // namespace chromeos | 454 } // namespace chromeos |
OLD | NEW |