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