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

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

Issue 2262723002: arc: Fix crash on Arc window close. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: patch for M53 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 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after
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);
1848 arc_test_.app_instance()->SendTaskCreated(1, arc_test_.fake_apps()[0]); 1852 arc_test_.app_instance()->SendTaskCreated(1, arc_test_.fake_apps()[0]);
1849 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); 1853 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(arc_app_id));
1854 CreateArcWindow(window_app_id2);
1850 arc_test_.app_instance()->SendTaskCreated(2, arc_test_.fake_apps()[0]); 1855 arc_test_.app_instance()->SendTaskCreated(2, arc_test_.fake_apps()[0]);
1851 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); 1856 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(arc_app_id));
1852 arc_test_.app_instance()->SendTaskDestroyed(1); 1857 arc_test_.app_instance()->SendTaskDestroyed(1);
1853 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); 1858 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(arc_app_id));
1854 arc_test_.app_instance()->SendTaskDestroyed(2); 1859 arc_test_.app_instance()->SendTaskDestroyed(2);
1855 EXPECT_EQ(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); 1860 EXPECT_EQ(0, launcher_controller_->GetShelfIDForAppID(arc_app_id));
1856 1861
1857 // Stopping bridge removes apps. 1862 // Stopping bridge removes apps.
1863 CreateArcWindow(window_app_id3);
1858 arc_test_.app_instance()->SendTaskCreated(3, arc_test_.fake_apps()[0]); 1864 arc_test_.app_instance()->SendTaskCreated(3, arc_test_.fake_apps()[0]);
1859 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); 1865 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(arc_app_id));
1860 arc_test_.StopArcInstance(); 1866 arc_test_.StopArcInstance();
1861 base::RunLoop().RunUntilIdle(); 1867 base::RunLoop().RunUntilIdle();
1862 EXPECT_EQ(0, launcher_controller_->GetShelfIDForAppID(arc_app_id)); 1868 EXPECT_EQ(0, launcher_controller_->GetShelfIDForAppID(arc_app_id));
1863 } 1869 }
1864 1870
1865 // Validate that Arc app is pinned correctly and pin is removed automatically 1871 // Validate that Arc app is pinned correctly and pin is removed automatically
1866 // once app is uninstalled. 1872 // once app is uninstalled.
1867 TEST_F(ChromeLauncherControllerImplTest, ArcAppPin) { 1873 TEST_F(ChromeLauncherControllerImplTest, ArcAppPin) {
(...skipping 1828 matching lines...) Expand 10 before | Expand all | Expand 10 after
3696 EXPECT_FALSE(controller->rotation_locked()); 3702 EXPECT_FALSE(controller->rotation_locked());
3697 EXPECT_EQ(display::Display::ROTATE_0, 3703 EXPECT_EQ(display::Display::ROTATE_0,
3698 display::Screen::GetScreen()->GetPrimaryDisplay().rotation()); 3704 display::Screen::GetScreen()->GetPrimaryDisplay().rotation());
3699 3705
3700 NotifyOnTaskOrientationLockRequested(task_id_current_, 3706 NotifyOnTaskOrientationLockRequested(task_id_current_,
3701 OrientationLock::CURRENT); 3707 OrientationLock::CURRENT);
3702 EXPECT_TRUE(controller->rotation_locked()); 3708 EXPECT_TRUE(controller->rotation_locked());
3703 EXPECT_EQ(display::Display::ROTATE_0, 3709 EXPECT_EQ(display::Display::ROTATE_0,
3704 display::Screen::GetScreen()->GetPrimaryDisplay().rotation()); 3710 display::Screen::GetScreen()->GetPrimaryDisplay().rotation());
3705 } 3711 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698