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

Unified Diff: chrome/browser/apps/drive/drive_app_provider_browsertest.cc

Issue 2740783003: Revert "Revert of Reland: Switch WindowedNotificationObserver to use base::RunLoop. (patchset #3 id… (Closed)
Patch Set: Fix comment. Created 3 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/device_local_account_external_policy_loader_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/apps/drive/drive_app_provider_browsertest.cc
diff --git a/chrome/browser/apps/drive/drive_app_provider_browsertest.cc b/chrome/browser/apps/drive/drive_app_provider_browsertest.cc
index b60fff1ad6fe009252fe5a92fb2df7de5683a9c0..cb46e960f0c6086e27c4e759548f2bfddc1c3f81 100644
--- a/chrome/browser/apps/drive/drive_app_provider_browsertest.cc
+++ b/chrome/browser/apps/drive/drive_app_provider_browsertest.cc
@@ -277,11 +277,11 @@ IN_PROC_BROWSER_TEST_F(DriveAppProviderTest, MatchingChromeAppInstalled) {
kDriveAppId, kDriveAppName, kChromeAppId, kLaunchUrl, true);
RefreshDriveAppRegistry();
WaitForPendingDriveAppConverters();
+ ExtensionRegistry* registry = ExtensionRegistry::Get(profile());
// An Url app should be created.
- const Extension* url_app =
- ExtensionRegistry::Get(profile())->GetExtensionById(
- mapping()->GetChromeApp(kDriveAppId), ExtensionRegistry::EVERYTHING);
+ const Extension* url_app = registry->GetExtensionById(
+ mapping()->GetChromeApp(kDriveAppId), ExtensionRegistry::EVERYTHING);
EXPECT_TRUE(url_app->is_hosted_app());
EXPECT_TRUE(url_app->from_bookmark());
@@ -290,16 +290,20 @@ IN_PROC_BROWSER_TEST_F(DriveAppProviderTest, MatchingChromeAppInstalled) {
EXPECT_EQ(url_app_id, mapping()->GetChromeApp(kDriveAppId));
EXPECT_TRUE(mapping()->IsChromeAppGenerated(url_app_id));
- // Installs a chrome app with matching id.
- InstallChromeApp(0);
+ // Install a chrome app with matching id.
+ size_t num_before = registry->enabled_extensions().size();
+ InstallChromeApp(1);
+ // Url app should be auto uninstalled. This happens asynchronously after the
+ // installation of the app that replaces it, so the task might still be
+ // pending.
+ content::RunAllPendingInMessageLoop();
+ EXPECT_FALSE(
+ registry->GetExtensionById(url_app_id, ExtensionRegistry::EVERYTHING));
+ EXPECT_EQ(num_before, registry->enabled_extensions().size());
// The Drive app should be mapped to chrome app.
EXPECT_EQ(kChromeAppId, mapping()->GetChromeApp(kDriveAppId));
EXPECT_FALSE(mapping()->IsChromeAppGenerated(kChromeAppId));
-
- // Url app should be auto uninstalled.
- EXPECT_FALSE(ExtensionRegistry::Get(profile())->GetExtensionById(
- url_app_id, ExtensionRegistry::EVERYTHING));
}
// Tests that the corresponding URL app is uninstalled when a Drive app is
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/device_local_account_external_policy_loader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698