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

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

Issue 11190016: Do not add TabContents from packaged apps to the task manager. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_browsertest.cc
diff --git a/chrome/browser/extensions/extension_browsertest.cc b/chrome/browser/extensions/extension_browsertest.cc
index f63ce8f1374ae8b77cd2daf75ce02d85545aab10..f6a862778252aa938f5eca01e5f14d2c3e4422a4 100644
--- a/chrome/browser/extensions/extension_browsertest.cc
+++ b/chrome/browser/extensions/extension_browsertest.cc
@@ -75,11 +75,12 @@ void ExtensionBrowserTest::SetUpCommandLine(CommandLine* command_line) {
}
const Extension* ExtensionBrowserTest::LoadExtensionWithFlags(
+ Browser* browser, NotificationObserver* observer,
const FilePath& path, int flags) {
- ExtensionService* service = browser()->profile()->GetExtensionService();
+ ExtensionService* service = browser->profile()->GetExtensionService();
{
content::NotificationRegistrar registrar;
- registrar.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
+ registrar.Add(observer, chrome::NOTIFICATION_EXTENSION_LOADED,
content::NotificationService::AllSources());
scoped_refptr<extensions::UnpackedInstaller> installer(
extensions::UnpackedInstaller::Create(service));
@@ -139,7 +140,7 @@ const Extension* ExtensionBrowserTest::LoadExtensionWithFlags(
{
content::WindowedNotificationObserver load_signal(
chrome::NOTIFICATION_EXTENSION_LOADED,
- content::Source<Profile>(browser()->profile()));
+ content::Source<Profile>(browser->profile()));
CHECK(!service->IsIncognitoEnabled(extension_id));
if (flags & kFlagEnableIncognito) {
@@ -153,7 +154,7 @@ const Extension* ExtensionBrowserTest::LoadExtensionWithFlags(
{
content::WindowedNotificationObserver load_signal(
chrome::NOTIFICATION_EXTENSION_LOADED,
- content::Source<Profile>(browser()->profile()));
+ content::Source<Profile>(browser->profile()));
CHECK(service->AllowFileAccess(extension));
if (!(flags & kFlagEnableFileAccess)) {
service->SetAllowFileAccess(extension, false);
@@ -163,14 +164,15 @@ const Extension* ExtensionBrowserTest::LoadExtensionWithFlags(
}
}
- if (!WaitForExtensionViewsToLoad())
+ if (!WaitForExtensionViewsToLoad(browser, observer))
return NULL;
return extension;
}
-const Extension* ExtensionBrowserTest::LoadExtension(const FilePath& path) {
- return LoadExtensionWithFlags(path, kFlagEnableFileAccess);
+const Extension* ExtensionBrowserTest::LoadExtension(
+ Browser* browser, NotificationObserver* observer, const FilePath& path) {
+ return LoadExtensionWithFlags(browser, observer, path, kFlagEnableFileAccess);
}
const Extension* ExtensionBrowserTest::LoadExtensionIncognito(
@@ -453,14 +455,15 @@ bool ExtensionBrowserTest::WaitForPageActionVisibilityChangeTo(int count) {
return location_bar->PageActionVisibleCount() == count;
}
-bool ExtensionBrowserTest::WaitForExtensionViewsToLoad() {
+bool ExtensionBrowserTest::WaitForExtensionViewsToLoad(
+ Browser* browser, NotificationObserver* observer) {
// Wait for all the extension render view hosts that exist to finish loading.
content::NotificationRegistrar registrar;
- registrar.Add(this, content::NOTIFICATION_LOAD_STOP,
+ registrar.Add(observer, content::NOTIFICATION_LOAD_STOP,
content::NotificationService::AllSources());
ExtensionProcessManager* manager =
- browser()->profile()->GetExtensionProcessManager();
+ browser->profile()->GetExtensionProcessManager();
ExtensionProcessManager::ViewSet all_views = manager->GetAllViews();
for (ExtensionProcessManager::ViewSet::const_iterator iter =
all_views.begin();
« no previous file with comments | « chrome/browser/extensions/extension_browsertest.h ('k') | chrome/browser/extensions/platform_app_browsertest_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698