Chromium Code Reviews| 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 <map> | 5 #include <map> |
| 6 #include <string> | 6 #include <string> |
| 7 #include <unordered_set> | 7 #include <unordered_set> |
|
Luis Héctor Chávez
2016/09/23 20:03:00
nit: #include <utility>
Ben Chan
2016/09/23 21:01:00
here's what I got from `git cl lint` and `cpplint.
Luis Héctor Chávez
2016/09/23 21:37:06
I didn't run git cl lint locally, just did the nor
| |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.h" |
| 12 | 12 |
| 13 #include "chrome/browser/extensions/extension_util.h" | 13 #include "chrome/browser/extensions/extension_util.h" |
| 14 #include "chrome/browser/extensions/menu_manager_factory.h" | 14 #include "chrome/browser/extensions/menu_manager_factory.h" |
| 15 #include "chrome/browser/ui/app_list/app_context_menu_delegate.h" | 15 #include "chrome/browser/ui/app_list/app_context_menu_delegate.h" |
| 16 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" | 16 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
| 17 #include "chrome/browser/ui/app_list/app_list_test_util.h" | 17 #include "chrome/browser/ui/app_list/app_list_test_util.h" |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 370 EXPECT_FALSE(menu->IsItemCheckedAt(2)); | 370 EXPECT_FALSE(menu->IsItemCheckedAt(2)); |
| 371 EXPECT_EQ(app_list::AppContextMenu::SHOW_APP_INFO, menu->GetCommandIdAt(3)); | 371 EXPECT_EQ(app_list::AppContextMenu::SHOW_APP_INFO, menu->GetCommandIdAt(3)); |
| 372 EXPECT_TRUE(menu->IsEnabledAt(3)); | 372 EXPECT_TRUE(menu->IsEnabledAt(3)); |
| 373 EXPECT_FALSE(menu->IsItemCheckedAt(3)); | 373 EXPECT_FALSE(menu->IsItemCheckedAt(3)); |
| 374 | 374 |
| 375 // Test activate request. | 375 // Test activate request. |
| 376 EXPECT_EQ(0u, arc_test.app_instance()->launch_requests().size()); | 376 EXPECT_EQ(0u, arc_test.app_instance()->launch_requests().size()); |
| 377 | 377 |
| 378 menu->ActivatedAt(0); | 378 menu->ActivatedAt(0); |
| 379 | 379 |
| 380 const ScopedVector<arc::FakeAppInstance::Request>& launch_requests = | 380 const std::vector<std::unique_ptr<arc::FakeAppInstance::Request>>& |
| 381 arc_test.app_instance()->launch_requests(); | 381 launch_requests = arc_test.app_instance()->launch_requests(); |
| 382 ASSERT_EQ(1u, launch_requests.size()); | 382 ASSERT_EQ(1u, launch_requests.size()); |
| 383 EXPECT_TRUE(launch_requests[0]->IsForApp(app_info)); | 383 EXPECT_TRUE(launch_requests[0]->IsForApp(app_info)); |
| 384 | 384 |
| 385 controller()->SetAppOpen(app_id, true); | 385 controller()->SetAppOpen(app_id, true); |
| 386 // It is not expected that menu model is unchanged on GetContextMenuModel. Arc | 386 // It is not expected that menu model is unchanged on GetContextMenuModel. Arc |
| 387 // app menu requires model to be recalculated. | 387 // app menu requires model to be recalculated. |
| 388 menu = item.GetContextMenuModel(); | 388 menu = item.GetContextMenuModel(); |
| 389 ASSERT_EQ(2, menu->GetItemCount()); | 389 ASSERT_EQ(2, menu->GetItemCount()); |
| 390 EXPECT_EQ(app_list::AppContextMenu::TOGGLE_PIN, menu->GetCommandIdAt(0)); | 390 EXPECT_EQ(app_list::AppContextMenu::TOGGLE_PIN, menu->GetCommandIdAt(0)); |
| 391 EXPECT_TRUE(menu->IsEnabledAt(0)); | 391 EXPECT_TRUE(menu->IsEnabledAt(0)); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 466 EXPECT_EQ(-1, menu->GetCommandIdAt(3)); // separator | 466 EXPECT_EQ(-1, menu->GetCommandIdAt(3)); // separator |
| 467 EXPECT_EQ(app_list::AppContextMenu::UNINSTALL, menu->GetCommandIdAt(4)); | 467 EXPECT_EQ(app_list::AppContextMenu::UNINSTALL, menu->GetCommandIdAt(4)); |
| 468 EXPECT_TRUE(menu->IsEnabledAt(4)); | 468 EXPECT_TRUE(menu->IsEnabledAt(4)); |
| 469 EXPECT_FALSE(menu->IsItemCheckedAt(4)); | 469 EXPECT_FALSE(menu->IsItemCheckedAt(4)); |
| 470 EXPECT_EQ(app_list::AppContextMenu::SHOW_APP_INFO, menu->GetCommandIdAt(5)); | 470 EXPECT_EQ(app_list::AppContextMenu::SHOW_APP_INFO, menu->GetCommandIdAt(5)); |
| 471 EXPECT_TRUE(menu->IsEnabledAt(5)); | 471 EXPECT_TRUE(menu->IsEnabledAt(5)); |
| 472 EXPECT_FALSE(menu->IsItemCheckedAt(5)); | 472 EXPECT_FALSE(menu->IsItemCheckedAt(5)); |
| 473 } | 473 } |
| 474 } | 474 } |
| 475 #endif | 475 #endif |
| OLD | NEW |