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

Side by Side Diff: chrome/browser/ui/app_list/arc/arc_app_unittest.cc

Issue 2257923002: arc: Handle non-launchable apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 EXPECT_FALSE(launcher3.app_launched()); 905 EXPECT_FALSE(launcher3.app_launched());
906 EXPECT_FALSE(prefs->HasObserver(&launcher1)); 906 EXPECT_FALSE(prefs->HasObserver(&launcher1));
907 EXPECT_TRUE(prefs->HasObserver(&launcher3)); 907 EXPECT_TRUE(prefs->HasObserver(&launcher3));
908 908
909 ArcAppLauncher launcher2(profile(), id2, true); 909 ArcAppLauncher launcher2(profile(), id2, true);
910 EXPECT_TRUE(launcher2.app_launched()); 910 EXPECT_TRUE(launcher2.app_launched());
911 EXPECT_FALSE(prefs->HasObserver(&launcher2)); 911 EXPECT_FALSE(prefs->HasObserver(&launcher2));
912 ASSERT_EQ(2u, app_instance()->launch_requests().size()); 912 ASSERT_EQ(2u, app_instance()->launch_requests().size());
913 EXPECT_TRUE(app_instance()->launch_requests()[1]->IsForApp(app2)); 913 EXPECT_TRUE(app_instance()->launch_requests()[1]->IsForApp(app2));
914 } 914 }
915
916 // Validates an app that have no launchable flag.
917 TEST_F(ArcAppModelBuilderTest, NonLaunchableApp) {
918 ArcAppListPrefs* prefs = ArcAppListPrefs::Get(profile_.get());
919 ASSERT_NE(nullptr, prefs);
920
921 ValidateHaveApps(std::vector<arc::mojom::AppInfo>());
922 app_instance()->RefreshAppList();
923 // Send all except first.
924 std::vector<arc::mojom::AppInfo> apps(fake_apps().begin() + 1,
925 fake_apps().end());
926 app_instance()->SendRefreshAppList(apps);
927 ValidateHaveApps(apps);
928
929 const std::string app_id = ArcAppTest::GetAppId(fake_apps()[0]);
930
931 EXPECT_FALSE(prefs->IsRegistered(app_id));
932 EXPECT_FALSE(FindArcItem(app_id));
933 app_instance()->SendTaskCreated(0, fake_apps()[0]);
934 // App should not appear now in the model but should be registered.
935 EXPECT_FALSE(FindArcItem(app_id));
936 EXPECT_TRUE(prefs->IsRegistered(app_id));
937 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc ('k') | chrome/browser/ui/app_list/arc/arc_app_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698