| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/custom_handlers/protocol_handler_registry.h" | 5 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| 11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 #include "base/task.h" | 12 #include "base/task.h" |
| 13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 14 #include "chrome/common/chrome_notification_types.h" | 14 #include "chrome/common/chrome_notification_types.h" |
| 15 #include "chrome/common/custom_handlers/protocol_handler.h" | 15 #include "chrome/common/custom_handlers/protocol_handler.h" |
| 16 #include "chrome/test/base/testing_pref_service.h" |
| 16 #include "chrome/test/base/testing_profile.h" | 17 #include "chrome/test/base/testing_profile.h" |
| 17 #include "chrome/test/testing_browser_process.h" | 18 #include "chrome/test/testing_browser_process.h" |
| 18 #include "chrome/test/testing_browser_process_test.h" | 19 #include "chrome/test/testing_browser_process_test.h" |
| 19 #include "chrome/test/testing_pref_service.h" | |
| 20 #include "content/browser/browser_thread.h" | 20 #include "content/browser/browser_thread.h" |
| 21 #include "content/browser/renderer_host/test_render_view_host.h" | 21 #include "content/browser/renderer_host/test_render_view_host.h" |
| 22 #include "content/common/notification_observer.h" | 22 #include "content/common/notification_observer.h" |
| 23 #include "content/common/notification_registrar.h" | 23 #include "content/common/notification_registrar.h" |
| 24 #include "content/common/notification_service.h" | 24 #include "content/common/notification_service.h" |
| 25 #include "net/url_request/url_request.h" | 25 #include "net/url_request/url_request.h" |
| 26 | 26 |
| 27 class FakeDelegate : public ProtocolHandlerRegistry::Delegate { | 27 class FakeDelegate : public ProtocolHandlerRegistry::Delegate { |
| 28 public: | 28 public: |
| 29 FakeDelegate() : force_os_failure_(false) {} | 29 FakeDelegate() : force_os_failure_(false) {} |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 } | 671 } |
| 672 | 672 |
| 673 TEST_F(ProtocolHandlerRegistryTest, TestLoadEnabledGetsPropogatedToIO) { | 673 TEST_F(ProtocolHandlerRegistryTest, TestLoadEnabledGetsPropogatedToIO) { |
| 674 registry()->Disable(); | 674 registry()->Disable(); |
| 675 ReloadProtocolHandlerRegistry(); | 675 ReloadProtocolHandlerRegistry(); |
| 676 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 676 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 677 NewRunnableFunction(QuitUILoop)); | 677 NewRunnableFunction(QuitUILoop)); |
| 678 MessageLoop::current()->Run(); | 678 MessageLoop::current()->Run(); |
| 679 ASSERT_FALSE(enabled_io()); | 679 ASSERT_FALSE(enabled_io()); |
| 680 } | 680 } |
| OLD | NEW |