| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ash/shelf/shelf_delegate.h" | 5 #include "ash/shelf/shelf_delegate.h" |
| 6 #include "ash/shelf/shelf_util.h" | 6 #include "ash/shelf/shelf_util.h" |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/wm/window_util.h" | 8 #include "ash/wm/window_util.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "chrome/browser/extensions/extension_browsertest.h" | 11 #include "chrome/browser/extensions/extension_browsertest.h" |
| 12 #include "chrome/browser/ui/app_list/app_list_service.h" | 12 #include "chrome/browser/ui/app_list/app_list_service.h" |
| 13 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" |
| 14 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" |
| 13 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" | 15 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" |
| 14 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" | 16 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" |
| 15 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.h" | 17 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.h" |
| 16 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 18 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 17 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" | 19 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" |
| 18 #include "chromeos/chromeos_switches.h" | 20 #include "chromeos/chromeos_switches.h" |
| 19 #include "content/public/test/browser_test_utils.h" | 21 #include "content/public/test/browser_test_utils.h" |
| 20 #include "mojo/common/common_type_converters.h" | 22 #include "mojo/common/common_type_converters.h" |
| 21 | 23 |
| 22 namespace mojo { | 24 namespace mojo { |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 164 |
| 163 arc::ArcAuthService* auth_service() { return arc::ArcAuthService::Get(); } | 165 arc::ArcAuthService* auth_service() { return arc::ArcAuthService::Get(); } |
| 164 | 166 |
| 165 private: | 167 private: |
| 166 DISALLOW_COPY_AND_ASSIGN(ArcAppLauncherBrowserTest); | 168 DISALLOW_COPY_AND_ASSIGN(ArcAppLauncherBrowserTest); |
| 167 }; | 169 }; |
| 168 | 170 |
| 169 // This tests validates pin state on package update and remove. | 171 // This tests validates pin state on package update and remove. |
| 170 IN_PROC_BROWSER_TEST_F(ArcAppLauncherBrowserTest, PinOnPackageUpdateAndRemove) { | 172 IN_PROC_BROWSER_TEST_F(ArcAppLauncherBrowserTest, PinOnPackageUpdateAndRemove) { |
| 171 StartInstance(); | 173 StartInstance(); |
| 174 |
| 175 // Make use app list sync service is started. Normally it is started when |
| 176 // sycing is initialized. |
| 177 app_list::AppListSyncableServiceFactory::GetForProfile(profile())->GetModel(); |
| 178 |
| 172 InstallTestApps(true); | 179 InstallTestApps(true); |
| 173 SendPackageAdded(false); | 180 SendPackageAdded(false); |
| 174 | 181 |
| 175 const std::string app_id1 = GetTestApp1Id(); | 182 const std::string app_id1 = GetTestApp1Id(); |
| 176 const std::string app_id2 = GetTestApp2Id(); | 183 const std::string app_id2 = GetTestApp2Id(); |
| 177 shelf_delegate()->PinAppWithID(app_id1); | 184 shelf_delegate()->PinAppWithID(app_id1); |
| 178 shelf_delegate()->PinAppWithID(app_id2); | 185 shelf_delegate()->PinAppWithID(app_id2); |
| 179 const ash::ShelfID shelf_id1_before = | 186 const ash::ShelfID shelf_id1_before = |
| 180 shelf_delegate()->GetShelfIDForAppID(app_id1); | 187 shelf_delegate()->GetShelfIDForAppID(app_id1); |
| 181 EXPECT_TRUE(shelf_id1_before); | 188 EXPECT_TRUE(shelf_id1_before); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 SendPackageAdded(true); | 221 SendPackageAdded(true); |
| 215 EXPECT_TRUE(app_list_service->IsAppListVisible()); | 222 EXPECT_TRUE(app_list_service->IsAppListVisible()); |
| 216 | 223 |
| 217 app_list_service->DismissAppList(); | 224 app_list_service->DismissAppList(); |
| 218 EXPECT_FALSE(app_list_service->IsAppListVisible()); | 225 EXPECT_FALSE(app_list_service->IsAppListVisible()); |
| 219 | 226 |
| 220 // Send package update event. App list is not shown. | 227 // Send package update event. App list is not shown. |
| 221 SendPackageAdded(true); | 228 SendPackageAdded(true); |
| 222 EXPECT_FALSE(app_list_service->IsAppListVisible()); | 229 EXPECT_FALSE(app_list_service->IsAppListVisible()); |
| 223 } | 230 } |
| OLD | NEW |