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/policy/url_blacklist_manager.h" | 5 #include "chrome/browser/policy/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/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 virtual void TearDown() OVERRIDE { | 82 virtual void TearDown() OVERRIDE { |
83 if (blacklist_manager_.get()) | 83 if (blacklist_manager_.get()) |
84 blacklist_manager_->ShutdownOnUIThread(); | 84 blacklist_manager_->ShutdownOnUIThread(); |
85 loop_.RunUntilIdle(); | 85 loop_.RunUntilIdle(); |
86 // Delete |blacklist_manager_| while |io_thread_| is mapping IO to | 86 // Delete |blacklist_manager_| while |io_thread_| is mapping IO to |
87 // |loop_|. | 87 // |loop_|. |
88 blacklist_manager_.reset(); | 88 blacklist_manager_.reset(); |
89 } | 89 } |
90 | 90 |
91 MessageLoop loop_; | 91 MessageLoop loop_; |
92 TestingPrefService pref_service_; | 92 TestingPrefServiceSimple pref_service_; |
93 scoped_ptr<TestingURLBlacklistManager> blacklist_manager_; | 93 scoped_ptr<TestingURLBlacklistManager> blacklist_manager_; |
94 | 94 |
95 private: | 95 private: |
96 content::TestBrowserThread ui_thread_; | 96 content::TestBrowserThread ui_thread_; |
97 content::TestBrowserThread file_thread_; | 97 content::TestBrowserThread file_thread_; |
98 content::TestBrowserThread io_thread_; | 98 content::TestBrowserThread io_thread_; |
99 | 99 |
100 DISALLOW_COPY_AND_ASSIGN(URLBlacklistManagerTest); | 100 DISALLOW_COPY_AND_ASSIGN(URLBlacklistManagerTest); |
101 }; | 101 }; |
102 | 102 |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 EXPECT_FALSE(blacklist.IsURLBlocked(GURL("http://s.plus.google.com"))); | 434 EXPECT_FALSE(blacklist.IsURLBlocked(GURL("http://s.plus.google.com"))); |
435 EXPECT_TRUE(blacklist.IsURLBlocked(GURL("http://mail.google.com"))); | 435 EXPECT_TRUE(blacklist.IsURLBlocked(GURL("http://mail.google.com"))); |
436 EXPECT_FALSE(blacklist.IsURLBlocked(GURL("https://mail.google.com"))); | 436 EXPECT_FALSE(blacklist.IsURLBlocked(GURL("https://mail.google.com"))); |
437 EXPECT_FALSE(blacklist.IsURLBlocked(GURL("https://s.mail.google.com"))); | 437 EXPECT_FALSE(blacklist.IsURLBlocked(GURL("https://s.mail.google.com"))); |
438 EXPECT_TRUE(blacklist.IsURLBlocked(GURL("https://very.safe/"))); | 438 EXPECT_TRUE(blacklist.IsURLBlocked(GURL("https://very.safe/"))); |
439 EXPECT_TRUE(blacklist.IsURLBlocked(GURL("http://very.safe/path"))); | 439 EXPECT_TRUE(blacklist.IsURLBlocked(GURL("http://very.safe/path"))); |
440 EXPECT_FALSE(blacklist.IsURLBlocked(GURL("https://very.safe/path"))); | 440 EXPECT_FALSE(blacklist.IsURLBlocked(GURL("https://very.safe/path"))); |
441 } | 441 } |
442 | 442 |
443 } // namespace policy | 443 } // namespace policy |
OLD | NEW |