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 "components/policy/core/browser/url_blacklist_manager.h" | 5 #include "components/policy/core/browser/url_blacklist_manager.h" |
6 | 6 |
7 #include <ostream> | 7 #include <ostream> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/message_loop/message_loop_proxy.h" | 12 #include "base/message_loop/message_loop_proxy.h" |
13 #include "base/prefs/pref_registry_simple.h" | 13 #include "base/prefs/pref_registry_simple.h" |
14 #include "base/prefs/testing_pref_service.h" | 14 #include "base/prefs/testing_pref_service.h" |
15 #include "chrome/browser/policy/policy_helpers.h" | 15 #include "chrome/browser/policy/policy_helpers.h" |
16 #include "chrome/common/net/url_fixer_upper.h" | 16 #include "chrome/common/net/url_fixer_upper.h" |
17 #include "components/policy/core/common/policy_pref_names.h" | 17 #include "components/policy/core/common/policy_pref_names.h" |
18 #include "google_apis/gaia/gaia_urls.h" | 18 #include "google_apis/gaia/gaia_urls.h" |
| 19 #include "net/base/load_flags.h" |
19 #include "net/base/net_errors.h" | 20 #include "net/base/net_errors.h" |
20 #include "net/base/request_priority.h" | 21 #include "net/base/request_priority.h" |
21 #include "net/url_request/url_request.h" | 22 #include "net/url_request/url_request.h" |
22 #include "net/url_request/url_request_test_util.h" | 23 #include "net/url_request/url_request_test_util.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
24 #include "url/gurl.h" | 25 #include "url/gurl.h" |
25 | 26 |
26 // TODO(joaodasilva): this file should be moved next to | 27 // TODO(joaodasilva): this file should be moved next to |
27 // components/policy/core/browser/url_blacklist_manager.(cc|h). | 28 // components/policy/core/browser/url_blacklist_manager.(cc|h). |
28 // However, url_fixer_upper.h can't be included from the component. Rather | 29 // However, url_fixer_upper.h can't be included from the component. Rather |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 | 665 |
665 GURL sync_url(GaiaUrls::GetInstance()->service_login_url().Resolve( | 666 GURL sync_url(GaiaUrls::GetInstance()->service_login_url().Resolve( |
666 "?service=chromiumsync")); | 667 "?service=chromiumsync")); |
667 net::URLRequest sync_request(sync_url, net::DEFAULT_PRIORITY, NULL, &context); | 668 net::URLRequest sync_request(sync_url, net::DEFAULT_PRIORITY, NULL, &context); |
668 sync_request.SetLoadFlags(net::LOAD_MAIN_FRAME); | 669 sync_request.SetLoadFlags(net::LOAD_MAIN_FRAME); |
669 EXPECT_EQ(block_signin_urls, | 670 EXPECT_EQ(block_signin_urls, |
670 blacklist_manager_->IsRequestBlocked(sync_request, &reason)); | 671 blacklist_manager_->IsRequestBlocked(sync_request, &reason)); |
671 } | 672 } |
672 | 673 |
673 } // namespace policy | 674 } // namespace policy |
OLD | NEW |