Commit 1c88f3d7 authored by Jeffrey Cohen's avatar Jeffrey Cohen Committed by Commit Bot

[SendTabToSelf] Null navigation_time valid in link flow

When the shared url is derived from a link, and the page hasnt been
opened yet, there is no Navigation Entry. and therefore no
navigation_time

Bug: 947617
Change-Id: I6e8964c48cd0db7778fa73b898793200a29a3f45
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1546143
Commit-Queue: Jeffrey Cohen <jeffreycohen@chromium.org>
Reviewed-by: default avatarSebastien Seguin-Gagnon <sebsg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#646957}
parent 9f1100cb
...@@ -247,11 +247,6 @@ const SendTabToSelfEntry* SendTabToSelfBridge::AddEntry( ...@@ -247,11 +247,6 @@ const SendTabToSelfEntry* SendTabToSelfBridge::AddEntry(
return nullptr; return nullptr;
} }
if (navigation_time.is_null()) {
UMA_HISTOGRAM_ENUMERATION(kAddEntryStatus, FAILURE);
return nullptr;
}
if (!url.is_valid()) { if (!url.is_valid()) {
UMA_HISTOGRAM_ENUMERATION(kAddEntryStatus, FAILURE); UMA_HISTOGRAM_ENUMERATION(kAddEntryStatus, FAILURE);
return nullptr; return nullptr;
......
...@@ -446,8 +446,9 @@ TEST_F(SendTabToSelfBridgeTest, AddInvalidEntries) { ...@@ -446,8 +446,9 @@ TEST_F(SendTabToSelfBridgeTest, AddInvalidEntries) {
EXPECT_EQ(nullptr, bridge()->AddEntry(GURL("http//google.com"), "d", EXPECT_EQ(nullptr, bridge()->AddEntry(GURL("http//google.com"), "d",
AdvanceAndGetTime(), "target_device")); AdvanceAndGetTime(), "target_device"));
// Add Entry should fail on an invalid navigation_time. // Add Entry should succeed on an invalid navigation_time, since that is the
EXPECT_EQ(nullptr, bridge()->AddEntry(GURL("http://www.example.com/"), "d", // case for sending links.
EXPECT_NE(nullptr, bridge()->AddEntry(GURL("http://www.example.com/"), "d",
base::Time(), "target_device")); base::Time(), "target_device"));
} }
......
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