forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This CL changes InputMsg_SetFocus so that it is implemented in the RemoteFrame interface since it is only got through RenderFrameProxy. It also introduces FakeRemoteFrame to use RemoteFrame on render_frame_host_manager_unittest.cc. Bug: 1039256 Change-Id: If7d1d2971fabf3c64777281b1bf5eedfa9fcf5c7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1989714 Commit-Queue: Julie Kim <jkim@igalia.com> Reviewed-by: Dave Tapuska <dtapuska@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Reviewed-by: Ken Rockot <rockot@google.com> Cr-Commit-Position: refs/heads/master@{#732808}
- Loading branch information
1 parent
c68a814
commit 2002cb3
Showing
19 changed files
with
202 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Copyright 2020 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. | ||
|
||
#include "content/public/test/fake_remote_frame.h" | ||
|
||
namespace content { | ||
|
||
FakeRemoteFrame::FakeRemoteFrame() = default; | ||
|
||
FakeRemoteFrame::~FakeRemoteFrame() = default; | ||
|
||
void FakeRemoteFrame::Init(blink::AssociatedInterfaceProvider* provider) { | ||
provider->OverrideBinderForTesting( | ||
blink::mojom::RemoteFrame::Name_, | ||
base::BindRepeating(&FakeRemoteFrame::BindFrameHostReceiver, | ||
base::Unretained(this))); | ||
} | ||
|
||
void FakeRemoteFrame::WillEnterFullscreen() {} | ||
|
||
void FakeRemoteFrame::AddReplicatedContentSecurityPolicies( | ||
std::vector<network::mojom::ContentSecurityPolicyHeaderPtr> headers) {} | ||
|
||
void FakeRemoteFrame::ResetReplicatedContentSecurityPolicy() {} | ||
|
||
void FakeRemoteFrame::EnforceInsecureNavigationsSet( | ||
const std::vector<uint32_t>& set) {} | ||
|
||
void FakeRemoteFrame::SetReplicatedOrigin( | ||
const url::Origin& origin, | ||
bool is_potentially_trustworthy_unique_origin) {} | ||
|
||
void FakeRemoteFrame::DispatchLoadEventForFrameOwner() {} | ||
|
||
void FakeRemoteFrame::Collapse(bool collapsed) {} | ||
|
||
void FakeRemoteFrame::Focus() {} | ||
|
||
void FakeRemoteFrame::SetHadStickyUserActivationBeforeNavigation(bool value) {} | ||
|
||
void FakeRemoteFrame::SetNeedsOcclusionTracking(bool needs_tracking) {} | ||
|
||
void FakeRemoteFrame::BubbleLogicalScroll( | ||
blink::mojom::ScrollDirection direction, | ||
ui::input_types::ScrollGranularity granularity) {} | ||
|
||
void FakeRemoteFrame::UpdateUserActivationState( | ||
blink::mojom::UserActivationUpdateType) {} | ||
|
||
void FakeRemoteFrame::SetEmbeddingToken( | ||
const base::UnguessableToken& embedding_token) {} | ||
|
||
void FakeRemoteFrame::SetPageFocus(bool is_focused) {} | ||
|
||
void FakeRemoteFrame::FakeRemoteFrame::BindFrameHostReceiver( | ||
mojo::ScopedInterfaceEndpointHandle handle) { | ||
receiver_.Bind(mojo::PendingAssociatedReceiver<blink::mojom::RemoteFrame>( | ||
std::move(handle))); | ||
} | ||
|
||
} // namespace content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// Copyright 2020 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. | ||
|
||
#ifndef CONTENT_PUBLIC_TEST_FAKE_REMOTE_FRAME_H_ | ||
#define CONTENT_PUBLIC_TEST_FAKE_REMOTE_FRAME_H_ | ||
|
||
#include "mojo/public/cpp/bindings/associated_receiver.h" | ||
#include "services/network/public/mojom/content_security_policy.mojom.h" | ||
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" | ||
#include "third_party/blink/public/mojom/frame/frame.mojom.h" | ||
#include "third_party/blink/public/mojom/frame/user_activation_update_types.mojom.h" | ||
#include "ui/events/types/scroll_types.h" | ||
|
||
namespace base { | ||
class UnguessableToken; | ||
} | ||
|
||
namespace url { | ||
class Origin; | ||
} // namespace url | ||
|
||
namespace content { | ||
|
||
// This class implements a RemoteFrame that can be attached to the | ||
// AssociatedInterfaceProvider so that it will be called when the browser | ||
// normally sends a request to the renderer process. But for a unittest | ||
// setup it can be intercepted by this class. | ||
class FakeRemoteFrame : public blink::mojom::RemoteFrame { | ||
public: | ||
FakeRemoteFrame(); | ||
~FakeRemoteFrame() override; | ||
|
||
void Init(blink::AssociatedInterfaceProvider* provider); | ||
|
||
// blink::mojom::RemoteFrame overrides: | ||
void WillEnterFullscreen() override; | ||
void AddReplicatedContentSecurityPolicies( | ||
std::vector<network::mojom::ContentSecurityPolicyHeaderPtr> headers) | ||
override; | ||
void ResetReplicatedContentSecurityPolicy() override; | ||
void EnforceInsecureNavigationsSet(const std::vector<uint32_t>& set) override; | ||
void SetReplicatedOrigin( | ||
const url::Origin& origin, | ||
bool is_potentially_trustworthy_unique_origin) override; | ||
void DispatchLoadEventForFrameOwner() override; | ||
void Collapse(bool collapsed) final; | ||
void Focus() override; | ||
void SetHadStickyUserActivationBeforeNavigation(bool value) override; | ||
void SetNeedsOcclusionTracking(bool needs_tracking) override; | ||
void BubbleLogicalScroll( | ||
blink::mojom::ScrollDirection direction, | ||
ui::input_types::ScrollGranularity granularity) override; | ||
void UpdateUserActivationState( | ||
blink::mojom::UserActivationUpdateType) override; | ||
void SetEmbeddingToken( | ||
const base::UnguessableToken& embedding_token) override; | ||
void SetPageFocus(bool is_focused) override; | ||
|
||
private: | ||
void BindFrameHostReceiver(mojo::ScopedInterfaceEndpointHandle handle); | ||
|
||
mojo::AssociatedReceiver<blink::mojom::RemoteFrame> receiver_{this}; | ||
}; | ||
|
||
} // namespace content | ||
|
||
#endif // CONTENT_PUBLIC_TEST_FAKE_REMOTE_FRAME_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.