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

Unified Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc

Issue 2416133002: Implement local storage for App List in case app sync is off. (Closed)
Patch Set: method renamed Created 4 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
« no previous file with comments | « chrome/browser/ui/ash/chrome_launcher_prefs.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc
index 5ca223434d5449b244c5b3b6d6164bdfd74ed512..76e8ebfc12c462e5069909b4f03645bc5af9908d 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc
@@ -345,6 +345,11 @@ class ChromeLauncherControllerImplTest : public BrowserWithTestWindowTest {
if (auto_start_arc_test_)
arc_test_.SetUp(profile());
+ // Wait until |extension_system| is signaled as started.
+ base::RunLoop run_loop;
+ extension_system->ready().Post(FROM_HERE, run_loop.QuitClosure());
+ run_loop.Run();
+
app_service_ =
app_list::AppListSyncableServiceFactory::GetForProfile(profile());
StartAppSyncService(syncer::SyncDataList());
@@ -4015,3 +4020,35 @@ TEST_F(ChromeLauncherControllerImplTest, CheckPositionConflict) {
EXPECT_TRUE(
position_3.Equals(app_service_->GetPinPosition(extension3_->id())));
}
+
+// Test the case when sync app is turned off and we need to use local copy to
+// support user's pins.
+TEST_F(ChromeLauncherControllerImplTest, SyncOffLocalUpdate) {
+ InitLauncherController();
+
+ extension_service_->AddExtension(extension1_.get());
+ extension_service_->AddExtension(extension2_.get());
+
+ syncer::SyncChangeList sync_list;
+ InsertAddPinChange(&sync_list, 0, extension_misc::kChromeAppId);
+ InsertAddPinChange(&sync_list, 1, extension1_->id());
+ InsertAddPinChange(&sync_list, 1, extension2_->id());
+ SendPinChanges(sync_list, true);
+
+ EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus());
+
+ syncer::SyncDataList copy_sync_list =
+ app_service_->GetAllSyncData(syncer::APP_LIST);
+
+ app_service_->StopSyncing(syncer::APP_LIST);
+ RecreateChromeLauncher();
+
+ // Pinned state should not change.
+ EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus());
+ launcher_controller_->UnpinAppWithID(extension2_->id());
+ EXPECT_EQ("AppList, Chrome, App1", GetPinnedAppStatus());
+
+ // Resume syncing and sync information overrides local copy.
+ StartAppSyncService(copy_sync_list);
+ EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus());
+}
« no previous file with comments | « chrome/browser/ui/ash/chrome_launcher_prefs.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698