Index: chrome/browser/ui/app_list/arc/arc_app_unittest.cc |
diff --git a/chrome/browser/ui/app_list/arc/arc_app_unittest.cc b/chrome/browser/ui/app_list/arc/arc_app_unittest.cc |
index 3a25a5bf328a4a2a8bf17e7c9caaa58fee55cdb8..b22ea7f2cdb97fd1cd3db86b1f3379e15f68e69c 100644 |
--- a/chrome/browser/ui/app_list/arc/arc_app_unittest.cc |
+++ b/chrome/browser/ui/app_list/arc/arc_app_unittest.cc |
@@ -139,7 +139,7 @@ class ArcAppModelBuilderTest : public AppListTestBase { |
} |
// Validate that prefs and model have right content. |
- void ValidateHaveApps(const std::vector<arc::AppInfo> apps) { |
+ void ValidateHaveApps(const std::vector<arc::mojom::AppInfo> apps) { |
ArcAppListPrefs* prefs = ArcAppListPrefs::Get(profile_.get()); |
const std::vector<std::string> ids = prefs->GetAppIds(); |
ASSERT_EQ(apps.size(), ids.size()); |
@@ -162,7 +162,8 @@ class ArcAppModelBuilderTest : public AppListTestBase { |
// Validate that requested apps have required ready state and other apps have |
// opposite state. |
- void ValidateAppReadyState(const std::vector<arc::AppInfo> apps, bool ready) { |
+ void ValidateAppReadyState(const std::vector<arc::mojom::AppInfo> apps, |
+ bool ready) { |
ArcAppListPrefs* prefs = ArcAppListPrefs::Get(profile_.get()); |
ASSERT_NE(nullptr, prefs); |
@@ -220,7 +221,7 @@ class ArcAppModelBuilderTest : public AppListTestBase { |
Profile* profile() { return profile_.get(); } |
- const std::vector<arc::AppInfo>& fake_apps() const { |
+ const std::vector<arc::mojom::AppInfo>& fake_apps() const { |
return arc_test_.fake_apps(); |
} |
@@ -251,7 +252,7 @@ TEST_F(ArcAppModelBuilderTest, RefreshAllOnReady) { |
} |
TEST_F(ArcAppModelBuilderTest, RefreshAllFillsContent) { |
- ValidateHaveApps(std::vector<arc::AppInfo>()); |
+ ValidateHaveApps(std::vector<arc::mojom::AppInfo>()); |
bridge_service()->SetReady(); |
app_instance()->RefreshAppList(); |
app_instance()->SendRefreshAppList(fake_apps()); |
@@ -259,18 +260,20 @@ TEST_F(ArcAppModelBuilderTest, RefreshAllFillsContent) { |
} |
TEST_F(ArcAppModelBuilderTest, MultipleRefreshAll) { |
- ValidateHaveApps(std::vector<arc::AppInfo>()); |
+ ValidateHaveApps(std::vector<arc::mojom::AppInfo>()); |
bridge_service()->SetReady(); |
app_instance()->RefreshAppList(); |
// Send info about all fake apps except last. |
- std::vector<arc::AppInfo> apps1(fake_apps().begin(), fake_apps().end() - 1); |
+ std::vector<arc::mojom::AppInfo> apps1(fake_apps().begin(), |
+ fake_apps().end() - 1); |
app_instance()->SendRefreshAppList(apps1); |
// At this point all apps (except last) should exist and be ready. |
ValidateHaveApps(apps1); |
ValidateAppReadyState(apps1, true); |
// Send info about all fake apps except first. |
- std::vector<arc::AppInfo> apps2(fake_apps().begin() + 1, fake_apps().end()); |
+ std::vector<arc::mojom::AppInfo> apps2(fake_apps().begin() + 1, |
+ fake_apps().end()); |
app_instance()->SendRefreshAppList(apps2); |
// At this point all apps should exist but first one should be non-ready. |
ValidateHaveApps(apps2); |
@@ -283,7 +286,7 @@ TEST_F(ArcAppModelBuilderTest, MultipleRefreshAll) { |
ValidateAppReadyState(fake_apps(), true); |
// Send info no app available. |
- std::vector<arc::AppInfo> no_apps; |
+ std::vector<arc::mojom::AppInfo> no_apps; |
app_instance()->SendRefreshAppList(no_apps); |
// At this point no app should exist. |
ValidateHaveApps(no_apps); |
@@ -348,8 +351,8 @@ TEST_F(ArcAppModelBuilderTest, LaunchApps) { |
app_instance()->SendRefreshAppList(fake_apps()); |
// Simulate item activate. |
- const arc::AppInfo& app_first = fake_apps()[0]; |
- const arc::AppInfo& app_last = fake_apps()[0]; |
+ const arc::mojom::AppInfo& app_first = fake_apps()[0]; |
+ const arc::mojom::AppInfo& app_last = fake_apps()[0]; |
ArcAppItem* item_first = FindArcItem(ArcAppTest::GetAppId(app_first)); |
ArcAppItem* item_last = FindArcItem(ArcAppTest::GetAppId(app_last)); |
ASSERT_NE(nullptr, item_first); |
@@ -445,9 +448,9 @@ TEST_F(ArcAppModelBuilderTest, InstallIcon) { |
bridge_service()->SetReady(); |
app_instance()->RefreshAppList(); |
- app_instance()->SendRefreshAppList( |
- std::vector<arc::AppInfo>(fake_apps().begin(), fake_apps().begin() + 1)); |
- const arc::AppInfo& app = fake_apps()[0]; |
+ app_instance()->SendRefreshAppList(std::vector<arc::mojom::AppInfo>( |
+ fake_apps().begin(), fake_apps().begin() + 1)); |
+ const arc::mojom::AppInfo& app = fake_apps()[0]; |
ArcAppListPrefs* prefs = ArcAppListPrefs::Get(profile_.get()); |
ASSERT_NE(nullptr, prefs); |
@@ -472,9 +475,9 @@ TEST_F(ArcAppModelBuilderTest, InstallIcon) { |
// Now send generated icon for the app. |
std::string png_data; |
- EXPECT_EQ(true, |
- app_instance()->GenerateAndSendIcon( |
- app, static_cast<arc::ScaleFactor>(scale_factor), &png_data)); |
+ EXPECT_EQ(true, app_instance()->GenerateAndSendIcon( |
+ app, static_cast<arc::mojom::ScaleFactor>(scale_factor), |
+ &png_data)); |
// Process pending tasks. |
content::BrowserThread::GetBlockingPool()->FlushForTesting(); |
@@ -496,9 +499,9 @@ TEST_F(ArcAppModelBuilderTest, RemoveAppCleanUpFolder) { |
bridge_service()->SetReady(); |
app_instance()->RefreshAppList(); |
- app_instance()->SendRefreshAppList( |
- std::vector<arc::AppInfo>(fake_apps().begin(), fake_apps().begin() + 1)); |
- const arc::AppInfo& app = fake_apps()[0]; |
+ app_instance()->SendRefreshAppList(std::vector<arc::mojom::AppInfo>( |
+ fake_apps().begin(), fake_apps().begin() + 1)); |
+ const arc::mojom::AppInfo& app = fake_apps()[0]; |
ArcAppListPrefs* prefs = ArcAppListPrefs::Get(profile_.get()); |
ASSERT_NE(nullptr, prefs); |
@@ -514,15 +517,15 @@ TEST_F(ArcAppModelBuilderTest, RemoveAppCleanUpFolder) { |
prefs->RequestIcon(app_id, scale_factor); |
// Now send generated icon for the app. |
std::string png_data; |
- EXPECT_EQ(true, |
- app_instance()->GenerateAndSendIcon( |
- app, static_cast<arc::ScaleFactor>(scale_factor), &png_data)); |
+ EXPECT_EQ(true, app_instance()->GenerateAndSendIcon( |
+ app, static_cast<arc::mojom::ScaleFactor>(scale_factor), |
+ &png_data)); |
content::BrowserThread::GetBlockingPool()->FlushForTesting(); |
base::RunLoop().RunUntilIdle(); |
EXPECT_EQ(true, base::PathExists(app_path)); |
// Send empty app list. This will delete app and its folder. |
- app_instance()->SendRefreshAppList(std::vector<arc::AppInfo>()); |
+ app_instance()->SendRefreshAppList(std::vector<arc::mojom::AppInfo>()); |
content::BrowserThread::GetBlockingPool()->FlushForTesting(); |
base::RunLoop().RunUntilIdle(); |
EXPECT_EQ(true, !base::PathExists(app_path)); |
@@ -534,10 +537,10 @@ TEST_F(ArcAppModelBuilderTest, LastLaunchTime) { |
bridge_service()->SetReady(); |
app_instance()->RefreshAppList(); |
- app_instance()->SendRefreshAppList( |
- std::vector<arc::AppInfo>(fake_apps().begin(), fake_apps().begin() + 2)); |
- const arc::AppInfo& app1 = fake_apps()[0]; |
- const arc::AppInfo& app2 = fake_apps()[1]; |
+ app_instance()->SendRefreshAppList(std::vector<arc::mojom::AppInfo>( |
+ fake_apps().begin(), fake_apps().begin() + 2)); |
+ const arc::mojom::AppInfo& app1 = fake_apps()[0]; |
+ const arc::mojom::AppInfo& app2 = fake_apps()[1]; |
const std::string id1 = ArcAppTest::GetAppId(app1); |
const std::string id2 = ArcAppTest::GetAppId(app2); |
@@ -576,13 +579,13 @@ TEST_F(ArcAppModelBuilderTest, IconLoader) { |
// Validating decoded content does not fit well for unit tests. |
ArcAppIcon::DisableSafeDecodingForTesting(); |
- const arc::AppInfo& app = fake_apps()[0]; |
+ const arc::mojom::AppInfo& app = fake_apps()[0]; |
const std::string app_id = ArcAppTest::GetAppId(app); |
bridge_service()->SetReady(); |
app_instance()->RefreshAppList(); |
- app_instance()->SendRefreshAppList( |
- std::vector<arc::AppInfo>(fake_apps().begin(), fake_apps().begin() + 1)); |
+ app_instance()->SendRefreshAppList(std::vector<arc::mojom::AppInfo>( |
+ fake_apps().begin(), fake_apps().begin() + 1)); |
FakeAppIconLoaderDelegate delegate; |
ArcAppIconLoader icon_loader(profile(), app_list::kListIconSize, &delegate); |
@@ -599,8 +602,7 @@ TEST_F(ArcAppModelBuilderTest, IconLoader) { |
for (auto& scale_factor : scale_factors) { |
std::string png_data; |
EXPECT_TRUE(app_instance()->GenerateAndSendIcon( |
- app, static_cast<arc::ScaleFactor>(scale_factor), |
- &png_data)); |
+ app, static_cast<arc::mojom::ScaleFactor>(scale_factor), &png_data)); |
} |
// Process pending tasks, this installs icons. |