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

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

Issue 1130903006: cros: Fix DriveAppProvider racing during initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « chrome/browser/apps/drive/drive_app_provider.cc ('k') | no next file » | 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 50c9f6e9d100fca103b6e2d8d24fd3f8f96cc6e8..8b4ebf7b1e7f47c90df0cb2650e71d4987df2622 100644
--- a/chrome/browser/apps/drive/drive_app_provider_browsertest.cc
+++ b/chrome/browser/apps/drive/drive_app_provider_browsertest.cc
@@ -583,3 +583,44 @@ IN_PROC_BROWSER_TEST_F(DriveAppProviderTest, UninstallChangedFromSync) {
EXPECT_TRUE(ExtensionRegistry::Get(profile())->GetExtensionById(
chrome_app_id, ExtensionRegistry::EVERYTHING));
}
+
+// Tests that sync changes are processed after DriveAppRegistry is updated.
+IN_PROC_BROWSER_TEST_F(DriveAppProviderTest,
+ PRE_UpdateAfterDriveAppRegistryUpdate) {
+ // Add a Drive app.
+ fake_drive_service()->AddApp(
+ kDriveAppId, kDriveAppName, kChromeAppId, kLaunchUrl, true);
+ RefreshDriveAppRegistry();
+ WaitForPendingDriveAppConverters();
+
+ // The Drive app is present in the system.
+ std::string chrome_app_id = mapping()->GetChromeApp(kDriveAppId);
+ EXPECT_FALSE(chrome_app_id.empty());
+ EXPECT_TRUE(ExtensionRegistry::Get(profile())->GetExtensionById(
+ chrome_app_id, ExtensionRegistry::EVERYTHING));
+}
+IN_PROC_BROWSER_TEST_F(DriveAppProviderTest,
+ UpdateAfterDriveAppRegistryUpdate) {
+ // On the next run, uninstall from sync before DriveAppRegistry updates.
+ provider()->AddUninstalledDriveAppFromSync(kDriveAppId);
+ content::RunAllPendingInMessageLoop();
+ WaitForPendingDriveAppConverters();
+
+ // The app should still be there.
+ std::string chrome_app_id = mapping()->GetChromeApp(kDriveAppId);
+ EXPECT_FALSE(chrome_app_id.empty());
+ EXPECT_TRUE(ExtensionRegistry::Get(profile())->GetExtensionById(
+ chrome_app_id, ExtensionRegistry::EVERYTHING));
+
+ // Now update DriveAppRegistry.
+ fake_drive_service()->AddApp(
+ kDriveAppId, kDriveAppName, kChromeAppId, kLaunchUrl, true);
+ RefreshDriveAppRegistry();
+ WaitForPendingDriveAppConverters();
+
+ // The app should be gone.
+ chrome_app_id = mapping()->GetChromeApp(kDriveAppId);
+ EXPECT_TRUE(chrome_app_id.empty());
+ EXPECT_FALSE(ExtensionRegistry::Get(profile())->GetExtensionById(
+ chrome_app_id, ExtensionRegistry::EVERYTHING));
+}
« no previous file with comments | « chrome/browser/apps/drive/drive_app_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698