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 30 matching lines...) Expand all Loading... |
41 (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF(); | 41 (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF(); |
42 event_time_delta_seconds_ = 0.1; | 42 event_time_delta_seconds_ = 0.1; |
43 } | 43 } |
44 | 44 |
45 virtual ~TouchEmulatorTest() {} | 45 virtual ~TouchEmulatorTest() {} |
46 | 46 |
47 // testing::Test | 47 // testing::Test |
48 virtual void SetUp() OVERRIDE { | 48 virtual void SetUp() OVERRIDE { |
49 #if defined(USE_AURA) | 49 #if defined(USE_AURA) |
50 aura::Env::CreateInstance(true); | 50 aura::Env::CreateInstance(true); |
51 screen_.reset(aura::TestScreen::Create()); | 51 screen_.reset(aura::TestScreen::Create(gfx::Size())); |
52 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); | 52 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get()); |
53 #endif | 53 #endif |
54 | 54 |
55 emulator_.reset(new TouchEmulator(this)); | 55 emulator_.reset(new TouchEmulator(this)); |
56 emulator_->Enable(true /* allow_pinch */); | 56 emulator_->Enable(true /* allow_pinch */); |
57 } | 57 } |
58 | 58 |
59 virtual void TearDown() OVERRIDE { | 59 virtual void TearDown() OVERRIDE { |
60 emulator_->Disable(); | 60 emulator_->Disable(); |
61 EXPECT_EQ("", ExpectedEvents()); | 61 EXPECT_EQ("", ExpectedEvents()); |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 EXPECT_EQ("TouchStart GestureTapDown", ExpectedEvents()); | 340 EXPECT_EQ("TouchStart GestureTapDown", ExpectedEvents()); |
341 EXPECT_FALSE(SendMouseWheelEvent()); | 341 EXPECT_FALSE(SendMouseWheelEvent()); |
342 emulator()->Disable(); | 342 emulator()->Disable(); |
343 EXPECT_EQ("TouchCancel GestureTapCancel", ExpectedEvents()); | 343 EXPECT_EQ("TouchCancel GestureTapCancel", ExpectedEvents()); |
344 EXPECT_TRUE(SendMouseWheelEvent()); | 344 EXPECT_TRUE(SendMouseWheelEvent()); |
345 emulator()->Enable(true /* allow_pinch */); | 345 emulator()->Enable(true /* allow_pinch */); |
346 EXPECT_TRUE(SendMouseWheelEvent()); | 346 EXPECT_TRUE(SendMouseWheelEvent()); |
347 } | 347 } |
348 | 348 |
349 } // namespace content | 349 } // namespace content |
OLD | NEW |