| OLD | NEW |
| 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 <memory> | 10 #include <memory> |
| (...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 934 app.sticky = false; | 934 app.sticky = false; |
| 935 apps.push_back(app); | 935 apps.push_back(app); |
| 936 | 936 |
| 937 app_instance()->RefreshAppList(); | 937 app_instance()->RefreshAppList(); |
| 938 app_instance()->SendRefreshAppList(apps); | 938 app_instance()->SendRefreshAppList(apps); |
| 939 | 939 |
| 940 app_info = prefs->GetApp(arc::kPlayStoreAppId); | 940 app_info = prefs->GetApp(arc::kPlayStoreAppId); |
| 941 ASSERT_TRUE(app_info); | 941 ASSERT_TRUE(app_info); |
| 942 EXPECT_TRUE(app_info->ready); | 942 EXPECT_TRUE(app_info->ready); |
| 943 | 943 |
| 944 arc_test()->arc_auth_service()->DisableArc(); | 944 arc_test()->arc_session_manager()->DisableArc(); |
| 945 | 945 |
| 946 app_info = prefs->GetApp(arc::kPlayStoreAppId); | 946 app_info = prefs->GetApp(arc::kPlayStoreAppId); |
| 947 ASSERT_TRUE(app_info); | 947 ASSERT_TRUE(app_info); |
| 948 EXPECT_FALSE(app_info->ready); | 948 EXPECT_FALSE(app_info->ready); |
| 949 | 949 |
| 950 arc::LaunchApp(profile(), arc::kPlayStoreAppId); | 950 arc::LaunchApp(profile(), arc::kPlayStoreAppId); |
| 951 EXPECT_TRUE(arc_test()->arc_auth_service()->IsArcEnabled()); | 951 EXPECT_TRUE(arc_test()->arc_session_manager()->IsArcEnabled()); |
| 952 } | 952 } |
| 953 | 953 |
| 954 // TODO(crbug.com/628425) -- reenable once this test is less flaky. | 954 // TODO(crbug.com/628425) -- reenable once this test is less flaky. |
| 955 TEST_F(ArcAppModelBuilderTest, DISABLED_IconLoader) { | 955 TEST_F(ArcAppModelBuilderTest, DISABLED_IconLoader) { |
| 956 const arc::mojom::AppInfo& app = fake_apps()[0]; | 956 const arc::mojom::AppInfo& app = fake_apps()[0]; |
| 957 const std::string app_id = ArcAppTest::GetAppId(app); | 957 const std::string app_id = ArcAppTest::GetAppId(app); |
| 958 | 958 |
| 959 ArcAppListPrefs* prefs = ArcAppListPrefs::Get(profile_.get()); | 959 ArcAppListPrefs* prefs = ArcAppListPrefs::Get(profile_.get()); |
| 960 ASSERT_NE(nullptr, prefs); | 960 ASSERT_NE(nullptr, prefs); |
| 961 | 961 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1131 ASSERT_TRUE(app_info); | 1131 ASSERT_TRUE(app_info); |
| 1132 EXPECT_TRUE(app_info->ready); | 1132 EXPECT_TRUE(app_info->ready); |
| 1133 } | 1133 } |
| 1134 | 1134 |
| 1135 // Uninstall first default package. Default app should go away. | 1135 // Uninstall first default package. Default app should go away. |
| 1136 app_instance()->SendPackageUninstalled(all_apps[0].package_name); | 1136 app_instance()->SendPackageUninstalled(all_apps[0].package_name); |
| 1137 all_apps.erase(all_apps.begin()); | 1137 all_apps.erase(all_apps.begin()); |
| 1138 ValidateHaveApps(all_apps); | 1138 ValidateHaveApps(all_apps); |
| 1139 | 1139 |
| 1140 // OptOut and default apps should exist minus first. | 1140 // OptOut and default apps should exist minus first. |
| 1141 arc_test()->arc_auth_service()->DisableArc(); | 1141 arc_test()->arc_session_manager()->DisableArc(); |
| 1142 all_apps = fake_default_apps(); | 1142 all_apps = fake_default_apps(); |
| 1143 all_apps.erase(all_apps.begin()); | 1143 all_apps.erase(all_apps.begin()); |
| 1144 ValidateHaveApps(all_apps); | 1144 ValidateHaveApps(all_apps); |
| 1145 } | 1145 } |
| 1146 | 1146 |
| 1147 TEST_F(ArcDefaulAppForManagedUserTest, DefaultAppsForManagedUser) { | 1147 TEST_F(ArcDefaulAppForManagedUserTest, DefaultAppsForManagedUser) { |
| 1148 const ArcAppListPrefs* const prefs = ArcAppListPrefs::Get(profile_.get()); | 1148 const ArcAppListPrefs* const prefs = ArcAppListPrefs::Get(profile_.get()); |
| 1149 ASSERT_TRUE(prefs); | 1149 ASSERT_TRUE(prefs); |
| 1150 | 1150 |
| 1151 // There is no default app for managed users except Play Store | 1151 // There is no default app for managed users except Play Store |
| 1152 for (const auto& app : fake_default_apps()) { | 1152 for (const auto& app : fake_default_apps()) { |
| 1153 const std::string app_id = ArcAppTest::GetAppId(app); | 1153 const std::string app_id = ArcAppTest::GetAppId(app); |
| 1154 EXPECT_FALSE(prefs->IsRegistered(app_id)); | 1154 EXPECT_FALSE(prefs->IsRegistered(app_id)); |
| 1155 EXPECT_FALSE(prefs->GetApp(app_id)); | 1155 EXPECT_FALSE(prefs->GetApp(app_id)); |
| 1156 } | 1156 } |
| 1157 } | 1157 } |
| OLD | NEW |