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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 447 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
448 command_line->AppendSwitch(switches::kValidateInputEventStream); | 448 command_line->AppendSwitch(switches::kValidateInputEventStream); |
449 | 449 |
450 browser_context_.reset(new TestBrowserContext()); | 450 browser_context_.reset(new TestBrowserContext()); |
451 delegate_.reset(new MockRenderWidgetHostDelegate()); | 451 delegate_.reset(new MockRenderWidgetHostDelegate()); |
452 process_ = new RenderWidgetHostProcess(browser_context_.get()); | 452 process_ = new RenderWidgetHostProcess(browser_context_.get()); |
453 #if defined(USE_AURA) | 453 #if defined(USE_AURA) |
454 ImageTransportFactory::InitializeForUnitTests( | 454 ImageTransportFactory::InitializeForUnitTests( |
455 scoped_ptr<ui::ContextFactory>(new ui::InProcessContextFactory)); | 455 scoped_ptr<ui::ContextFactory>(new ui::InProcessContextFactory)); |
456 aura::Env::CreateInstance(true); | 456 aura::Env::CreateInstance(true); |
457 screen_.reset(aura::TestScreen::Create()); | 457 screen_.reset(aura::TestScreen::Create(gfx::Size())); |
458 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); | 458 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); |
459 #endif | 459 #endif |
460 host_.reset( | 460 host_.reset( |
461 new MockRenderWidgetHost(delegate_.get(), process_, MSG_ROUTING_NONE)); | 461 new MockRenderWidgetHost(delegate_.get(), process_, MSG_ROUTING_NONE)); |
462 view_.reset(new TestView(host_.get())); | 462 view_.reset(new TestView(host_.get())); |
463 host_->SetView(view_.get()); | 463 host_->SetView(view_.get()); |
464 host_->Init(); | 464 host_->Init(); |
465 host_->DisableGestureDebounce(); | 465 host_->DisableGestureDebounce(); |
466 } | 466 } |
467 virtual void TearDown() { | 467 virtual void TearDown() { |
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1410 | 1410 |
1411 // Tests RWHI::ForwardTouchEventWithLatencyInfo(). | 1411 // Tests RWHI::ForwardTouchEventWithLatencyInfo(). |
1412 PressTouchPoint(0, 1); | 1412 PressTouchPoint(0, 1); |
1413 SendTouchEvent(); | 1413 SendTouchEvent(); |
1414 CheckLatencyInfoComponentInMessage( | 1414 CheckLatencyInfoComponentInMessage( |
1415 process_, GetLatencyComponentId(), WebInputEvent::TouchStart); | 1415 process_, GetLatencyComponentId(), WebInputEvent::TouchStart); |
1416 SendInputEventACK(WebInputEvent::TouchStart, INPUT_EVENT_ACK_STATE_CONSUMED); | 1416 SendInputEventACK(WebInputEvent::TouchStart, INPUT_EVENT_ACK_STATE_CONSUMED); |
1417 } | 1417 } |
1418 | 1418 |
1419 } // namespace content | 1419 } // namespace content |
OLD | NEW |