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/task.h" | 11 #include "base/task.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "chrome/common/chrome_notification_types.h" | 13 #include "chrome/common/chrome_notification_types.h" |
14 #include "chrome/common/custom_handlers/protocol_handler.h" | 14 #include "chrome/common/custom_handlers/protocol_handler.h" |
15 #include "chrome/test/base/testing_browser_process.h" | 15 #include "chrome/test/base/testing_browser_process.h" |
16 #include "chrome/test/base/testing_pref_service.h" | 16 #include "chrome/test/base/testing_pref_service.h" |
17 #include "chrome/test/base/testing_profile.h" | 17 #include "chrome/test/base/testing_profile.h" |
18 #include "content/browser/renderer_host/test_render_view_host.h" | 18 #include "content/browser/renderer_host/test_render_view_host.h" |
19 #include "content/public/browser/notification_observer.h" | 19 #include "content/public/browser/notification_observer.h" |
20 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
21 #include "content/public/browser/notification_source.h" | 21 #include "content/public/browser/notification_source.h" |
22 #include "content/test/test_browser_thread.h" | 22 #include "content/test/test_browser_thread.h" |
23 #include "content/test/test_browser_thread.h" | 23 #include "content/test/test_browser_thread.h" |
24 #include "net/url_request/url_request.h" | 24 #include "net/url_request/url_request.h" |
25 | 25 |
| 26 using content::BrowserThread; |
| 27 |
26 namespace { | 28 namespace { |
27 | 29 |
28 class FakeDelegate : public ProtocolHandlerRegistry::Delegate { | 30 class FakeDelegate : public ProtocolHandlerRegistry::Delegate { |
29 public: | 31 public: |
30 FakeDelegate() : force_os_failure_(false) {} | 32 FakeDelegate() : force_os_failure_(false) {} |
31 virtual ~FakeDelegate() { } | 33 virtual ~FakeDelegate() { } |
32 virtual void RegisterExternalHandler(const std::string& protocol) { | 34 virtual void RegisterExternalHandler(const std::string& protocol) { |
33 ASSERT_TRUE( | 35 ASSERT_TRUE( |
34 registered_protocols_.find(protocol) == registered_protocols_.end()); | 36 registered_protocols_.find(protocol) == registered_protocols_.end()); |
35 registered_protocols_.insert(protocol); | 37 registered_protocols_.insert(protocol); |
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 GURL("http://other.com/%s"), "test"); | 791 GURL("http://other.com/%s"), "test"); |
790 ASSERT_EQ(ph1.url().GetOrigin() == ph2.url().GetOrigin(), | 792 ASSERT_EQ(ph1.url().GetOrigin() == ph2.url().GetOrigin(), |
791 ph1.IsSameOrigin(ph2)); | 793 ph1.IsSameOrigin(ph2)); |
792 ASSERT_EQ(ph1.url().GetOrigin() == ph2.url().GetOrigin(), | 794 ASSERT_EQ(ph1.url().GetOrigin() == ph2.url().GetOrigin(), |
793 ph2.IsSameOrigin(ph1)); | 795 ph2.IsSameOrigin(ph1)); |
794 ASSERT_EQ(ph2.url().GetOrigin() == ph3.url().GetOrigin(), | 796 ASSERT_EQ(ph2.url().GetOrigin() == ph3.url().GetOrigin(), |
795 ph2.IsSameOrigin(ph3)); | 797 ph2.IsSameOrigin(ph3)); |
796 ASSERT_EQ(ph3.url().GetOrigin() == ph2.url().GetOrigin(), | 798 ASSERT_EQ(ph3.url().GetOrigin() == ph2.url().GetOrigin(), |
797 ph3.IsSameOrigin(ph2)); | 799 ph3.IsSameOrigin(ph2)); |
798 } | 800 } |
OLD | NEW |