Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: extensions/browser/process_manager_unittest.cc

Issue 566863002: Remove deprecated extension notification from ProcessManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the errors for untitest Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « extensions/browser/process_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 original_context(), extension_registry())); 104 original_context(), extension_registry()));
105 105
106 EXPECT_EQ(original_context(), manager1->GetBrowserContext()); 106 EXPECT_EQ(original_context(), manager1->GetBrowserContext());
107 EXPECT_EQ(0u, manager1->background_hosts().size()); 107 EXPECT_EQ(0u, manager1->background_hosts().size());
108 108
109 // It observes other notifications from this context. 109 // It observes other notifications from this context.
110 EXPECT_TRUE(IsRegistered(manager1.get(), 110 EXPECT_TRUE(IsRegistered(manager1.get(),
111 extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED, 111 extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
112 original_context())); 112 original_context()));
113 EXPECT_TRUE(IsRegistered(manager1.get(), 113 EXPECT_TRUE(IsRegistered(manager1.get(),
114 extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
115 original_context()));
116 EXPECT_TRUE(
117 IsRegistered(manager1.get(),
118 extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
119 original_context()));
120 EXPECT_TRUE(IsRegistered(manager1.get(),
121 extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED, 114 extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
122 original_context())); 115 original_context()));
123 116
124 // Test for an incognito context ProcessManager. 117 // Test for an incognito context ProcessManager.
125 scoped_ptr<ProcessManager> manager2( 118 scoped_ptr<ProcessManager> manager2(
126 ProcessManager::CreateIncognitoForTesting(incognito_context(), 119 ProcessManager::CreateIncognitoForTesting(incognito_context(),
127 original_context(), 120 original_context(),
128 manager1.get(), 121 manager1.get(),
129 extension_registry())); 122 extension_registry()));
130 123
131 EXPECT_EQ(incognito_context(), manager2->GetBrowserContext()); 124 EXPECT_EQ(incognito_context(), manager2->GetBrowserContext());
132 EXPECT_EQ(0u, manager2->background_hosts().size()); 125 EXPECT_EQ(0u, manager2->background_hosts().size());
133 126
134 // Some notifications are observed for the original context.
135 EXPECT_TRUE(IsRegistered(manager2.get(),
136 extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
137 original_context()));
138
139 // Some notifications are observed for the incognito context. 127 // Some notifications are observed for the incognito context.
140 EXPECT_TRUE(IsRegistered(manager2.get(), 128 EXPECT_TRUE(IsRegistered(manager2.get(),
141 extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED, 129 extensions::NOTIFICATION_EXTENSION_HOST_DESTROYED,
142 incognito_context())); 130 incognito_context()));
143 131
144 // Some are not observed at all. 132 // Some are not observed at all.
145 EXPECT_FALSE( 133 EXPECT_FALSE(
146 IsRegistered(manager2.get(), 134 IsRegistered(manager2.get(),
147 extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED, 135 extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED,
148 original_context())); 136 original_context()));
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 scoped_refptr<SiteInstance> site21 = 242 scoped_refptr<SiteInstance> site21 =
255 manager1->GetSiteInstanceForURL(ext2_url1); 243 manager1->GetSiteInstanceForURL(ext2_url1);
256 EXPECT_NE(site11, site21); 244 EXPECT_NE(site11, site21);
257 245
258 scoped_refptr<SiteInstance> other_profile_site = 246 scoped_refptr<SiteInstance> other_profile_site =
259 manager2->GetSiteInstanceForURL(ext1_url1); 247 manager2->GetSiteInstanceForURL(ext1_url1);
260 EXPECT_NE(site11, other_profile_site); 248 EXPECT_NE(site11, other_profile_site);
261 } 249 }
262 250
263 } // namespace extensions 251 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/process_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698