12345678910111213141516171819202122232425262728 |
- // Copyright 2021 The Chromium Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style license that can be
- // found in the LICENSE file.
- #import "ios/web/web_state/web_state_policy_decider_test_util.h"
- #if !defined(__has_feature) || !__has_feature(objc_arc)
- #error "This file requires ARC support."
- #endif
- namespace web {
- bool RequestInfoMatch(WebStatePolicyDecider::RequestInfo expected,
- WebStatePolicyDecider::RequestInfo got) {
- return ui::PageTransitionTypeIncludingQualifiersIs(
- got.transition_type, expected.transition_type) &&
- (got.target_frame_is_main == expected.target_frame_is_main) &&
- (got.target_frame_is_cross_origin ==
- expected.target_frame_is_cross_origin) &&
- (got.has_user_gesture == expected.has_user_gesture);
- }
- bool ResponseInfoMatch(WebStatePolicyDecider::ResponseInfo expected,
- WebStatePolicyDecider::ResponseInfo got) {
- return (got.for_main_frame == expected.for_main_frame);
- }
- } // namespace web
|