| 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/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "ui/aura/test/test_window_delegate.h" | 38 #include "ui/aura/test/test_window_delegate.h" |
| 39 #include "ui/aura/window.h" | 39 #include "ui/aura/window.h" |
| 40 #include "ui/aura/window_event_dispatcher.h" | 40 #include "ui/aura/window_event_dispatcher.h" |
| 41 #include "ui/aura/window_observer.h" | 41 #include "ui/aura/window_observer.h" |
| 42 #include "ui/base/ui_base_types.h" | 42 #include "ui/base/ui_base_types.h" |
| 43 #include "ui/compositor/compositor.h" | 43 #include "ui/compositor/compositor.h" |
| 44 #include "ui/compositor/test/draw_waiter_for_test.h" | 44 #include "ui/compositor/test/draw_waiter_for_test.h" |
| 45 #include "ui/compositor/test/in_process_context_factory.h" | 45 #include "ui/compositor/test/in_process_context_factory.h" |
| 46 #include "ui/events/event.h" | 46 #include "ui/events/event.h" |
| 47 #include "ui/events/event_utils.h" | 47 #include "ui/events/event_utils.h" |
| 48 #include "ui/wm/core/default_activation_client.h" |
| 48 | 49 |
| 49 using testing::_; | 50 using testing::_; |
| 50 | 51 |
| 51 namespace content { | 52 namespace content { |
| 52 namespace { | 53 namespace { |
| 53 | 54 |
| 54 // Simple screen position client to test coordinate system conversion. | 55 // Simple screen position client to test coordinate system conversion. |
| 55 class TestScreenPositionClient | 56 class TestScreenPositionClient |
| 56 : public aura::client::ScreenPositionClient { | 57 : public aura::client::ScreenPositionClient { |
| 57 public: | 58 public: |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 class RenderWidgetHostViewAuraTest : public testing::Test { | 199 class RenderWidgetHostViewAuraTest : public testing::Test { |
| 199 public: | 200 public: |
| 200 RenderWidgetHostViewAuraTest() | 201 RenderWidgetHostViewAuraTest() |
| 201 : browser_thread_for_ui_(BrowserThread::UI, &message_loop_) {} | 202 : browser_thread_for_ui_(BrowserThread::UI, &message_loop_) {} |
| 202 | 203 |
| 203 void SetUpEnvironment() { | 204 void SetUpEnvironment() { |
| 204 ImageTransportFactory::InitializeForUnitTests( | 205 ImageTransportFactory::InitializeForUnitTests( |
| 205 scoped_ptr<ui::ContextFactory>(new ui::InProcessContextFactory)); | 206 scoped_ptr<ui::ContextFactory>(new ui::InProcessContextFactory)); |
| 206 aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); | 207 aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); |
| 207 aura_test_helper_->SetUp(); | 208 aura_test_helper_->SetUp(); |
| 209 new wm::DefaultActivationClient(aura_test_helper_->root_window()); |
| 208 | 210 |
| 209 browser_context_.reset(new TestBrowserContext); | 211 browser_context_.reset(new TestBrowserContext); |
| 210 process_host_ = new MockRenderProcessHost(browser_context_.get()); | 212 process_host_ = new MockRenderProcessHost(browser_context_.get()); |
| 211 | 213 |
| 212 sink_ = &process_host_->sink(); | 214 sink_ = &process_host_->sink(); |
| 213 | 215 |
| 214 parent_host_ = new RenderWidgetHostImpl( | 216 parent_host_ = new RenderWidgetHostImpl( |
| 215 &delegate_, process_host_, MSG_ROUTING_NONE, false); | 217 &delegate_, process_host_, MSG_ROUTING_NONE, false); |
| 216 parent_view_ = static_cast<RenderWidgetHostViewAura*>( | 218 parent_view_ = static_cast<RenderWidgetHostViewAura*>( |
| 217 RenderWidgetHostView::CreateViewForWidget(parent_host_)); | 219 RenderWidgetHostView::CreateViewForWidget(parent_host_)); |
| (...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1338 | 1340 |
| 1339 // Because the copy request callback may be holding state within it, that | 1341 // Because the copy request callback may be holding state within it, that |
| 1340 // state must handle the RWHVA and ImageTransportFactory going away before the | 1342 // state must handle the RWHVA and ImageTransportFactory going away before the |
| 1341 // callback is called. This test passes if it does not crash as a result of | 1343 // callback is called. This test passes if it does not crash as a result of |
| 1342 // these things being destroyed. | 1344 // these things being destroyed. |
| 1343 EXPECT_EQ(2, callback_count_); | 1345 EXPECT_EQ(2, callback_count_); |
| 1344 EXPECT_FALSE(result_); | 1346 EXPECT_FALSE(result_); |
| 1345 } | 1347 } |
| 1346 | 1348 |
| 1347 } // namespace content | 1349 } // namespace content |
| OLD | NEW |