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 <stdint.h> | 7 #include <stdint.h> |
8 #include <ostream> | 8 #include <ostream> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
15 #include "base/thread_task_runner_handle.h" | 15 #include "base/threading/thread_task_runner_handle.h" |
16 #include "components/policy/core/common/policy_pref_names.h" | 16 #include "components/policy/core/common/policy_pref_names.h" |
17 #include "components/prefs/pref_registry_simple.h" | 17 #include "components/prefs/pref_registry_simple.h" |
18 #include "components/prefs/testing_pref_service.h" | 18 #include "components/prefs/testing_pref_service.h" |
19 #include "components/url_formatter/url_fixer.h" | 19 #include "components/url_formatter/url_fixer.h" |
20 #include "google_apis/gaia/gaia_urls.h" | 20 #include "google_apis/gaia/gaia_urls.h" |
21 #include "net/base/load_flags.h" | 21 #include "net/base/load_flags.h" |
22 #include "net/base/net_errors.h" | 22 #include "net/base/net_errors.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
24 #include "url/gurl.h" | 24 #include "url/gurl.h" |
25 | 25 |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 blacklist.Allow(allowed.get()); | 674 blacklist.Allow(allowed.get()); |
675 | 675 |
676 EXPECT_TRUE(blacklist.IsURLBlocked(GURL("http://www.google.com"))); | 676 EXPECT_TRUE(blacklist.IsURLBlocked(GURL("http://www.google.com"))); |
677 EXPECT_TRUE((blacklist.IsURLBlocked(GURL("chrome-extension://xyz")))); | 677 EXPECT_TRUE((blacklist.IsURLBlocked(GURL("chrome-extension://xyz")))); |
678 EXPECT_FALSE((blacklist.IsURLBlocked(GURL("chrome-extension://abc")))); | 678 EXPECT_FALSE((blacklist.IsURLBlocked(GURL("chrome-extension://abc")))); |
679 EXPECT_FALSE((blacklist.IsURLBlocked(GURL("chrome-search://local-ntp")))); | 679 EXPECT_FALSE((blacklist.IsURLBlocked(GURL("chrome-search://local-ntp")))); |
680 EXPECT_FALSE((blacklist.IsURLBlocked(GURL("chrome-native://ntp")))); | 680 EXPECT_FALSE((blacklist.IsURLBlocked(GURL("chrome-native://ntp")))); |
681 } | 681 } |
682 | 682 |
683 } // namespace policy | 683 } // namespace policy |
OLD | NEW |