| OLD | NEW |
| 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 4115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4126 ui::EventTimeForNow(), 0, 0); | 4126 ui::EventTimeForNow(), 0, 0); |
| 4127 view_->OnMouseEvent(&mouse_event); | 4127 view_->OnMouseEvent(&mouse_event); |
| 4128 EXPECT_EQ("0 1 0", delegate.GetMouseMotionCountsAndReset()); | 4128 EXPECT_EQ("0 1 0", delegate.GetMouseMotionCountsAndReset()); |
| 4129 | 4129 |
| 4130 view_->UnlockMouse(); | 4130 view_->UnlockMouse(); |
| 4131 | 4131 |
| 4132 // view_ will be destroyed when parent is destroyed. | 4132 // view_ will be destroyed when parent is destroyed. |
| 4133 view_ = nullptr; | 4133 view_ = nullptr; |
| 4134 } | 4134 } |
| 4135 | 4135 |
| 4136 // Tests the RenderWidgetHostImpl sends the correct surface ID namespace to | |
| 4137 // the renderer process. | |
| 4138 TEST_F(RenderWidgetHostViewAuraTest, FrameSinkIdInitialized) { | |
| 4139 gfx::Size size(5, 5); | |
| 4140 | |
| 4141 const IPC::Message* msg = | |
| 4142 sink_->GetUniqueMessageMatching(ViewMsg_SetFrameSinkId::ID); | |
| 4143 EXPECT_TRUE(msg); | |
| 4144 ViewMsg_SetFrameSinkId::Param params; | |
| 4145 ViewMsg_SetFrameSinkId::Read(msg, ¶ms); | |
| 4146 view_->InitAsChild(nullptr); | |
| 4147 view_->Show(); | |
| 4148 view_->SetSize(size); | |
| 4149 view_->OnSwapCompositorFrame(0, | |
| 4150 MakeDelegatedFrame(1.f, size, gfx::Rect(size))); | |
| 4151 EXPECT_EQ(view_->GetFrameSinkId(), std::get<0>(params)); | |
| 4152 } | |
| 4153 | |
| 4154 // This class provides functionality to test a RenderWidgetHostViewAura | 4136 // This class provides functionality to test a RenderWidgetHostViewAura |
| 4155 // instance which has been hooked up to a test RenderViewHost instance and | 4137 // instance which has been hooked up to a test RenderViewHost instance and |
| 4156 // a WebContents instance. | 4138 // a WebContents instance. |
| 4157 class RenderWidgetHostViewAuraWithViewHarnessTest | 4139 class RenderWidgetHostViewAuraWithViewHarnessTest |
| 4158 : public RenderViewHostImplTestHarness { | 4140 : public RenderViewHostImplTestHarness { |
| 4159 public: | 4141 public: |
| 4160 RenderWidgetHostViewAuraWithViewHarnessTest() | 4142 RenderWidgetHostViewAuraWithViewHarnessTest() |
| 4161 : view_(nullptr) {} | 4143 : view_(nullptr) {} |
| 4162 ~RenderWidgetHostViewAuraWithViewHarnessTest() override {} | 4144 ~RenderWidgetHostViewAuraWithViewHarnessTest() override {} |
| 4163 | 4145 |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4694 | 4676 |
| 4695 // Retrieve the selected text from clipboard and verify it is as expected. | 4677 // Retrieve the selected text from clipboard and verify it is as expected. |
| 4696 base::string16 result_text; | 4678 base::string16 result_text; |
| 4697 clipboard->ReadText(ui::CLIPBOARD_TYPE_SELECTION, &result_text); | 4679 clipboard->ReadText(ui::CLIPBOARD_TYPE_SELECTION, &result_text); |
| 4698 EXPECT_EQ(expected_text, result_text); | 4680 EXPECT_EQ(expected_text, result_text); |
| 4699 } | 4681 } |
| 4700 } | 4682 } |
| 4701 #endif | 4683 #endif |
| 4702 | 4684 |
| 4703 } // namespace content | 4685 } // namespace content |
| OLD | NEW |