Commit ca81d0ac authored by Kai Uwe Broulik's avatar Kai Uwe Broulik Committed by Commit Bot

Add file:// scheme for body image

R=mukai@chromium.org, thomasanderson@chromium.org

Change-Id: Ibacf61f28fde4e6e1e0b52a65c3412118eb96e49
Reviewed-on: https://chromium-review.googlesource.com/955323
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544075}
parent bccaa54a
...@@ -429,6 +429,7 @@ Justin Okamoto <justmoto@amazon.com> ...@@ -429,6 +429,7 @@ Justin Okamoto <justmoto@amazon.com>
Jüri Valdmann <juri.valdmann@qt.io> Jüri Valdmann <juri.valdmann@qt.io>
Kai Jiang <jiangkai@gmail.com> Kai Jiang <jiangkai@gmail.com>
Kai Köhne <kai.koehne@qt.io> Kai Köhne <kai.koehne@qt.io>
Kai Uwe Broulik <kde@privat.broulik.de>
Kal Conley <kcconley@gmail.com> Kal Conley <kcconley@gmail.com>
Kalyan Kondapally <kalyan.kondapally@intel.com> Kalyan Kondapally <kalyan.kondapally@intel.com>
Kamil Jiwa <kamil.jiwa@gmail.com> Kamil Jiwa <kamil.jiwa@gmail.com>
......
...@@ -583,7 +583,7 @@ class NotificationPlatformBridgeLinuxImpl ...@@ -583,7 +583,7 @@ class NotificationPlatformBridgeLinuxImpl
ResizeImageToFdoMaxSize(notification->image()).As1xPNGBytes()); ResizeImageToFdoMaxSize(notification->image()).As1xPNGBytes());
if (image_file) { if (image_file) {
body << "<img src=\"" body << "<img src=\""
<< net::EscapePath(image_file->file_path().value()) << "file://" + net::EscapePath(image_file->file_path().value())
<< "\" alt=\"\"/>\n"; << "\" alt=\"\"/>\n";
data->resource_files.push_back(std::move(image_file)); data->resource_files.push_back(std::move(image_file));
} }
......
...@@ -477,7 +477,8 @@ TEST_F(NotificationPlatformBridgeLinuxTest, NotificationImages) { ...@@ -477,7 +477,8 @@ TEST_F(NotificationPlatformBridgeLinuxTest, NotificationImages) {
[=](const NotificationRequest& request) { [=](const NotificationRequest& request) {
std::string file_name; std::string file_name;
EXPECT_TRUE(RE2::FullMatch( EXPECT_TRUE(RE2::FullMatch(
request.body, "\\<img src=\\\"(.+)\\\" alt=\\\".*\\\"/\\>", request.body,
"\\<img src=\\\"file://(.+)\\\" alt=\\\".*\\\"/\\>",
&file_name)); &file_name));
std::string file_contents; std::string file_contents;
EXPECT_TRUE(base::ReadFileToString(base::FilePath(file_name), EXPECT_TRUE(base::ReadFileToString(base::FilePath(file_name),
......
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