OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 last_event_time_seconds_ = | 39 last_event_time_seconds_ = |
40 (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF(); | 40 (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF(); |
41 event_time_delta_seconds_ = 0.1; | 41 event_time_delta_seconds_ = 0.1; |
42 } | 42 } |
43 | 43 |
44 virtual ~TouchEmulatorTest() {} | 44 virtual ~TouchEmulatorTest() {} |
45 | 45 |
46 // testing::Test | 46 // testing::Test |
47 virtual void SetUp() OVERRIDE { | 47 virtual void SetUp() OVERRIDE { |
48 #if defined(USE_AURA) | 48 #if defined(USE_AURA) |
49 aura::Env::CreateInstance(); | 49 aura::Env::CreateInstance(true); |
50 screen_.reset(aura::TestScreen::Create()); | 50 screen_.reset(aura::TestScreen::Create()); |
51 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); | 51 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); |
52 #endif | 52 #endif |
53 | 53 |
54 emulator_.reset(new TouchEmulator(this)); | 54 emulator_.reset(new TouchEmulator(this)); |
55 emulator_->Enable(true /* allow_pinch */); | 55 emulator_->Enable(true /* allow_pinch */); |
56 } | 56 } |
57 | 57 |
58 virtual void TearDown() OVERRIDE { | 58 virtual void TearDown() OVERRIDE { |
59 emulator_->Disable(); | 59 emulator_->Disable(); |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 EXPECT_EQ( | 311 EXPECT_EQ( |
312 "TouchMove GestureScrollUpdate", | 312 "TouchMove GestureScrollUpdate", |
313 ExpectedEvents()); | 313 ExpectedEvents()); |
314 MouseUp(400, 200); | 314 MouseUp(400, 200); |
315 EXPECT_EQ( | 315 EXPECT_EQ( |
316 "TouchEnd GestureScrollEnd", | 316 "TouchEnd GestureScrollEnd", |
317 ExpectedEvents()); | 317 ExpectedEvents()); |
318 } | 318 } |
319 | 319 |
320 } // namespace content | 320 } // namespace content |
OLD | NEW |