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

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

Issue 2210143003: arc: Handle non-launchable apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unit_tests due rebase and mojo param order change - trivial 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 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 EXPECT_FALSE(launcher3.app_launched()); 904 EXPECT_FALSE(launcher3.app_launched());
905 EXPECT_FALSE(prefs->HasObserver(&launcher1)); 905 EXPECT_FALSE(prefs->HasObserver(&launcher1));
906 EXPECT_TRUE(prefs->HasObserver(&launcher3)); 906 EXPECT_TRUE(prefs->HasObserver(&launcher3));
907 907
908 ArcAppLauncher launcher2(profile(), id2, true); 908 ArcAppLauncher launcher2(profile(), id2, true);
909 EXPECT_TRUE(launcher2.app_launched()); 909 EXPECT_TRUE(launcher2.app_launched());
910 EXPECT_FALSE(prefs->HasObserver(&launcher2)); 910 EXPECT_FALSE(prefs->HasObserver(&launcher2));
911 ASSERT_EQ(2u, app_instance()->launch_requests().size()); 911 ASSERT_EQ(2u, app_instance()->launch_requests().size());
912 EXPECT_TRUE(app_instance()->launch_requests()[1]->IsForApp(app2)); 912 EXPECT_TRUE(app_instance()->launch_requests()[1]->IsForApp(app2));
913 } 913 }
914
915 // Validates an app that have no launchable flag.
916 TEST_F(ArcAppModelBuilderTest, NonLaunchableApp) {
917 ArcAppListPrefs* prefs = ArcAppListPrefs::Get(profile_.get());
918 ASSERT_NE(nullptr, prefs);
919
920 ValidateHaveApps(std::vector<arc::mojom::AppInfo>());
921 app_instance()->RefreshAppList();
922 // Send all except first.
923 std::vector<arc::mojom::AppInfo> apps(fake_apps().begin() + 1,
924 fake_apps().end());
925 app_instance()->SendRefreshAppList(apps);
926 ValidateHaveApps(apps);
927
928 const std::string app_id = ArcAppTest::GetAppId(fake_apps()[0]);
929
930 EXPECT_FALSE(prefs->IsRegistered(app_id));
931 EXPECT_FALSE(FindArcItem(app_id));
932 app_instance()->SendTaskCreated(0, fake_apps()[0]);
933 // App should not appear now in the model but should be registered.
934 EXPECT_FALSE(FindArcItem(app_id));
935 EXPECT_TRUE(prefs->IsRegistered(app_id));
936 }
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