Skip to content

Commit

Permalink
Include initiator_origin in PopulateFrameState for unit tests.
Browse files Browse the repository at this point in the history
Also updates the BasicFrameSet test to do a better job catching cases
where ExplodedFrameState::assign may not have been updated.

Bug: 1405812
Change-Id: I685297ca198223c563cdfd2a5e0d30e10ac43fa6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4182972
Reviewed-by: James Maclean <wjmaclean@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Charlie Reis <creis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1095519}
  • Loading branch information
creis authored and Chromium LUCI CQ committed Jan 23, 2023
1 parent 5d1b96f commit ff4c528
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ class PageStateSerializationTest : public testing::Test {
frame_state->scroll_anchor_selector = u"#selector";
frame_state->scroll_anchor_offset = gfx::PointF(2.5, 3.5);
frame_state->scroll_anchor_simhash = 12345;
frame_state->initiator_origin =
url::Origin::Create(GURL("https://initiator.example.com"));
frame_state->navigation_api_key = u"abcd";
frame_state->navigation_api_id = u"wxyz";
frame_state->navigation_api_state = absl::nullopt;
Expand Down Expand Up @@ -376,6 +378,10 @@ TEST_F(PageStateSerializationTest, BasicFrameSet) {
ExplodedFrameState child_state;
PopulateFrameState(&child_state);
input.top.children.push_back(child_state);

// Ensure `child_state` made it into `input` successfully, to catch any
// cases where ExplodedFrameState::assign may have been missed.
ExpectEquality(child_state, input.top.children[i]);
}

std::string encoded;
Expand Down

0 comments on commit ff4c528

Please sign in to comment.