| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/privacy_blacklist/blacklist_manager.h" | 5 #include "chrome/browser/privacy_blacklist/blacklist_manager.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
| 10 #include "base/thread.h" | 10 #include "base/thread.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 mock_file_thread_(ChromeThread::FILE) { | 89 mock_file_thread_(ChromeThread::FILE) { |
| 90 } | 90 } |
| 91 | 91 |
| 92 virtual void SetUp() { | 92 virtual void SetUp() { |
| 93 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_)); | 93 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_)); |
| 94 test_data_dir_ = test_data_dir_.AppendASCII("blacklist_samples"); | 94 test_data_dir_ = test_data_dir_.AppendASCII("blacklist_samples"); |
| 95 ASSERT_TRUE(mock_file_thread_.Start()); | 95 ASSERT_TRUE(mock_file_thread_.Start()); |
| 96 } | 96 } |
| 97 | 97 |
| 98 virtual void TearDown() { | 98 virtual void TearDown() { |
| 99 mock_file_thread_.Stop(); |
| 99 loop_.RunAllPending(); | 100 loop_.RunAllPending(); |
| 100 } | 101 } |
| 101 | 102 |
| 102 // NotificationObserver | 103 // NotificationObserver |
| 103 virtual void Observe(NotificationType type, | 104 virtual void Observe(NotificationType type, |
| 104 const NotificationSource& source, | 105 const NotificationSource& source, |
| 105 const NotificationDetails& details) { | 106 const NotificationDetails& details) { |
| 106 MessageLoop::current()->Quit(); | 107 MessageLoop::current()->Quit(); |
| 107 } | 108 } |
| 108 | 109 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 WaitForBlacklistUpdate(); | 246 WaitForBlacklistUpdate(); |
| 246 | 247 |
| 247 // The manager should recompile the blacklist. | 248 // The manager should recompile the blacklist. |
| 248 const Blacklist* blacklist = manager->GetCompiledBlacklist(); | 249 const Blacklist* blacklist = manager->GetCompiledBlacklist(); |
| 249 EXPECT_TRUE(BlacklistHasMatch(blacklist, | 250 EXPECT_TRUE(BlacklistHasMatch(blacklist, |
| 250 "http://host/annoying_ads/ad.jpg")); | 251 "http://host/annoying_ads/ad.jpg")); |
| 251 } | 252 } |
| 252 } | 253 } |
| 253 | 254 |
| 254 } // namespace | 255 } // namespace |
| OLD | NEW |