| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Change-Id: Iab0144ca7d3d3983d0e61d74f42a53b366f9e830could you add tracking bug?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
Could you add test?
as first time external contributor I don't exactly feel like learning new test framework and I don't see any test that'd cover already supported kMimeTypeMozillaUrl MIME type where I could just add kMimeTypeUriList and be done with it.
could you add tracking bug?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Łukasz PatronCould you add test?
as first time external contributor I don't exactly feel like learning new test framework and I don't see any test that'd cover already supported kMimeTypeMozillaUrl MIME type where I could just add kMimeTypeUriList and be done with it.
as first time external contributor
this does not sound like any excuse to avoid testing.
At least, because you should have intention (user journey) this change fixes, could you add the test scenario in the way (i.e. some of the browser test covers your use cases), even if you do not want to build the basic unit_test testing from the scratch here?
If there's no existing test, it's unfortunate, but we as chromium developer should keep a good citizenship anyways.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Approach looks good to me, but test cases should be differentiated from picked data.
TEST(WaylandExchangeDataProviderTest, ExtractPickledData) {
WaylandExchangeDataProvider provider;
std::string extracted;
EXPECT_FALSE(provider.ExtractData(kMimeTypePlainText, &extracted));
EXPECT_FALSE(provider.ExtractData(kMimeTypeUriList, &extracted));
EXPECT_FALSE(
provider.ExtractData(kMimeTypeDataTransferCustomData, &extracted));
extracted.clear();
provider.SetString(u"dnd-string");
EXPECT_TRUE(provider.ExtractData(kMimeTypePlainText, &extracted));
EXPECT_EQ("dnd-string", extracted);
extracted.clear();
provider.AddData(ToClipboardData("file:///dev/null"), kMimeTypeUriList);
EXPECT_TRUE(provider.ExtractData(kMimeTypeUriList, &extracted));
EXPECT_EQ("file:///dev/null", extracted);
extracted.clear();
base::Pickle pickle;
pickle.WriteString("pickled-str");
provider.SetPickledData(ClipboardFormatType::DataTransferCustomType(),
pickle);
EXPECT_TRUE(
provider.ExtractData(kMimeTypeDataTransferCustomData, &extracted));
// Ensure Pickle "reconstruction" works as expected.
std::string read_pickled_str;
base::Pickle read_pickle =
base::Pickle::WithData(base::as_byte_span(extracted));
base::PickleIterator iter(read_pickle);
ASSERT_TRUE(read_pickle.data());
EXPECT_FALSE(iter.ReachedEnd());
EXPECT_TRUE(iter.ReadString(&read_pickled_str));
EXPECT_EQ("pickled-str", read_pickled_str);
}This test is testing for `WebCustomDataType`. Can you move the `kMimeTypeUriList` into a new test `FileNameAsUriList`?
```suggestion
TEST(WaylandExchangeDataProviderTest, ExtractPickledData) {
WaylandExchangeDataProvider provider;
std::string extracted;
EXPECT_FALSE(provider.ExtractData(kMimeTypePlainText, &extracted));
EXPECT_FALSE(provider.ExtractData(kMimeTypeUriList, &extracted));
EXPECT_FALSE(
provider.ExtractData(kMimeTypeDataTransferCustomData, &extracted));
extracted.clear();
provider.SetString(u"dnd-string");
EXPECT_TRUE(provider.ExtractData(kMimeTypePlainText, &extracted));
EXPECT_EQ("dnd-string", extracted);
extracted.clear();
base::Pickle pickle;
pickle.WriteString("pickled-str");
provider.SetPickledData(ClipboardFormatType::DataTransferCustomType(),
pickle);
EXPECT_TRUE(
provider.ExtractData(kMimeTypeDataTransferCustomData, &extracted));
// Ensure Pickle "reconstruction" works as expected.
std::string read_pickled_str;
base::Pickle read_pickle =
base::Pickle::WithData(base::as_byte_span(extracted));
base::PickleIterator iter(read_pickle);
ASSERT_TRUE(read_pickle.data());
EXPECT_FALSE(iter.ReachedEnd());
EXPECT_TRUE(iter.ReadString(&read_pickled_str));
EXPECT_EQ("pickled-str", read_pickled_str);
}
TEST(WaylandExchangeDataProviderTest, FileNameAsUriList) {
WaylandExchangeDataProvider provider;
std::string extracted;EXPECT_FALSE(provider.ExtractData(kMimeTypeUriList, &extracted));
EXPECT_FALSE(
provider.ExtractData(kMimeTypeDataTransferCustomData, &extracted));
extracted.clear();
provider.AddData(ToClipboardData("file:///dev/null"), kMimeTypeUriList);
EXPECT_TRUE(provider.ExtractData(kMimeTypeUriList, &extracted));
EXPECT_EQ("file:///dev/null", extracted);
extracted.clear();
}
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
Fix applied.
| Auto-Submit | +1 |
EXPECT_FALSE(provider.ExtractData(kMimeTypeUriList, &extracted));should i leave that?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
EXPECT_FALSE(provider.ExtractData(kMimeTypeUriList, &extracted));should i leave that?
You may delete this, I missed this part in my code suggest, sorry.
| Auto-Submit | +1 |
EXPECT_FALSE(provider.ExtractData(kMimeTypeUriList, &extracted));Kramer Geshould i leave that?
You may delete this, I missed this part in my code suggest, sorry.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Commit-Queue | +2 |
Hidehiko Abeas first time external contributor I don't exactly feel like learning new test framework and I don't see any test that'd cover already supported kMimeTypeMozillaUrl MIME type where I could just add kMimeTypeUriList and be done with it.
as first time external contributor
this does not sound like any excuse to avoid testing.
At least, because you should have intention (user journey) this change fixes, could you add the test scenario in the way (i.e. some of the browser test covers your use cases), even if you do not want to build the basic unit_test testing from the scratch here?
If there's no existing test, it's unfortunate, but we as chromium developer should keep a good citizenship anyways.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
b/c I'm an uploader now it's missing a second pair of eyes, I think.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
b/c I'm an uploader now it's missing a second pair of eyes, I think.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
Łukasz Patronb/c I'm an uploader now it's missing a second pair of eyes, I think.
pushed --amend with no edit, maybe that's enough?
seems like `Review-Enforcement` is still not satisfied, someone else must also CR+1
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Commit-Queue | +2 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
can someone cq?
[ozone/wayland] Add ExtractData() support for text/uri-list
When dragging a file from chrome://downloads to KDE Konsole, the
following message shows up in the debug output: "Cannot deliver data of
type text/uri-list and no text representation is available.".
After making it so text/uri-list is handled the same way as
text/x-moz-url, the log message is gone and path to file is pasted into
terminal as one would expect.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |