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

Unified Diff: chrome/browser/extensions/process_manager_unittest.cc

Issue 62713003: Move ExtensionProcessManager to src/extensions, part 4 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/process_manager_browsertest.cc ('k') | chrome/browser/extensions/process_map.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/process_manager_unittest.cc
diff --git a/chrome/browser/extensions/extension_process_manager_unittest.cc b/chrome/browser/extensions/process_manager_unittest.cc
similarity index 83%
rename from chrome/browser/extensions/extension_process_manager_unittest.cc
rename to chrome/browser/extensions/process_manager_unittest.cc
index c8ca541e46ff86935adc896e488bdb144cae3733..9ad05db5c16a3ea83582db0988364bc4d149650f 100644
--- a/chrome/browser/extensions/extension_process_manager_unittest.cc
+++ b/chrome/browser/extensions/process_manager_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/extensions/extension_process_manager.h"
+#include "extensions/browser/process_manager.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/extension_error_reporter.h"
@@ -15,8 +15,15 @@
using content::SiteInstance;
+namespace extensions {
+
+// TODO(jamescook): Convert this from TestingProfile to TestBrowserContext and
+// move to extensions/browser. This is dependent on ExtensionPrefs being
+// converted and ExtensionSystem being converted or eliminated.
+// http://crbug.com/315855
+
// make the test a PlatformTest to setup autorelease pools properly on mac
-class ExtensionProcessManagerTest : public testing::Test {
+class ProcessManagerTest : public testing::Test {
public:
static void SetUpTestCase() {
ExtensionErrorReporter::Init(false); // no noisy errors
@@ -28,20 +35,20 @@ class ExtensionProcessManagerTest : public testing::Test {
// Returns true if the notification |type| is registered for |manager| with
// source |profile|. Pass NULL for |profile| for all sources.
- static bool IsRegistered(ExtensionProcessManager* manager,
- int type,
- TestingProfile* profile) {
+ static bool IsRegistered(ProcessManager* manager,
+ int type,
+ TestingProfile* profile) {
return manager->registrar_.IsRegistered(
manager, type, content::Source<Profile>(profile));
}
};
// Test that notification registration works properly.
-TEST_F(ExtensionProcessManagerTest, ExtensionNotificationRegistration) {
+TEST_F(ProcessManagerTest, ExtensionNotificationRegistration) {
// Test for a normal profile.
scoped_ptr<TestingProfile> original_profile(new TestingProfile);
- scoped_ptr<ExtensionProcessManager> manager1(
- ExtensionProcessManager::Create(original_profile.get()));
+ scoped_ptr<ProcessManager> manager1(
+ ProcessManager::Create(original_profile.get()));
EXPECT_EQ(original_profile.get(), manager1->GetBrowserContext());
EXPECT_EQ(0u, manager1->background_hosts().size());
@@ -65,8 +72,8 @@ TEST_F(ExtensionProcessManagerTest, ExtensionNotificationRegistration) {
builder.SetIncognito();
scoped_ptr<TestingProfile> incognito_profile = builder.Build();
incognito_profile->SetOriginalProfile(original_profile.get());
- scoped_ptr<ExtensionProcessManager> manager2(
- ExtensionProcessManager::Create(incognito_profile.get()));
+ scoped_ptr<ProcessManager> manager2(
+ ProcessManager::Create(incognito_profile.get()));
EXPECT_EQ(incognito_profile.get(), manager2->GetBrowserContext());
EXPECT_EQ(0u, manager2->background_hosts().size());
@@ -102,17 +109,15 @@ TEST_F(ExtensionProcessManagerTest, ExtensionNotificationRegistration) {
// Test that extensions get grouped in the right SiteInstance (and therefore
// process) based on their URLs.
-TEST_F(ExtensionProcessManagerTest, ProcessGrouping) {
+TEST_F(ProcessManagerTest, ProcessGrouping) {
// Extensions in different profiles should always be different SiteInstances.
// Note: we don't initialize these, since we're not testing that
// functionality. This means we can get away with a NULL UserScriptMaster.
TestingProfile profile1;
- scoped_ptr<ExtensionProcessManager> manager1(
- ExtensionProcessManager::Create(&profile1));
+ scoped_ptr<ProcessManager> manager1(ProcessManager::Create(&profile1));
TestingProfile profile2;
- scoped_ptr<ExtensionProcessManager> manager2(
- ExtensionProcessManager::Create(&profile2));
+ scoped_ptr<ProcessManager> manager2(ProcessManager::Create(&profile2));
// Extensions with common origins ("scheme://id/") should be grouped in the
// same SiteInstance.
@@ -134,3 +139,5 @@ TEST_F(ExtensionProcessManagerTest, ProcessGrouping) {
manager2->GetSiteInstanceForURL(ext1_url1);
EXPECT_NE(site11, other_profile_site);
}
+
+} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/process_manager_browsertest.cc ('k') | chrome/browser/extensions/process_map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698