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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 gfx::Size last_frame_size_; | 204 gfx::Size last_frame_size_; |
205 scoped_ptr<cc::CopyOutputRequest> last_copy_request_; | 205 scoped_ptr<cc::CopyOutputRequest> last_copy_request_; |
206 }; | 206 }; |
207 | 207 |
208 class RenderWidgetHostViewAuraTest : public testing::Test { | 208 class RenderWidgetHostViewAuraTest : public testing::Test { |
209 public: | 209 public: |
210 RenderWidgetHostViewAuraTest() | 210 RenderWidgetHostViewAuraTest() |
211 : browser_thread_for_ui_(BrowserThread::UI, &message_loop_) {} | 211 : browser_thread_for_ui_(BrowserThread::UI, &message_loop_) {} |
212 | 212 |
213 void SetUpEnvironment() { | 213 void SetUpEnvironment() { |
| 214 ui::ContextFactory* context_factory = new ui::InProcessContextFactory; |
214 ImageTransportFactory::InitializeForUnitTests( | 215 ImageTransportFactory::InitializeForUnitTests( |
215 scoped_ptr<ui::ContextFactory>(new ui::InProcessContextFactory)); | 216 scoped_ptr<ui::ContextFactory>(context_factory)); |
216 aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); | 217 aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); |
217 aura_test_helper_->SetUp(); | 218 aura_test_helper_->SetUp(context_factory); |
218 new wm::DefaultActivationClient(aura_test_helper_->root_window()); | 219 new wm::DefaultActivationClient(aura_test_helper_->root_window()); |
219 | 220 |
220 browser_context_.reset(new TestBrowserContext); | 221 browser_context_.reset(new TestBrowserContext); |
221 process_host_ = new MockRenderProcessHost(browser_context_.get()); | 222 process_host_ = new MockRenderProcessHost(browser_context_.get()); |
222 | 223 |
223 sink_ = &process_host_->sink(); | 224 sink_ = &process_host_->sink(); |
224 | 225 |
225 parent_host_ = new RenderWidgetHostImpl( | 226 parent_host_ = new RenderWidgetHostImpl( |
226 &delegate_, process_host_, MSG_ROUTING_NONE, false); | 227 &delegate_, process_host_, MSG_ROUTING_NONE, false); |
227 parent_view_ = new RenderWidgetHostViewAura(parent_host_); | 228 parent_view_ = new RenderWidgetHostViewAura(parent_host_); |
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1414 const IPC::Message *message = sink_->GetFirstMessageMatching( | 1415 const IPC::Message *message = sink_->GetFirstMessageMatching( |
1415 ViewMsg_Resize::ID); | 1416 ViewMsg_Resize::ID); |
1416 ASSERT_TRUE(message != NULL); | 1417 ASSERT_TRUE(message != NULL); |
1417 | 1418 |
1418 ViewMsg_Resize::Param params; | 1419 ViewMsg_Resize::Param params; |
1419 ViewMsg_Resize::Read(message, ¶ms); | 1420 ViewMsg_Resize::Read(message, ¶ms); |
1420 EXPECT_EQ(60, params.a.visible_viewport_size.height()); | 1421 EXPECT_EQ(60, params.a.visible_viewport_size.height()); |
1421 } | 1422 } |
1422 | 1423 |
1423 } // namespace content | 1424 } // namespace content |
OLD | NEW |