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/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "ui/aura/layout_manager.h" | 30 #include "ui/aura/layout_manager.h" |
31 #include "ui/aura/root_window.h" | 31 #include "ui/aura/root_window.h" |
32 #include "ui/aura/test/aura_test_helper.h" | 32 #include "ui/aura/test/aura_test_helper.h" |
33 #include "ui/aura/test/test_cursor_client.h" | 33 #include "ui/aura/test/test_cursor_client.h" |
34 #include "ui/aura/test/test_screen.h" | 34 #include "ui/aura/test/test_screen.h" |
35 #include "ui/aura/test/test_window_delegate.h" | 35 #include "ui/aura/test/test_window_delegate.h" |
36 #include "ui/aura/window.h" | 36 #include "ui/aura/window.h" |
37 #include "ui/aura/window_observer.h" | 37 #include "ui/aura/window_observer.h" |
38 #include "ui/base/ui_base_types.h" | 38 #include "ui/base/ui_base_types.h" |
39 #include "ui/compositor/compositor.h" | 39 #include "ui/compositor/compositor.h" |
| 40 #include "ui/compositor/test/test_context_factory.h" |
40 #include "ui/events/event.h" | 41 #include "ui/events/event.h" |
41 #include "ui/events/event_utils.h" | 42 #include "ui/events/event_utils.h" |
42 | 43 |
43 using testing::_; | 44 using testing::_; |
44 | 45 |
45 namespace content { | 46 namespace content { |
46 namespace { | 47 namespace { |
47 | 48 |
48 class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate { | 49 class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate { |
49 public: | 50 public: |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 bool has_resize_lock_; | 117 bool has_resize_lock_; |
117 gfx::Size last_frame_size_; | 118 gfx::Size last_frame_size_; |
118 }; | 119 }; |
119 | 120 |
120 class RenderWidgetHostViewAuraTest : public testing::Test { | 121 class RenderWidgetHostViewAuraTest : public testing::Test { |
121 public: | 122 public: |
122 RenderWidgetHostViewAuraTest() | 123 RenderWidgetHostViewAuraTest() |
123 : browser_thread_for_ui_(BrowserThread::UI, &message_loop_) {} | 124 : browser_thread_for_ui_(BrowserThread::UI, &message_loop_) {} |
124 | 125 |
125 virtual void SetUp() { | 126 virtual void SetUp() { |
126 ImageTransportFactory::InitializeForUnitTests(); | 127 ImageTransportFactory::InitializeForUnitTests( |
| 128 scoped_ptr<ui::ContextFactory>(new ui::TestContextFactory)); |
127 aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); | 129 aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); |
128 aura_test_helper_->SetUp(); | 130 aura_test_helper_->SetUp(); |
129 | 131 |
130 browser_context_.reset(new TestBrowserContext); | 132 browser_context_.reset(new TestBrowserContext); |
131 MockRenderProcessHost* process_host = | 133 MockRenderProcessHost* process_host = |
132 new MockRenderProcessHost(browser_context_.get()); | 134 new MockRenderProcessHost(browser_context_.get()); |
133 | 135 |
134 sink_ = &process_host->sink(); | 136 sink_ = &process_host->sink(); |
135 | 137 |
136 parent_host_ = new RenderWidgetHostImpl( | 138 parent_host_ = new RenderWidgetHostImpl( |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 EXPECT_CALL(observer, OnWindowPaintScheduled(view_->window_, view_rect)); | 904 EXPECT_CALL(observer, OnWindowPaintScheduled(view_->window_, view_rect)); |
903 view_->OnSwapCompositorFrame( | 905 view_->OnSwapCompositorFrame( |
904 3, MakeDelegatedFrame(1.f, frame_size, view_rect)); | 906 3, MakeDelegatedFrame(1.f, frame_size, view_rect)); |
905 testing::Mock::VerifyAndClearExpectations(&observer); | 907 testing::Mock::VerifyAndClearExpectations(&observer); |
906 view_->RunOnCompositingDidCommit(); | 908 view_->RunOnCompositingDidCommit(); |
907 | 909 |
908 view_->window_->RemoveObserver(&observer); | 910 view_->window_->RemoveObserver(&observer); |
909 } | 911 } |
910 | 912 |
911 } // namespace content | 913 } // namespace content |
OLD | NEW |