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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 gfx::Size last_frame_size_; | 202 gfx::Size last_frame_size_; |
203 scoped_ptr<cc::CopyOutputRequest> last_copy_request_; | 203 scoped_ptr<cc::CopyOutputRequest> last_copy_request_; |
204 }; | 204 }; |
205 | 205 |
206 class RenderWidgetHostViewAuraTest : public testing::Test { | 206 class RenderWidgetHostViewAuraTest : public testing::Test { |
207 public: | 207 public: |
208 RenderWidgetHostViewAuraTest() | 208 RenderWidgetHostViewAuraTest() |
209 : browser_thread_for_ui_(BrowserThread::UI, &message_loop_) {} | 209 : browser_thread_for_ui_(BrowserThread::UI, &message_loop_) {} |
210 | 210 |
211 void SetUpEnvironment() { | 211 void SetUpEnvironment() { |
| 212 ui::ContextFactory* context_factory = new ui::InProcessContextFactory; |
212 ImageTransportFactory::InitializeForUnitTests( | 213 ImageTransportFactory::InitializeForUnitTests( |
213 scoped_ptr<ui::ContextFactory>(new ui::InProcessContextFactory)); | 214 scoped_ptr<ui::ContextFactory>(context_factory)); |
214 aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); | 215 aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); |
215 aura_test_helper_->SetUp(); | 216 aura_test_helper_->SetUp(context_factory); |
216 new wm::DefaultActivationClient(aura_test_helper_->root_window()); | 217 new wm::DefaultActivationClient(aura_test_helper_->root_window()); |
217 | 218 |
218 browser_context_.reset(new TestBrowserContext); | 219 browser_context_.reset(new TestBrowserContext); |
219 process_host_ = new MockRenderProcessHost(browser_context_.get()); | 220 process_host_ = new MockRenderProcessHost(browser_context_.get()); |
220 | 221 |
221 sink_ = &process_host_->sink(); | 222 sink_ = &process_host_->sink(); |
222 | 223 |
223 parent_host_ = new RenderWidgetHostImpl( | 224 parent_host_ = new RenderWidgetHostImpl( |
224 &delegate_, process_host_, MSG_ROUTING_NONE, false); | 225 &delegate_, process_host_, MSG_ROUTING_NONE, false); |
225 parent_view_ = new RenderWidgetHostViewAura(parent_host_); | 226 parent_view_ = new RenderWidgetHostViewAura(parent_host_); |
(...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1512 const IPC::Message *message = sink_->GetFirstMessageMatching( | 1513 const IPC::Message *message = sink_->GetFirstMessageMatching( |
1513 ViewMsg_Resize::ID); | 1514 ViewMsg_Resize::ID); |
1514 ASSERT_TRUE(message != NULL); | 1515 ASSERT_TRUE(message != NULL); |
1515 | 1516 |
1516 ViewMsg_Resize::Param params; | 1517 ViewMsg_Resize::Param params; |
1517 ViewMsg_Resize::Read(message, ¶ms); | 1518 ViewMsg_Resize::Read(message, ¶ms); |
1518 EXPECT_EQ(60, params.a.visible_viewport_size.height()); | 1519 EXPECT_EQ(60, params.a.visible_viewport_size.height()); |
1519 } | 1520 } |
1520 | 1521 |
1521 } // namespace content | 1522 } // namespace content |
OLD | NEW |