| OLD | NEW |
| 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 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1838 | 1838 |
| 1839 TEST_F(ChromeLauncherControllerImplTest, ArcRunningApp) { | 1839 TEST_F(ChromeLauncherControllerImplTest, ArcRunningApp) { |
| 1840 arc_test_.SetUp(profile()); | 1840 arc_test_.SetUp(profile()); |
| 1841 InitLauncherController(); | 1841 InitLauncherController(); |
| 1842 | 1842 |
| 1843 const std::string arc_app_id = ArcAppTest::GetAppId(arc_test_.fake_apps()[0]); | 1843 const std::string arc_app_id = ArcAppTest::GetAppId(arc_test_.fake_apps()[0]); |
| 1844 SendListOfArcApps(); | 1844 SendListOfArcApps(); |
| 1845 EXPECT_EQ(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); | 1845 EXPECT_EQ(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); |
| 1846 | 1846 |
| 1847 // Normal flow, create/destroy tasks. | 1847 // Normal flow, create/destroy tasks. |
| 1848 std::string window_app_id1("org.chromium.arc.1"); | |
| 1849 std::string window_app_id2("org.chromium.arc.2"); | |
| 1850 std::string window_app_id3("org.chromium.arc.3"); | |
| 1851 CreateArcWindow(window_app_id1); | |
| 1852 arc_test_.app_instance()->SendTaskCreated(1, arc_test_.fake_apps()[0]); | 1848 arc_test_.app_instance()->SendTaskCreated(1, arc_test_.fake_apps()[0]); |
| 1853 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); | 1849 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); |
| 1854 CreateArcWindow(window_app_id2); | |
| 1855 arc_test_.app_instance()->SendTaskCreated(2, arc_test_.fake_apps()[0]); | 1850 arc_test_.app_instance()->SendTaskCreated(2, arc_test_.fake_apps()[0]); |
| 1856 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); | 1851 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); |
| 1857 arc_test_.app_instance()->SendTaskDestroyed(1); | 1852 arc_test_.app_instance()->SendTaskDestroyed(1); |
| 1858 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); | 1853 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); |
| 1859 arc_test_.app_instance()->SendTaskDestroyed(2); | 1854 arc_test_.app_instance()->SendTaskDestroyed(2); |
| 1860 EXPECT_EQ(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); | 1855 EXPECT_EQ(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); |
| 1861 | 1856 |
| 1862 // Stopping bridge removes apps. | 1857 // Stopping bridge removes apps. |
| 1863 CreateArcWindow(window_app_id3); | |
| 1864 arc_test_.app_instance()->SendTaskCreated(3, arc_test_.fake_apps()[0]); | 1858 arc_test_.app_instance()->SendTaskCreated(3, arc_test_.fake_apps()[0]); |
| 1865 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); | 1859 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); |
| 1866 arc_test_.StopArcInstance(); | 1860 arc_test_.StopArcInstance(); |
| 1867 base::RunLoop().RunUntilIdle(); | 1861 base::RunLoop().RunUntilIdle(); |
| 1868 EXPECT_EQ(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); | 1862 EXPECT_EQ(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); |
| 1869 } | 1863 } |
| 1870 | 1864 |
| 1871 // Validate that Arc app is pinned correctly and pin is removed automatically | 1865 // Validate that Arc app is pinned correctly and pin is removed automatically |
| 1872 // once app is uninstalled. | 1866 // once app is uninstalled. |
| 1873 TEST_F(ChromeLauncherControllerImplTest, ArcAppPin) { | 1867 TEST_F(ChromeLauncherControllerImplTest, ArcAppPin) { |
| (...skipping 1828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3702 EXPECT_FALSE(controller->rotation_locked()); | 3696 EXPECT_FALSE(controller->rotation_locked()); |
| 3703 EXPECT_EQ(display::Display::ROTATE_0, | 3697 EXPECT_EQ(display::Display::ROTATE_0, |
| 3704 display::Screen::GetScreen()->GetPrimaryDisplay().rotation()); | 3698 display::Screen::GetScreen()->GetPrimaryDisplay().rotation()); |
| 3705 | 3699 |
| 3706 NotifyOnTaskOrientationLockRequested(task_id_current_, | 3700 NotifyOnTaskOrientationLockRequested(task_id_current_, |
| 3707 OrientationLock::CURRENT); | 3701 OrientationLock::CURRENT); |
| 3708 EXPECT_TRUE(controller->rotation_locked()); | 3702 EXPECT_TRUE(controller->rotation_locked()); |
| 3709 EXPECT_EQ(display::Display::ROTATE_0, | 3703 EXPECT_EQ(display::Display::ROTATE_0, |
| 3710 display::Screen::GetScreen()->GetPrimaryDisplay().rotation()); | 3704 display::Screen::GetScreen()->GetPrimaryDisplay().rotation()); |
| 3711 } | 3705 } |
| OLD | NEW |