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> |
11 #include <memory> | 11 #include <memory> |
12 #include <set> | 12 #include <set> |
13 #include <string> | 13 #include <string> |
14 #include <utility> | 14 #include <utility> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "ash/common/ash_switches.h" | 17 #include "ash/common/ash_switches.h" |
18 #include "ash/common/shelf/shelf_item_delegate_manager.h" | |
19 #include "ash/common/shelf/shelf_model.h" | 18 #include "ash/common/shelf/shelf_model.h" |
20 #include "ash/common/shelf/shelf_model_observer.h" | 19 #include "ash/common/shelf/shelf_model_observer.h" |
21 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 20 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
22 #include "ash/common/wm_shell.h" | 21 #include "ash/common/wm_shell.h" |
23 #include "ash/display/screen_orientation_controller_chromeos.h" | 22 #include "ash/display/screen_orientation_controller_chromeos.h" |
24 #include "ash/shell.h" | 23 #include "ash/shell.h" |
25 #include "ash/test/ash_test_helper.h" | 24 #include "ash/test/ash_test_helper.h" |
26 #include "ash/test/shelf_item_delegate_manager_test_api.h" | |
27 #include "ash/test/test_session_state_delegate.h" | 25 #include "ash/test/test_session_state_delegate.h" |
28 #include "ash/test/test_shell_delegate.h" | 26 #include "ash/test/test_shell_delegate.h" |
29 #include "ash/wm/window_util.h" | 27 #include "ash/wm/window_util.h" |
30 #include "base/command_line.h" | 28 #include "base/command_line.h" |
31 #include "base/compiler_specific.h" | 29 #include "base/compiler_specific.h" |
32 #include "base/files/file_path.h" | 30 #include "base/files/file_path.h" |
33 #include "base/location.h" | 31 #include "base/location.h" |
34 #include "base/macros.h" | 32 #include "base/macros.h" |
35 #include "base/memory/ptr_util.h" | 33 #include "base/memory/ptr_util.h" |
36 #include "base/message_loop/message_loop.h" | 34 #include "base/message_loop/message_loop.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 145 |
148 void ShelfItemChanged(int index, const ash::ShelfItem& old_item) override { | 146 void ShelfItemChanged(int index, const ash::ShelfItem& old_item) override { |
149 ++changed_; | 147 ++changed_; |
150 last_index_ = index; | 148 last_index_ = index; |
151 } | 149 } |
152 | 150 |
153 void ShelfItemMoved(int start_index, int target_index) override { | 151 void ShelfItemMoved(int start_index, int target_index) override { |
154 last_index_ = target_index; | 152 last_index_ = target_index; |
155 } | 153 } |
156 | 154 |
| 155 void OnSetShelfItemDelegate(ash::ShelfID id, |
| 156 ash::ShelfItemDelegate* item_delegate) override {} |
| 157 |
157 void clear_counts() { | 158 void clear_counts() { |
158 added_ = 0; | 159 added_ = 0; |
159 removed_ = 0; | 160 removed_ = 0; |
160 changed_ = 0; | 161 changed_ = 0; |
161 last_index_ = 0; | 162 last_index_ = 0; |
162 } | 163 } |
163 | 164 |
164 int added() const { return added_; } | 165 int added() const { return added_; } |
165 int removed() const { return removed_; } | 166 int removed() const { return removed_; } |
166 int changed() const { return changed_; } | 167 int changed() const { return changed_; } |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 if (!profile_manager_) { | 324 if (!profile_manager_) { |
324 profile_manager_.reset( | 325 profile_manager_.reset( |
325 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); | 326 new TestingProfileManager(TestingBrowserProcess::GetGlobal())); |
326 ASSERT_TRUE(profile_manager_->SetUp()); | 327 ASSERT_TRUE(profile_manager_->SetUp()); |
327 } | 328 } |
328 | 329 |
329 model_.reset(new ash::ShelfModel); | 330 model_.reset(new ash::ShelfModel); |
330 model_observer_.reset(new TestShelfModelObserver); | 331 model_observer_.reset(new TestShelfModelObserver); |
331 model_->AddObserver(model_observer_.get()); | 332 model_->AddObserver(model_observer_.get()); |
332 | 333 |
333 if (ash::Shell::HasInstance()) { | |
334 item_delegate_manager_ = | |
335 ash::Shell::GetInstance()->shelf_item_delegate_manager(); | |
336 } else { | |
337 item_delegate_manager_ = | |
338 new ash::ShelfItemDelegateManager(model_.get()); | |
339 } | |
340 | |
341 base::DictionaryValue manifest; | 334 base::DictionaryValue manifest; |
342 manifest.SetString(extensions::manifest_keys::kName, | 335 manifest.SetString(extensions::manifest_keys::kName, |
343 "launcher controller test extension"); | 336 "launcher controller test extension"); |
344 manifest.SetString(extensions::manifest_keys::kVersion, "1"); | 337 manifest.SetString(extensions::manifest_keys::kVersion, "1"); |
345 manifest.SetString(extensions::manifest_keys::kDescription, | 338 manifest.SetString(extensions::manifest_keys::kDescription, |
346 "for testing pinned apps"); | 339 "for testing pinned apps"); |
347 | 340 |
348 extensions::TestExtensionSystem* extension_system( | 341 extensions::TestExtensionSystem* extension_system( |
349 static_cast<extensions::TestExtensionSystem*>( | 342 static_cast<extensions::TestExtensionSystem*>( |
350 extensions::ExtensionSystem::Get(profile()))); | 343 extensions::ExtensionSystem::Get(profile()))); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 InsertAddPinChange(user_a, 6, extension_misc::kChromeAppId); | 459 InsertAddPinChange(user_a, 6, extension_misc::kChromeAppId); |
467 | 460 |
468 // Set user b preferences. | 461 // Set user b preferences. |
469 InsertAddPinChange(user_b, 0, extension7_->id()); | 462 InsertAddPinChange(user_b, 0, extension7_->id()); |
470 InsertAddPinChange(user_b, 1, extension8_->id()); | 463 InsertAddPinChange(user_b, 1, extension8_->id()); |
471 InsertAddPinChange(user_b, 2, extension_misc::kChromeAppId); | 464 InsertAddPinChange(user_b, 2, extension_misc::kChromeAppId); |
472 } | 465 } |
473 | 466 |
474 void TearDown() override { | 467 void TearDown() override { |
475 arc_test_.TearDown(); | 468 arc_test_.TearDown(); |
476 launcher_controller_->SetShelfItemDelegateManagerForTest(nullptr); | |
477 model_->RemoveObserver(model_observer_.get()); | 469 model_->RemoveObserver(model_observer_.get()); |
478 model_observer_.reset(); | 470 model_observer_.reset(); |
479 launcher_controller_.reset(); | 471 launcher_controller_.reset(); |
480 | 472 |
481 // item_delegate_manager_ must be deleted after launch_controller_, | 473 // |model_| must be deleted after |launch_controller_|, because |
482 // because launch_controller_ has a map of pointers to the data | 474 // |launch_controller_| has a map of pointers to the data held by |model_|. |
483 // hold by item_delegate_manager_. | 475 model_->Shutdown(); |
484 if (!ash::Shell::HasInstance()) | |
485 delete item_delegate_manager_; | |
486 | |
487 model_.reset(); | 476 model_.reset(); |
488 | 477 |
489 BrowserWithTestWindowTest::TearDown(); | 478 BrowserWithTestWindowTest::TearDown(); |
490 } | 479 } |
491 | 480 |
492 BrowserWindow* CreateBrowserWindow() override { | 481 BrowserWindow* CreateBrowserWindow() override { |
493 return CreateTestBrowserWindowAura(); | 482 return CreateTestBrowserWindowAura(); |
494 } | 483 } |
495 | 484 |
496 std::unique_ptr<Browser> CreateBrowserWithTestWindowForProfile( | 485 std::unique_ptr<Browser> CreateBrowserWithTestWindowForProfile( |
497 Profile* profile) { | 486 Profile* profile) { |
498 TestBrowserWindow* browser_window = CreateTestBrowserWindowAura(); | 487 TestBrowserWindow* browser_window = CreateTestBrowserWindowAura(); |
499 new TestBrowserWindowOwner(browser_window); | 488 new TestBrowserWindowOwner(browser_window); |
500 return base::WrapUnique( | 489 return base::WrapUnique( |
501 CreateBrowser(profile, Browser::TYPE_TABBED, false, browser_window)); | 490 CreateBrowser(profile, Browser::TYPE_TABBED, false, browser_window)); |
502 } | 491 } |
503 | 492 |
504 void AddAppListLauncherItem() { | 493 void AddAppListLauncherItem() { |
505 ash::ShelfItem app_list; | 494 ash::ShelfItem app_list; |
506 app_list.type = ash::TYPE_APP_LIST; | 495 app_list.type = ash::TYPE_APP_LIST; |
507 model_->Add(app_list); | 496 model_->Add(app_list); |
508 } | 497 } |
509 | 498 |
510 void InitLauncherController() { | 499 void InitLauncherController() { |
511 AddAppListLauncherItem(); | 500 AddAppListLauncherItem(); |
512 launcher_controller_.reset( | 501 launcher_controller_.reset( |
513 new ChromeLauncherControllerImpl(profile(), model_.get())); | 502 new ChromeLauncherControllerImpl(profile(), model_.get())); |
514 if (!ash::Shell::HasInstance()) | |
515 SetShelfItemDelegateManager(item_delegate_manager_); | |
516 launcher_controller_->Init(); | 503 launcher_controller_->Init(); |
517 } | 504 } |
518 | 505 |
519 void InitLauncherControllerWithBrowser() { | 506 void InitLauncherControllerWithBrowser() { |
520 InitLauncherController(); | 507 InitLauncherController(); |
521 chrome::NewTab(browser()); | 508 chrome::NewTab(browser()); |
522 browser()->window()->Show(); | 509 browser()->window()->Show(); |
523 } | 510 } |
524 | 511 |
525 void RecreateChromeLauncher() { | 512 void RecreateChromeLauncher() { |
(...skipping 27 matching lines...) Expand all Loading... |
553 std::vector<std::unique_ptr<AppIconLoader>> loaders; | 540 std::vector<std::unique_ptr<AppIconLoader>> loaders; |
554 loaders.push_back(std::move(loader1)); | 541 loaders.push_back(std::move(loader1)); |
555 loaders.push_back(std::move(loader2)); | 542 loaders.push_back(std::move(loader2)); |
556 launcher_controller_->SetAppIconLoadersForTest(loaders); | 543 launcher_controller_->SetAppIconLoadersForTest(loaders); |
557 } | 544 } |
558 | 545 |
559 void SetLauncherControllerHelper(LauncherControllerHelper* helper) { | 546 void SetLauncherControllerHelper(LauncherControllerHelper* helper) { |
560 launcher_controller_->SetLauncherControllerHelperForTest(helper); | 547 launcher_controller_->SetLauncherControllerHelperForTest(helper); |
561 } | 548 } |
562 | 549 |
563 void SetShelfItemDelegateManager(ash::ShelfItemDelegateManager* manager) { | |
564 launcher_controller_->SetShelfItemDelegateManagerForTest(manager); | |
565 } | |
566 | |
567 void InsertPrefValue(base::ListValue* pref_value, | 550 void InsertPrefValue(base::ListValue* pref_value, |
568 int index, | 551 int index, |
569 const std::string& extension_id) { | 552 const std::string& extension_id) { |
570 base::DictionaryValue* entry = new base::DictionaryValue(); | 553 base::DictionaryValue* entry = new base::DictionaryValue(); |
571 entry->SetString(ash::launcher::kPinnedAppsPrefAppIDPath, extension_id); | 554 entry->SetString(ash::launcher::kPinnedAppsPrefAppIDPath, extension_id); |
572 pref_value->Insert(index, entry); | 555 pref_value->Insert(index, entry); |
573 } | 556 } |
574 | 557 |
575 void InsertRemoveAllPinsChange(syncer::SyncChangeList* list) { | 558 void InsertRemoveAllPinsChange(syncer::SyncChangeList* list) { |
576 for (const auto& sync_peer : app_service_->sync_items()) { | 559 for (const auto& sync_peer : app_service_->sync_items()) { |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
927 std::unique_ptr<ash::ShelfModel> model_; | 910 std::unique_ptr<ash::ShelfModel> model_; |
928 std::unique_ptr<TestingProfileManager> profile_manager_; | 911 std::unique_ptr<TestingProfileManager> profile_manager_; |
929 | 912 |
930 // |item_delegate_manager_| owns |test_controller_|. | 913 // |item_delegate_manager_| owns |test_controller_|. |
931 LauncherItemController* test_controller_; | 914 LauncherItemController* test_controller_; |
932 | 915 |
933 ExtensionService* extension_service_; | 916 ExtensionService* extension_service_; |
934 | 917 |
935 app_list::AppListSyncableService* app_service_; | 918 app_list::AppListSyncableService* app_service_; |
936 | 919 |
937 ash::ShelfItemDelegateManager* item_delegate_manager_; | |
938 | |
939 private: | 920 private: |
940 TestBrowserWindow* CreateTestBrowserWindowAura() { | 921 TestBrowserWindow* CreateTestBrowserWindowAura() { |
941 std::unique_ptr<aura::Window> window(new aura::Window(nullptr)); | 922 std::unique_ptr<aura::Window> window(new aura::Window(nullptr)); |
942 window->set_id(0); | 923 window->set_id(0); |
943 window->SetType(ui::wm::WINDOW_TYPE_NORMAL); | 924 window->SetType(ui::wm::WINDOW_TYPE_NORMAL); |
944 window->Init(ui::LAYER_TEXTURED); | 925 window->Init(ui::LAYER_TEXTURED); |
945 aura::client::ParentWindowWithContext(window.get(), GetContext(), | 926 aura::client::ParentWindowWithContext(window.get(), GetContext(), |
946 gfx::Rect(200, 200)); | 927 gfx::Rect(200, 200)); |
947 | 928 |
948 return new TestBrowserWindowAura(std::move(window)); | 929 return new TestBrowserWindowAura(std::move(window)); |
(...skipping 2275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3224 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[2].type); | 3205 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[2].type); |
3225 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[3].type); | 3206 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[3].type); |
3226 | 3207 |
3227 // Move browser shortcut item from index 1 to index 3. | 3208 // Move browser shortcut item from index 1 to index 3. |
3228 model_->Move(1, 3); | 3209 model_->Move(1, 3); |
3229 EXPECT_EQ(ash::TYPE_APP_LIST, model_->items()[0].type); | 3210 EXPECT_EQ(ash::TYPE_APP_LIST, model_->items()[0].type); |
3230 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[1].type); | 3211 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[1].type); |
3231 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[2].type); | 3212 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[2].type); |
3232 EXPECT_EQ(ash::TYPE_BROWSER_SHORTCUT, model_->items()[3].type); | 3213 EXPECT_EQ(ash::TYPE_BROWSER_SHORTCUT, model_->items()[3].type); |
3233 | 3214 |
3234 SetShelfItemDelegateManager(nullptr); | |
3235 launcher_controller_.reset(); | 3215 launcher_controller_.reset(); |
3236 if (!ash::Shell::HasInstance()) { | 3216 model_->Shutdown(); |
3237 delete item_delegate_manager_; | |
3238 } else { | |
3239 // Clear already registered ShelfItemDelegate. | |
3240 ash::test::ShelfItemDelegateManagerTestAPI test(item_delegate_manager_); | |
3241 test.RemoveAllShelfItemDelegateForTest(); | |
3242 } | |
3243 model_.reset(new ash::ShelfModel); | 3217 model_.reset(new ash::ShelfModel); |
3244 | 3218 |
3245 AddAppListLauncherItem(); | 3219 AddAppListLauncherItem(); |
3246 launcher_controller_.reset( | 3220 launcher_controller_.reset( |
3247 ChromeLauncherControllerImpl::CreateInstance(profile(), model_.get())); | 3221 ChromeLauncherControllerImpl::CreateInstance(profile(), model_.get())); |
3248 helper = new TestLauncherControllerHelper(profile()); | 3222 helper = new TestLauncherControllerHelper(profile()); |
3249 helper->SetAppID(tab_strip_model->GetWebContentsAt(0), "1"); | 3223 helper->SetAppID(tab_strip_model->GetWebContentsAt(0), "1"); |
3250 helper->SetAppID(tab_strip_model->GetWebContentsAt(1), "2"); | 3224 helper->SetAppID(tab_strip_model->GetWebContentsAt(1), "2"); |
3251 SetLauncherControllerHelper(helper); | 3225 SetLauncherControllerHelper(helper); |
3252 if (!ash::Shell::HasInstance()) { | |
3253 item_delegate_manager_ = new ash::ShelfItemDelegateManager(model_.get()); | |
3254 SetShelfItemDelegateManager(item_delegate_manager_); | |
3255 } | |
3256 launcher_controller_->Init(); | 3226 launcher_controller_->Init(); |
3257 | 3227 |
3258 // Check ShelfItems are restored after resetting ChromeLauncherControllerImpl. | 3228 // Check ShelfItems are restored after resetting ChromeLauncherControllerImpl. |
3259 EXPECT_EQ(ash::TYPE_APP_LIST, model_->items()[0].type); | 3229 EXPECT_EQ(ash::TYPE_APP_LIST, model_->items()[0].type); |
3260 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[1].type); | 3230 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[1].type); |
3261 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[2].type); | 3231 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[2].type); |
3262 EXPECT_EQ(ash::TYPE_BROWSER_SHORTCUT, model_->items()[3].type); | 3232 EXPECT_EQ(ash::TYPE_BROWSER_SHORTCUT, model_->items()[3].type); |
3263 } | 3233 } |
3264 | 3234 |
3265 // Verifies pinned apps are persisted and restored. | 3235 // Verifies pinned apps are persisted and restored. |
(...skipping 16 matching lines...) Expand all Loading... |
3282 | 3252 |
3283 launcher_controller_->PinAppWithID("1"); | 3253 launcher_controller_->PinAppWithID("1"); |
3284 ash::ShelfID id = launcher_controller_->GetShelfIDForAppID("1"); | 3254 ash::ShelfID id = launcher_controller_->GetShelfIDForAppID("1"); |
3285 int app_index = model_->ItemIndexByID(id); | 3255 int app_index = model_->ItemIndexByID(id); |
3286 EXPECT_EQ(1, app_icon_loader->fetch_count()); | 3256 EXPECT_EQ(1, app_icon_loader->fetch_count()); |
3287 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[app_index].type); | 3257 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[app_index].type); |
3288 EXPECT_TRUE(launcher_controller_->IsAppPinned("1")); | 3258 EXPECT_TRUE(launcher_controller_->IsAppPinned("1")); |
3289 EXPECT_FALSE(launcher_controller_->IsAppPinned("0")); | 3259 EXPECT_FALSE(launcher_controller_->IsAppPinned("0")); |
3290 EXPECT_EQ(initial_size + 1, model_->items().size()); | 3260 EXPECT_EQ(initial_size + 1, model_->items().size()); |
3291 | 3261 |
3292 SetShelfItemDelegateManager(nullptr); | |
3293 launcher_controller_.reset(); | 3262 launcher_controller_.reset(); |
3294 if (!ash::Shell::HasInstance()) { | 3263 model_->Shutdown(); |
3295 delete item_delegate_manager_; | |
3296 } else { | |
3297 // Clear already registered ShelfItemDelegate. | |
3298 ash::test::ShelfItemDelegateManagerTestAPI test(item_delegate_manager_); | |
3299 test.RemoveAllShelfItemDelegateForTest(); | |
3300 } | |
3301 model_.reset(new ash::ShelfModel); | 3264 model_.reset(new ash::ShelfModel); |
3302 | 3265 |
3303 AddAppListLauncherItem(); | 3266 AddAppListLauncherItem(); |
3304 launcher_controller_.reset( | 3267 launcher_controller_.reset( |
3305 ChromeLauncherControllerImpl::CreateInstance(profile(), model_.get())); | 3268 ChromeLauncherControllerImpl::CreateInstance(profile(), model_.get())); |
3306 helper = new TestLauncherControllerHelper(profile()); | 3269 helper = new TestLauncherControllerHelper(profile()); |
3307 helper->SetAppID(tab_strip_model->GetWebContentsAt(0), "1"); | 3270 helper->SetAppID(tab_strip_model->GetWebContentsAt(0), "1"); |
3308 SetLauncherControllerHelper(helper); | 3271 SetLauncherControllerHelper(helper); |
3309 // app_icon_loader is owned by ChromeLauncherControllerImpl. | 3272 // app_icon_loader is owned by ChromeLauncherControllerImpl. |
3310 app_icon_loader = new TestAppIconLoaderImpl; | 3273 app_icon_loader = new TestAppIconLoaderImpl; |
3311 app_icon_loader->AddSupportedApp("1"); | 3274 app_icon_loader->AddSupportedApp("1"); |
3312 SetAppIconLoader(std::unique_ptr<AppIconLoader>(app_icon_loader)); | 3275 SetAppIconLoader(std::unique_ptr<AppIconLoader>(app_icon_loader)); |
3313 if (!ash::Shell::HasInstance()) { | |
3314 item_delegate_manager_ = new ash::ShelfItemDelegateManager(model_.get()); | |
3315 SetShelfItemDelegateManager(item_delegate_manager_); | |
3316 } | |
3317 launcher_controller_->Init(); | 3276 launcher_controller_->Init(); |
3318 | 3277 |
3319 EXPECT_EQ(1, app_icon_loader->fetch_count()); | 3278 EXPECT_EQ(1, app_icon_loader->fetch_count()); |
3320 ASSERT_EQ(initial_size + 1, model_->items().size()); | 3279 ASSERT_EQ(initial_size + 1, model_->items().size()); |
3321 EXPECT_TRUE(launcher_controller_->IsAppPinned("1")); | 3280 EXPECT_TRUE(launcher_controller_->IsAppPinned("1")); |
3322 EXPECT_FALSE(launcher_controller_->IsAppPinned("0")); | 3281 EXPECT_FALSE(launcher_controller_->IsAppPinned("0")); |
3323 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[app_index].type); | 3282 EXPECT_EQ(ash::TYPE_APP_SHORTCUT, model_->items()[app_index].type); |
3324 | 3283 |
3325 launcher_controller_->UnpinAppWithID("1"); | 3284 launcher_controller_->UnpinAppWithID("1"); |
3326 ASSERT_EQ(initial_size, model_->items().size()); | 3285 ASSERT_EQ(initial_size, model_->items().size()); |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3698 EXPECT_FALSE(controller->rotation_locked()); | 3657 EXPECT_FALSE(controller->rotation_locked()); |
3699 EXPECT_EQ(display::Display::ROTATE_0, | 3658 EXPECT_EQ(display::Display::ROTATE_0, |
3700 display::Screen::GetScreen()->GetPrimaryDisplay().rotation()); | 3659 display::Screen::GetScreen()->GetPrimaryDisplay().rotation()); |
3701 | 3660 |
3702 NotifyOnTaskOrientationLockRequested(task_id_current_, | 3661 NotifyOnTaskOrientationLockRequested(task_id_current_, |
3703 OrientationLock::CURRENT); | 3662 OrientationLock::CURRENT); |
3704 EXPECT_TRUE(controller->rotation_locked()); | 3663 EXPECT_TRUE(controller->rotation_locked()); |
3705 EXPECT_EQ(display::Display::ROTATE_0, | 3664 EXPECT_EQ(display::Display::ROTATE_0, |
3706 display::Screen::GetScreen()->GetPrimaryDisplay().rotation()); | 3665 display::Screen::GetScreen()->GetPrimaryDisplay().rotation()); |
3707 } | 3666 } |
OLD | NEW |