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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 class RenderWidgetHostViewAuraTest : public testing::Test { | 151 class RenderWidgetHostViewAuraTest : public testing::Test { |
152 public: | 152 public: |
153 RenderWidgetHostViewAuraTest() | 153 RenderWidgetHostViewAuraTest() |
154 : browser_thread_for_ui_(BrowserThread::UI, &message_loop_) {} | 154 : browser_thread_for_ui_(BrowserThread::UI, &message_loop_) {} |
155 | 155 |
156 virtual void SetUp() { | 156 virtual void SetUp() { |
157 ImageTransportFactory::InitializeForUnitTests( | 157 ImageTransportFactory::InitializeForUnitTests( |
158 scoped_ptr<ui::ContextFactory>(new ui::TestContextFactory)); | 158 scoped_ptr<ui::ContextFactory>(new ui::TestContextFactory)); |
159 aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); | 159 aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); |
160 aura_test_helper_->SetUp(); | 160 bool allow_test_contexts = true; |
| 161 aura_test_helper_->SetUp(allow_test_contexts); |
161 | 162 |
162 browser_context_.reset(new TestBrowserContext); | 163 browser_context_.reset(new TestBrowserContext); |
163 process_host_ = new MockRenderProcessHost(browser_context_.get()); | 164 process_host_ = new MockRenderProcessHost(browser_context_.get()); |
164 | 165 |
165 sink_ = &process_host_->sink(); | 166 sink_ = &process_host_->sink(); |
166 | 167 |
167 parent_host_ = new RenderWidgetHostImpl( | 168 parent_host_ = new RenderWidgetHostImpl( |
168 &delegate_, process_host_, MSG_ROUTING_NONE, false); | 169 &delegate_, process_host_, MSG_ROUTING_NONE, false); |
169 parent_view_ = static_cast<RenderWidgetHostViewAura*>( | 170 parent_view_ = static_cast<RenderWidgetHostViewAura*>( |
170 RenderWidgetHostView::CreateViewForWidget(parent_host_)); | 171 RenderWidgetHostView::CreateViewForWidget(parent_host_)); |
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1211 view_->OnSwapCompositorFrame( | 1212 view_->OnSwapCompositorFrame( |
1212 1, MakeDelegatedFrame(2.f, frame_size, gfx::Rect(frame_size))); | 1213 1, MakeDelegatedFrame(2.f, frame_size, gfx::Rect(frame_size))); |
1213 | 1214 |
1214 // When we get a new frame with the same frame size in physical pixels, but a | 1215 // When we get a new frame with the same frame size in physical pixels, but a |
1215 // different scale, we should generate a new frame provider, as the final | 1216 // different scale, we should generate a new frame provider, as the final |
1216 // result will need to be scaled differently to the screen. | 1217 // result will need to be scaled differently to the screen. |
1217 EXPECT_NE(frame_provider.get(), view_->frame_provider_.get()); | 1218 EXPECT_NE(frame_provider.get(), view_->frame_provider_.get()); |
1218 } | 1219 } |
1219 | 1220 |
1220 } // namespace content | 1221 } // namespace content |
OLD | NEW |