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> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 EXPECT_TRUE(menu->IsEnabledAt(2)); | 369 EXPECT_TRUE(menu->IsEnabledAt(2)); |
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 arc_test.app_instance()->WaitForIncomingMethodCall(); | |
380 | 379 |
381 const ScopedVector<arc::FakeAppInstance::Request>& launch_requests = | 380 const ScopedVector<arc::FakeAppInstance::Request>& launch_requests = |
382 arc_test.app_instance()->launch_requests(); | 381 arc_test.app_instance()->launch_requests(); |
383 ASSERT_EQ(1u, launch_requests.size()); | 382 ASSERT_EQ(1u, launch_requests.size()); |
384 EXPECT_TRUE(launch_requests[0]->IsForApp(app_info)); | 383 EXPECT_TRUE(launch_requests[0]->IsForApp(app_info)); |
385 | 384 |
386 controller()->SetAppOpen(app_id, true); | 385 controller()->SetAppOpen(app_id, true); |
387 // 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 |
388 // app menu requires model to be recalculated. | 387 // app menu requires model to be recalculated. |
389 menu = item.GetContextMenuModel(); | 388 menu = item.GetContextMenuModel(); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 EXPECT_EQ(-1, menu->GetCommandIdAt(3)); // separator | 466 EXPECT_EQ(-1, menu->GetCommandIdAt(3)); // separator |
468 EXPECT_EQ(app_list::AppContextMenu::UNINSTALL, menu->GetCommandIdAt(4)); | 467 EXPECT_EQ(app_list::AppContextMenu::UNINSTALL, menu->GetCommandIdAt(4)); |
469 EXPECT_TRUE(menu->IsEnabledAt(4)); | 468 EXPECT_TRUE(menu->IsEnabledAt(4)); |
470 EXPECT_FALSE(menu->IsItemCheckedAt(4)); | 469 EXPECT_FALSE(menu->IsItemCheckedAt(4)); |
471 EXPECT_EQ(app_list::AppContextMenu::SHOW_APP_INFO, menu->GetCommandIdAt(5)); | 470 EXPECT_EQ(app_list::AppContextMenu::SHOW_APP_INFO, menu->GetCommandIdAt(5)); |
472 EXPECT_TRUE(menu->IsEnabledAt(5)); | 471 EXPECT_TRUE(menu->IsEnabledAt(5)); |
473 EXPECT_FALSE(menu->IsItemCheckedAt(5)); | 472 EXPECT_FALSE(menu->IsItemCheckedAt(5)); |
474 } | 473 } |
475 } | 474 } |
476 #endif | 475 #endif |
OLD | NEW |