Commit 612b6b5f authored by Christopher Thompson's avatar Christopher Thompson Committed by Commit Bot

Simplify complicated PageTransition types in history tests

This simplifies history backend tests where some page transitions types
were created with FromInt(GetQualifier(TYPED)), which is equivalent to
simply using PAGE_TRANSITION_LINK directly (as the qualifier bits are
all zero). However, semantically these tests make more sense using
TYPED transitions in these cases (although the outcome of the tests
work either way).

This is followup work from comments on crrev.com/c/1048826.

Change-Id: Ief02ad7fde7a92f05ebaf9b30ad58886cc5d1672
Reviewed-on: https://chromium-review.googlesource.com/1091273Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Christopher Thompson <cthomp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565652}
parent c048f1dd
......@@ -1232,11 +1232,8 @@ TEST_F(HistoryBackendTest, StripUsernamePasswordTest) {
backend_->DeleteAllHistory();
// Visit the url with username, password.
backend_->AddPageVisit(
url, base::Time::Now(), 0,
ui::PageTransitionFromInt(
ui::PageTransitionGetQualifier(ui::PAGE_TRANSITION_TYPED)),
false, history::SOURCE_BROWSED, true);
backend_->AddPageVisit(url, base::Time::Now(), 0, ui::PAGE_TRANSITION_TYPED,
false, history::SOURCE_BROWSED, true);
// Fetch the row information about stripped url from history db.
VisitVector visits;
......@@ -1383,19 +1380,13 @@ TEST_F(HistoryBackendTest, AddPageVisitNotLastVisit) {
base::Time older_time = recent_time - visit_age;
// Visit the url with recent time.
backend_->AddPageVisit(
url, recent_time, 0,
ui::PageTransitionFromInt(
ui::PageTransitionGetQualifier(ui::PAGE_TRANSITION_TYPED)),
false, history::SOURCE_BROWSED, false);
backend_->AddPageVisit(url, recent_time, 0, ui::PAGE_TRANSITION_TYPED, false,
history::SOURCE_BROWSED, true);
// Add to the url a visit with older time (could be syncing from another
// client, etc.).
backend_->AddPageVisit(
url, older_time, 0,
ui::PageTransitionFromInt(
ui::PageTransitionGetQualifier(ui::PAGE_TRANSITION_TYPED)),
false, history::SOURCE_SYNCED, false);
backend_->AddPageVisit(url, older_time, 0, ui::PAGE_TRANSITION_TYPED, false,
history::SOURCE_SYNCED, true);
// Fetch the row information about url from history db.
VisitVector visits;
......
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