| 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();
|
|
|