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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc

Issue 2210143003: arc: Handle non-launchable apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment fixed 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 return appinfo; 866 return appinfo;
867 } 867 }
868 868
869 std::string AddArcAppAndShortcut(const arc::mojom::AppInfo& app_info) { 869 std::string AddArcAppAndShortcut(const arc::mojom::AppInfo& app_info) {
870 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); 870 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs();
871 // Adding app to the prefs, and check that the app is accessible by id. 871 // Adding app to the prefs, and check that the app is accessible by id.
872 prefs->AddAppAndShortcut( 872 prefs->AddAppAndShortcut(
873 app_info.name, app_info.package_name, app_info.activity, 873 app_info.name, app_info.package_name, app_info.activity,
874 std::string() /* intent_uri */, std::string() /* icon_resource_id */, 874 std::string() /* intent_uri */, std::string() /* icon_resource_id */,
875 false /* sticky */, true /* notifications_enabled */, 875 false /* sticky */, true /* notifications_enabled */,
876 false /* shortcut */, app_info.orientation_lock); 876 false /* shortcut */, true /* launchable */, app_info.orientation_lock);
877 const std::string app_id = 877 const std::string app_id =
878 ArcAppListPrefs::GetAppId(app_info.package_name, app_info.activity); 878 ArcAppListPrefs::GetAppId(app_info.package_name, app_info.activity);
879 EXPECT_TRUE(prefs->GetApp(app_id)); 879 EXPECT_TRUE(prefs->GetApp(app_id));
880 return app_id; 880 return app_id;
881 } 881 }
882 882
883 void NotifyOnTaskCreated(const arc::mojom::AppInfo& appinfo, 883 void NotifyOnTaskCreated(const arc::mojom::AppInfo& appinfo,
884 int32_t task_id) { 884 int32_t task_id) {
885 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); 885 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs();
886 prefs->OnTaskCreated(task_id, appinfo.package_name, appinfo.activity); 886 prefs->OnTaskCreated(task_id, appinfo.name, appinfo.package_name,
887 appinfo.activity);
887 } 888 }
888 889
889 void NotifyOnTaskOrientationLockRequested(int32_t task_id, 890 void NotifyOnTaskOrientationLockRequested(int32_t task_id,
890 OrientationLock lock) { 891 OrientationLock lock) {
891 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); 892 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs();
892 prefs->OnTaskOrientationLockRequested(task_id, lock); 893 prefs->OnTaskOrientationLockRequested(task_id, lock);
893 } 894 }
894 895
895 // Needed for extension service & friends to work. 896 // Needed for extension service & friends to work.
896 scoped_refptr<Extension> extension1_; 897 scoped_refptr<Extension> extension1_;
(...skipping 2757 matching lines...) Expand 10 before | Expand all | Expand 10 after
3654 EXPECT_FALSE(controller->rotation_locked()); 3655 EXPECT_FALSE(controller->rotation_locked());
3655 EXPECT_EQ(display::Display::ROTATE_0, 3656 EXPECT_EQ(display::Display::ROTATE_0,
3656 display::Screen::GetScreen()->GetPrimaryDisplay().rotation()); 3657 display::Screen::GetScreen()->GetPrimaryDisplay().rotation());
3657 3658
3658 NotifyOnTaskOrientationLockRequested(task_id_current_, 3659 NotifyOnTaskOrientationLockRequested(task_id_current_,
3659 OrientationLock::CURRENT); 3660 OrientationLock::CURRENT);
3660 EXPECT_TRUE(controller->rotation_locked()); 3661 EXPECT_TRUE(controller->rotation_locked());
3661 EXPECT_EQ(display::Display::ROTATE_0, 3662 EXPECT_EQ(display::Display::ROTATE_0,
3662 display::Screen::GetScreen()->GetPrimaryDisplay().rotation()); 3663 display::Screen::GetScreen()->GetPrimaryDisplay().rotation());
3663 } 3664 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698