1 // Copyright 2020 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "content/public/test/fake_remote_frame.h"
6 
7 #include "third_party/blink/public/mojom/timing/resource_timing.mojom.h"
8 
9 namespace content {
10 
11 FakeRemoteFrame::FakeRemoteFrame() = default;
12 
13 FakeRemoteFrame::~FakeRemoteFrame() = default;
14 
Init(blink::AssociatedInterfaceProvider * provider)15 void FakeRemoteFrame::Init(blink::AssociatedInterfaceProvider* provider) {
16   provider->OverrideBinderForTesting(
17       blink::mojom::RemoteFrame::Name_,
18       base::BindRepeating(&FakeRemoteFrame::BindFrameHostReceiver,
19                           base::Unretained(this)));
20 }
21 
WillEnterFullscreen(blink::mojom::FullscreenOptionsPtr)22 void FakeRemoteFrame::WillEnterFullscreen(blink::mojom::FullscreenOptionsPtr) {}
23 
AddReplicatedContentSecurityPolicies(std::vector<network::mojom::ContentSecurityPolicyHeaderPtr> headers)24 void FakeRemoteFrame::AddReplicatedContentSecurityPolicies(
25     std::vector<network::mojom::ContentSecurityPolicyHeaderPtr> headers) {}
26 
ResetReplicatedContentSecurityPolicy()27 void FakeRemoteFrame::ResetReplicatedContentSecurityPolicy() {}
28 
EnforceInsecureNavigationsSet(const std::vector<uint32_t> & set)29 void FakeRemoteFrame::EnforceInsecureNavigationsSet(
30     const std::vector<uint32_t>& set) {}
31 
SetFrameOwnerProperties(blink::mojom::FrameOwnerPropertiesPtr properties)32 void FakeRemoteFrame::SetFrameOwnerProperties(
33     blink::mojom::FrameOwnerPropertiesPtr properties) {}
34 
EnforceInsecureRequestPolicy(blink::mojom::InsecureRequestPolicy policy)35 void FakeRemoteFrame::EnforceInsecureRequestPolicy(
36     blink::mojom::InsecureRequestPolicy policy) {}
37 
SetReplicatedOrigin(const url::Origin & origin,bool is_potentially_trustworthy_unique_origin)38 void FakeRemoteFrame::SetReplicatedOrigin(
39     const url::Origin& origin,
40     bool is_potentially_trustworthy_unique_origin) {}
41 
SetReplicatedAdFrameType(blink::mojom::AdFrameType ad_frame_type)42 void FakeRemoteFrame::SetReplicatedAdFrameType(
43     blink::mojom::AdFrameType ad_frame_type) {}
44 
SetReplicatedName(const std::string & name,const std::string & unique_name)45 void FakeRemoteFrame::SetReplicatedName(const std::string& name,
46                                         const std::string& unique_name) {}
47 
DispatchLoadEventForFrameOwner()48 void FakeRemoteFrame::DispatchLoadEventForFrameOwner() {}
49 
Collapse(bool collapsed)50 void FakeRemoteFrame::Collapse(bool collapsed) {}
51 
Focus()52 void FakeRemoteFrame::Focus() {}
53 
SetHadStickyUserActivationBeforeNavigation(bool value)54 void FakeRemoteFrame::SetHadStickyUserActivationBeforeNavigation(bool value) {}
55 
SetNeedsOcclusionTracking(bool needs_tracking)56 void FakeRemoteFrame::SetNeedsOcclusionTracking(bool needs_tracking) {}
57 
BubbleLogicalScroll(blink::mojom::ScrollDirection direction,ui::ScrollGranularity granularity)58 void FakeRemoteFrame::BubbleLogicalScroll(
59     blink::mojom::ScrollDirection direction,
60     ui::ScrollGranularity granularity) {}
61 
UpdateUserActivationState(blink::mojom::UserActivationUpdateType update_type,blink::mojom::UserActivationNotificationType notification_type)62 void FakeRemoteFrame::UpdateUserActivationState(
63     blink::mojom::UserActivationUpdateType update_type,
64     blink::mojom::UserActivationNotificationType notification_type) {}
65 
SetEmbeddingToken(const base::UnguessableToken & embedding_token)66 void FakeRemoteFrame::SetEmbeddingToken(
67     const base::UnguessableToken& embedding_token) {}
68 
SetPageFocus(bool is_focused)69 void FakeRemoteFrame::SetPageFocus(bool is_focused) {}
70 
RenderFallbackContent()71 void FakeRemoteFrame::RenderFallbackContent() {}
72 
AddResourceTimingFromChild(blink::mojom::ResourceTimingInfoPtr timing)73 void FakeRemoteFrame::AddResourceTimingFromChild(
74     blink::mojom::ResourceTimingInfoPtr timing) {}
75 
ScrollRectToVisible(const gfx::Rect & rect,blink::mojom::ScrollIntoViewParamsPtr params)76 void FakeRemoteFrame::ScrollRectToVisible(
77     const gfx::Rect& rect,
78     blink::mojom::ScrollIntoViewParamsPtr params) {}
79 
DidStartLoading()80 void FakeRemoteFrame::DidStartLoading() {}
81 
DidStopLoading()82 void FakeRemoteFrame::DidStopLoading() {}
83 
IntrinsicSizingInfoOfChildChanged(blink::mojom::IntrinsicSizingInfoPtr sizing_info)84 void FakeRemoteFrame::IntrinsicSizingInfoOfChildChanged(
85     blink::mojom::IntrinsicSizingInfoPtr sizing_info) {}
86 
UpdateOpener(const base::Optional<base::UnguessableToken> & opener_frame_token)87 void FakeRemoteFrame::UpdateOpener(
88     const base::Optional<base::UnguessableToken>& opener_frame_token) {}
89 
BindFrameHostReceiver(mojo::ScopedInterfaceEndpointHandle handle)90 void FakeRemoteFrame::FakeRemoteFrame::BindFrameHostReceiver(
91     mojo::ScopedInterfaceEndpointHandle handle) {
92   receiver_.Bind(mojo::PendingAssociatedReceiver<blink::mojom::RemoteFrame>(
93       std::move(handle)));
94 }
95 
96 }  // namespace content
97