Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc

Issue 2382873002: Replace usage of SurfaceId's client_id with FrameSinkId (Closed)
Patch Set: Rebased Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <tuple> 10 #include <tuple>
(...skipping 4098 matching lines...) Expand 10 before | Expand all | Expand 10 after
4109 EXPECT_EQ("0 1 0", delegate.GetMouseMotionCountsAndReset()); 4109 EXPECT_EQ("0 1 0", delegate.GetMouseMotionCountsAndReset());
4110 4110
4111 view_->UnlockMouse(); 4111 view_->UnlockMouse();
4112 4112
4113 // view_ will be destroyed when parent is destroyed. 4113 // view_ will be destroyed when parent is destroyed.
4114 view_ = nullptr; 4114 view_ = nullptr;
4115 } 4115 }
4116 4116
4117 // Tests the RenderWidgetHostImpl sends the correct surface ID namespace to 4117 // Tests the RenderWidgetHostImpl sends the correct surface ID namespace to
4118 // the renderer process. 4118 // the renderer process.
4119 TEST_F(RenderWidgetHostViewAuraTest, SurfaceClientIdInitialized) { 4119 TEST_F(RenderWidgetHostViewAuraTest, FrameSinkIdInitialized) {
4120 gfx::Size size(5, 5); 4120 gfx::Size size(5, 5);
4121 4121
4122 const IPC::Message* msg = 4122 const IPC::Message* msg =
4123 sink_->GetUniqueMessageMatching(ViewMsg_SetSurfaceClientId::ID); 4123 sink_->GetUniqueMessageMatching(ViewMsg_SetFrameSinkId::ID);
4124 EXPECT_TRUE(msg); 4124 EXPECT_TRUE(msg);
4125 ViewMsg_SetSurfaceClientId::Param params; 4125 ViewMsg_SetFrameSinkId::Param params;
4126 ViewMsg_SetSurfaceClientId::Read(msg, &params); 4126 ViewMsg_SetFrameSinkId::Read(msg, &params);
4127 view_->InitAsChild(nullptr); 4127 view_->InitAsChild(nullptr);
4128 view_->Show(); 4128 view_->Show();
4129 view_->SetSize(size); 4129 view_->SetSize(size);
4130 view_->OnSwapCompositorFrame(0, 4130 view_->OnSwapCompositorFrame(0,
4131 MakeDelegatedFrame(1.f, size, gfx::Rect(size))); 4131 MakeDelegatedFrame(1.f, size, gfx::Rect(size)));
4132 EXPECT_EQ(view_->GetSurfaceClientId(), std::get<0>(params)); 4132 EXPECT_EQ(view_->GetFrameSinkId(), std::get<0>(params));
4133 } 4133 }
4134 4134
4135 // This class provides functionality to test a RenderWidgetHostViewAura 4135 // This class provides functionality to test a RenderWidgetHostViewAura
4136 // instance which has been hooked up to a test RenderViewHost instance and 4136 // instance which has been hooked up to a test RenderViewHost instance and
4137 // a WebContents instance. 4137 // a WebContents instance.
4138 class RenderWidgetHostViewAuraWithViewHarnessTest 4138 class RenderWidgetHostViewAuraWithViewHarnessTest
4139 : public RenderViewHostImplTestHarness { 4139 : public RenderViewHostImplTestHarness {
4140 public: 4140 public:
4141 RenderWidgetHostViewAuraWithViewHarnessTest() 4141 RenderWidgetHostViewAuraWithViewHarnessTest()
4142 : view_(nullptr) {} 4142 : view_(nullptr) {}
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
4675 4675
4676 // Retrieve the selected text from clipboard and verify it is as expected. 4676 // Retrieve the selected text from clipboard and verify it is as expected.
4677 base::string16 result_text; 4677 base::string16 result_text;
4678 clipboard->ReadText(ui::CLIPBOARD_TYPE_SELECTION, &result_text); 4678 clipboard->ReadText(ui::CLIPBOARD_TYPE_SELECTION, &result_text);
4679 EXPECT_EQ(expected_text, result_text); 4679 EXPECT_EQ(expected_text, result_text);
4680 } 4680 }
4681 } 4681 }
4682 #endif 4682 #endif
4683 4683
4684 } // namespace content 4684 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698