OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/process_manager.h" | 5 #include "extensions/browser/process_manager.h" |
6 | 6 |
7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
8 #include "content/public/browser/content_browser_client.h" | 8 #include "content/public/browser/content_browser_client.h" |
9 #include "content/public/browser/notification_service.h" | 9 #include "content/public/browser/notification_service.h" |
10 #include "content/public/browser/site_instance.h" | 10 #include "content/public/browser/site_instance.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 EXPECT_EQ(0u, manager1->background_hosts().size()); | 76 EXPECT_EQ(0u, manager1->background_hosts().size()); |
77 | 77 |
78 // It observes other notifications from this context. | 78 // It observes other notifications from this context. |
79 EXPECT_TRUE(IsRegistered(manager1.get(), | 79 EXPECT_TRUE(IsRegistered(manager1.get(), |
80 chrome::NOTIFICATION_EXTENSIONS_READY, | 80 chrome::NOTIFICATION_EXTENSIONS_READY, |
81 original_context())); | 81 original_context())); |
82 EXPECT_TRUE(IsRegistered(manager1.get(), | 82 EXPECT_TRUE(IsRegistered(manager1.get(), |
83 chrome::NOTIFICATION_EXTENSION_LOADED, | 83 chrome::NOTIFICATION_EXTENSION_LOADED, |
84 original_context())); | 84 original_context())); |
85 EXPECT_TRUE(IsRegistered(manager1.get(), | 85 EXPECT_TRUE(IsRegistered(manager1.get(), |
86 chrome::NOTIFICATION_EXTENSION_UNLOADED, | 86 chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, |
87 original_context())); | 87 original_context())); |
88 EXPECT_TRUE(IsRegistered(manager1.get(), | 88 EXPECT_TRUE(IsRegistered(manager1.get(), |
89 chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED, | 89 chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED, |
90 original_context())); | 90 original_context())); |
91 | 91 |
92 // Test for an incognito context ProcessManager. | 92 // Test for an incognito context ProcessManager. |
93 scoped_ptr<ProcessManager> manager2(ProcessManager::CreateIncognitoForTesting( | 93 scoped_ptr<ProcessManager> manager2(ProcessManager::CreateIncognitoForTesting( |
94 incognito_context(), original_context(), manager1.get())); | 94 incognito_context(), original_context(), manager1.get())); |
95 | 95 |
96 EXPECT_EQ(incognito_context(), manager2->GetBrowserContext()); | 96 EXPECT_EQ(incognito_context(), manager2->GetBrowserContext()); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 scoped_refptr<SiteInstance> site21 = | 155 scoped_refptr<SiteInstance> site21 = |
156 manager1->GetSiteInstanceForURL(ext2_url1); | 156 manager1->GetSiteInstanceForURL(ext2_url1); |
157 EXPECT_NE(site11, site21); | 157 EXPECT_NE(site11, site21); |
158 | 158 |
159 scoped_refptr<SiteInstance> other_profile_site = | 159 scoped_refptr<SiteInstance> other_profile_site = |
160 manager2->GetSiteInstanceForURL(ext1_url1); | 160 manager2->GetSiteInstanceForURL(ext1_url1); |
161 EXPECT_NE(site11, other_profile_site); | 161 EXPECT_NE(site11, other_profile_site); |
162 } | 162 } |
163 | 163 |
164 } // namespace extensions | 164 } // namespace extensions |
OLD | NEW |