Commit 639b64c3 authored by Abhijeet Kandalkar's avatar Abhijeet Kandalkar Committed by Commit Bot

Remove RenderViewHostTest.SetBackgroundOpaque test

RenderViewHostTest.SetBackgroundOpaque test just checks whether mojo
channel can be bound to a fake widget host and not testing any core
functionality of RenderViewHost. This CL removes that test code from
render_view_host_unittest.cc

Bug: 1047469
Change-Id: I8a7aea5de90fd1711a50e496abd20623571d00e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2216130Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772570}
parent 6b6cfe3f
...@@ -93,15 +93,9 @@ class FakeFrameWidget : public blink::mojom::FrameWidget { ...@@ -93,15 +93,9 @@ class FakeFrameWidget : public blink::mojom::FrameWidget {
FakeFrameWidget(const FakeFrameWidget&) = delete; FakeFrameWidget(const FakeFrameWidget&) = delete;
void operator=(const FakeFrameWidget&) = delete; void operator=(const FakeFrameWidget&) = delete;
bool GetBackgroundOpaque() const {
DCHECK_NE(value_, -1);
return value_;
}
void Reset() { value_ = -1; }
private: private:
void DragSourceSystemDragEnded() override {} void DragSourceSystemDragEnded() override {}
void SetBackgroundOpaque(bool value) override { value_ = value; } void SetBackgroundOpaque(bool value) override {}
void SetInheritedEffectiveTouchActionForSubFrame( void SetInheritedEffectiveTouchActionForSubFrame(
const cc::TouchAction touch_action) override {} const cc::TouchAction touch_action) override {}
void UpdateRenderThrottlingStatusForSubFrame( void UpdateRenderThrottlingStatusForSubFrame(
...@@ -110,37 +104,8 @@ class FakeFrameWidget : public blink::mojom::FrameWidget { ...@@ -110,37 +104,8 @@ class FakeFrameWidget : public blink::mojom::FrameWidget {
void SetIsInertForSubFrame(bool inert) override {} void SetIsInertForSubFrame(bool inert) override {}
mojo::AssociatedReceiver<blink::mojom::FrameWidget> receiver_; mojo::AssociatedReceiver<blink::mojom::FrameWidget> receiver_;
int value_ = -1;
}; };
TEST_F(RenderViewHostTest, SetBackgroundOpaque) {
mojo::AssociatedRemote<blink::mojom::FrameWidgetHost> blink_frame_widget_host;
auto blink_frame_widget_host_receiver =
blink_frame_widget_host
.BindNewEndpointAndPassDedicatedReceiverForTesting();
mojo::AssociatedRemote<blink::mojom::FrameWidget> blink_frame_widget;
auto blink_frame_widget_receiver =
blink_frame_widget.BindNewEndpointAndPassDedicatedReceiverForTesting();
test_rvh()->GetWidget()->BindFrameWidgetInterfaces(
std::move(blink_frame_widget_host_receiver), blink_frame_widget.Unbind());
FakeFrameWidget fake_frame_widget(std::move(blink_frame_widget_receiver));
for (bool value : {true, false}) {
SCOPED_TRACE(value);
// This method is part of RenderWidgetHostOwnerDelegate, provided to the
// main frame RenderWidgetHost, which uses it to inform the RenderView
// in the renderer process of the background opaque state.
test_rvh()->GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(
value);
base::RunLoop().RunUntilIdle();
EXPECT_EQ(fake_frame_widget.GetBackgroundOpaque(), value);
fake_frame_widget.Reset();
}
}
// Ensure we do not grant bindings to a process shared with unprivileged views. // Ensure we do not grant bindings to a process shared with unprivileged views.
TEST_F(RenderViewHostTest, DontGrantBindingsToSharedProcess) { TEST_F(RenderViewHostTest, DontGrantBindingsToSharedProcess) {
// Create another view in the same process. // Create another view in the same process.
......
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