[cr147] VisitRow::source is now an optional.

In unit tests we need to add it manually.

Chromium change:
https://source.chromium.org/chromium/chromium/src/+/c7f16774c7d6195557836b150197c9c86727b62e

commit c7f16774c7d6195557836b150197c9c86727b62e
Author: Mariam Ali <alimariam@google.com>
Date:   Tue Mar 3 07:07:19 2026 -0800

    [History] Make VisitRow::source optional.

    This change wraps `VisitRow::source` in `std::optional` because we don't
    join the visits table with the visit_source table in every query and
    thus we don't always fetch the VisitSource even when it is available.

    Bug: 464528977
This commit is contained in:
Max Karolinskiy
2026-03-26 19:55:41 -04:00
parent d2708d8a6f
commit ca75fa1885
@@ -49,6 +49,7 @@ TEST_F(BraveVisitDatabaseTest, BraveGetKnownToSyncCount) {
for (VisitID i = 1; i <= 3; i++) {
VisitRow original(i, Time::Now(), 23, ui::PageTransitionFromInt(0), 19,
false, 0);
original.source = SOURCE_BROWSED;
AddVisit(&original);
ASSERT_EQ(i, original.visit_id); // Verifies that we added 1, 2, and 3
}