| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 const arc::mojom::ShortcutInfo& app_first = fake_shortcuts()[0]; | 654 const arc::mojom::ShortcutInfo& app_first = fake_shortcuts()[0]; |
| 655 const arc::mojom::ShortcutInfo& app_last = fake_shortcuts()[0]; | 655 const arc::mojom::ShortcutInfo& app_last = fake_shortcuts()[0]; |
| 656 ArcAppItem* item_first = FindArcItem(ArcAppTest::GetAppId(app_first)); | 656 ArcAppItem* item_first = FindArcItem(ArcAppTest::GetAppId(app_first)); |
| 657 ArcAppItem* item_last = FindArcItem(ArcAppTest::GetAppId(app_last)); | 657 ArcAppItem* item_last = FindArcItem(ArcAppTest::GetAppId(app_last)); |
| 658 ASSERT_NE(nullptr, item_first); | 658 ASSERT_NE(nullptr, item_first); |
| 659 ASSERT_NE(nullptr, item_last); | 659 ASSERT_NE(nullptr, item_last); |
| 660 item_first->Activate(0); | 660 item_first->Activate(0); |
| 661 item_last->Activate(0); | 661 item_last->Activate(0); |
| 662 item_first->Activate(0); | 662 item_first->Activate(0); |
| 663 | 663 |
| 664 const std::vector<std::unique_ptr<mojo::String>>& launch_intents = | 664 const std::vector<std::string>& launch_intents = |
| 665 app_instance()->launch_intents(); | 665 app_instance()->launch_intents(); |
| 666 ASSERT_EQ(3u, launch_intents.size()); | 666 ASSERT_EQ(3u, launch_intents.size()); |
| 667 EXPECT_EQ(app_first.intent_uri, *launch_intents[0]); | 667 EXPECT_EQ(app_first.intent_uri, launch_intents[0]); |
| 668 EXPECT_EQ(app_last.intent_uri, *launch_intents[1]); | 668 EXPECT_EQ(app_last.intent_uri, launch_intents[1]); |
| 669 EXPECT_EQ(app_first.intent_uri, *launch_intents[2]); | 669 EXPECT_EQ(app_first.intent_uri, launch_intents[2]); |
| 670 | 670 |
| 671 // Test an attempt to launch of a not-ready shortcut. | 671 // Test an attempt to launch of a not-ready shortcut. |
| 672 arc_test()->StopArcInstance(); | 672 arc_test()->StopArcInstance(); |
| 673 item_first = FindArcItem(ArcAppTest::GetAppId(app_first)); | 673 item_first = FindArcItem(ArcAppTest::GetAppId(app_first)); |
| 674 ASSERT_NE(nullptr, item_first); | 674 ASSERT_NE(nullptr, item_first); |
| 675 size_t launch_request_count_before = app_instance()->launch_intents().size(); | 675 size_t launch_request_count_before = app_instance()->launch_intents().size(); |
| 676 item_first->Activate(0); | 676 item_first->Activate(0); |
| 677 // Number of launch requests must not change. | 677 // Number of launch requests must not change. |
| 678 EXPECT_EQ(launch_request_count_before, | 678 EXPECT_EQ(launch_request_count_before, |
| 679 app_instance()->launch_intents().size()); | 679 app_instance()->launch_intents().size()); |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1148 const ArcAppListPrefs* const prefs = ArcAppListPrefs::Get(profile_.get()); | 1148 const ArcAppListPrefs* const prefs = ArcAppListPrefs::Get(profile_.get()); |
| 1149 ASSERT_TRUE(prefs); | 1149 ASSERT_TRUE(prefs); |
| 1150 | 1150 |
| 1151 // There is no default app for managed users except Play Store | 1151 // There is no default app for managed users except Play Store |
| 1152 for (const auto& app : fake_default_apps()) { | 1152 for (const auto& app : fake_default_apps()) { |
| 1153 const std::string app_id = ArcAppTest::GetAppId(app); | 1153 const std::string app_id = ArcAppTest::GetAppId(app); |
| 1154 EXPECT_FALSE(prefs->IsRegistered(app_id)); | 1154 EXPECT_FALSE(prefs->IsRegistered(app_id)); |
| 1155 EXPECT_FALSE(prefs->GetApp(app_id)); | 1155 EXPECT_FALSE(prefs->GetApp(app_id)); |
| 1156 } | 1156 } |
| 1157 } | 1157 } |
| OLD | NEW |