Commit 546b1958 authored by Joel Hockey's avatar Joel Hockey Committed by Commit Bot

Add filesapp open with pvm suffix to app name

Bug: b/158509828
Change-Id: Ic900dd5381396f7fc6e93c7e77ddf506f2eacfa7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2251863
Auto-Submit: Joel Hockey <joelhockey@chromium.org>
Commit-Queue: Daniel Ng <danielng@google.com>
Reviewed-by: default avatarDaniel Ng <danielng@google.com>
Cr-Commit-Position: refs/heads/master@{#780178}
parent b0a7d102
...@@ -49,6 +49,7 @@ constexpr size_t kIconSizeInDip = 16; ...@@ -49,6 +49,7 @@ constexpr size_t kIconSizeInDip = 16;
// upon whether it "thinks" it is binary or text content. // upon whether it "thinks" it is binary or text content.
constexpr char kUnknownBinaryMimeType[] = "application/octet-stream"; constexpr char kUnknownBinaryMimeType[] = "application/octet-stream";
constexpr char kUnknownTextMimeType[] = "text/plain"; constexpr char kUnknownTextMimeType[] = "text/plain";
constexpr char kPluginVmAppNameSuffix[] = " (Windows)";
GURL GeneratePNGDataUrl(const SkBitmap& sk_bitmap) { GURL GeneratePNGDataUrl(const SkBitmap& sk_bitmap) {
std::vector<unsigned char> output; std::vector<unsigned char> output;
...@@ -234,7 +235,12 @@ void FindGuestOsApps( ...@@ -234,7 +235,12 @@ void FindGuestOsApps(
continue; continue;
app_ids->push_back(app_id); app_ids->push_back(app_id);
app_names->push_back(registration.Name()); if (registration.VmType() == guest_os::GuestOsRegistryService::VmType::
ApplicationList_VmType_PLUGIN_VM) {
app_names->push_back(registration.Name() + kPluginVmAppNameSuffix);
} else {
app_names->push_back(registration.Name());
}
vm_types->push_back(registration.VmType()); vm_types->push_back(registration.VmType());
} }
} }
......
...@@ -159,7 +159,7 @@ TEST_F(GuestOsFileTasksTest, PluginVm_AppRegistered) { ...@@ -159,7 +159,7 @@ TEST_F(GuestOsFileTasksTest, PluginVm_AppRegistered) {
FindGuestOsApps(&profile_, entries_, urls_, &app_ids_, &app_names_, FindGuestOsApps(&profile_, entries_, urls_, &app_ids_, &app_names_,
&app_vm_types_); &app_vm_types_);
EXPECT_THAT(app_ids_, testing::ElementsAre("app1")); EXPECT_THAT(app_ids_, testing::ElementsAre("app1"));
EXPECT_THAT(app_names_, testing::ElementsAre("name1")); EXPECT_THAT(app_names_, testing::ElementsAre("name1 (Windows)"));
EXPECT_THAT(app_vm_types_, testing::ElementsAre(PLUGIN_VM)); EXPECT_THAT(app_vm_types_, testing::ElementsAre(PLUGIN_VM));
} }
...@@ -205,7 +205,8 @@ TEST_F(GuestOsFileTasksTest, PluginVm_MultipleAppsRegistered) { ...@@ -205,7 +205,8 @@ TEST_F(GuestOsFileTasksTest, PluginVm_MultipleAppsRegistered) {
FindGuestOsApps(&profile_, entries_, urls_, &app_ids_, &app_names_, FindGuestOsApps(&profile_, entries_, urls_, &app_ids_, &app_names_,
&app_vm_types_); &app_vm_types_);
EXPECT_THAT(app_ids_, testing::ElementsAre("app1", "app2")); EXPECT_THAT(app_ids_, testing::ElementsAre("app1", "app2"));
EXPECT_THAT(app_names_, testing::ElementsAre("name1", "name2")); EXPECT_THAT(app_names_,
testing::ElementsAre("name1 (Windows)", "name2 (Windows)"));
EXPECT_THAT(app_vm_types_, testing::ElementsAre(PLUGIN_VM, PLUGIN_VM)); EXPECT_THAT(app_vm_types_, testing::ElementsAre(PLUGIN_VM, PLUGIN_VM));
} }
...@@ -216,7 +217,7 @@ TEST_F(GuestOsFileTasksTest, MultipleAppsFromMultipleVmsRegistered) { ...@@ -216,7 +217,7 @@ TEST_F(GuestOsFileTasksTest, MultipleAppsFromMultipleVmsRegistered) {
FindGuestOsApps(&profile_, entries_, urls_, &app_ids_, &app_names_, FindGuestOsApps(&profile_, entries_, urls_, &app_ids_, &app_names_,
&app_vm_types_); &app_vm_types_);
EXPECT_THAT(app_ids_, testing::ElementsAre("app1", "app2")); EXPECT_THAT(app_ids_, testing::ElementsAre("app1", "app2"));
EXPECT_THAT(app_names_, testing::ElementsAre("name1", "name2")); EXPECT_THAT(app_names_, testing::ElementsAre("name1", "name2 (Windows)"));
EXPECT_THAT(app_vm_types_, testing::ElementsAre(VM_TERMINA, PLUGIN_VM)); EXPECT_THAT(app_vm_types_, testing::ElementsAre(VM_TERMINA, PLUGIN_VM));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment