| 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 "content/public/browser/content_browser_client.h" | 7 #include "content/public/browser/content_browser_client.h" |
| 8 #include "content/public/browser/notification_service.h" | 8 #include "content/public/browser/notification_service.h" |
| 9 #include "content/public/browser/site_instance.h" | 9 #include "content/public/browser/site_instance.h" |
| 10 #include "content/public/common/content_client.h" | 10 #include "content/public/common/content_client.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 class ProcessManagerTest : public ExtensionsTest { | 62 class ProcessManagerTest : public ExtensionsTest { |
| 63 public: | 63 public: |
| 64 ProcessManagerTest() | 64 ProcessManagerTest() |
| 65 : notification_service_(content::NotificationService::Create()), | 65 : notification_service_(content::NotificationService::Create()), |
| 66 extension_registry_(browser_context()) { | 66 extension_registry_(browser_context()) { |
| 67 extensions_browser_client()->SetIncognitoContext(&incognito_context_); | 67 extensions_browser_client()->SetIncognitoContext(&incognito_context_); |
| 68 extensions_browser_client()->set_process_manager_delegate( | 68 extensions_browser_client()->set_process_manager_delegate( |
| 69 &process_manager_delegate_); | 69 &process_manager_delegate_); |
| 70 } | 70 } |
| 71 | 71 |
| 72 virtual ~ProcessManagerTest() {} | 72 ~ProcessManagerTest() override {} |
| 73 | 73 |
| 74 // Use original_context() to make it clear it is a non-incognito context. | 74 // Use original_context() to make it clear it is a non-incognito context. |
| 75 BrowserContext* original_context() { return browser_context(); } | 75 BrowserContext* original_context() { return browser_context(); } |
| 76 BrowserContext* incognito_context() { return &incognito_context_; } | 76 BrowserContext* incognito_context() { return &incognito_context_; } |
| 77 ExtensionRegistry* extension_registry() { return &extension_registry_; } | 77 ExtensionRegistry* extension_registry() { return &extension_registry_; } |
| 78 TestProcessManagerDelegate* process_manager_delegate() { | 78 TestProcessManagerDelegate* process_manager_delegate() { |
| 79 return &process_manager_delegate_; | 79 return &process_manager_delegate_; |
| 80 } | 80 } |
| 81 | 81 |
| 82 // Returns true if the notification |type| is registered for |manager| with | 82 // Returns true if the notification |type| is registered for |manager| with |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 scoped_refptr<SiteInstance> site21 = | 254 scoped_refptr<SiteInstance> site21 = |
| 255 manager1->GetSiteInstanceForURL(ext2_url1); | 255 manager1->GetSiteInstanceForURL(ext2_url1); |
| 256 EXPECT_NE(site11, site21); | 256 EXPECT_NE(site11, site21); |
| 257 | 257 |
| 258 scoped_refptr<SiteInstance> other_profile_site = | 258 scoped_refptr<SiteInstance> other_profile_site = |
| 259 manager2->GetSiteInstanceForURL(ext1_url1); | 259 manager2->GetSiteInstanceForURL(ext1_url1); |
| 260 EXPECT_NE(site11, other_profile_site); | 260 EXPECT_NE(site11, other_profile_site); |
| 261 } | 261 } |
| 262 | 262 |
| 263 } // namespace extensions | 263 } // namespace extensions |
| OLD | NEW |