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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 emulator_.reset(new TouchEmulator(this)); | 55 emulator_.reset(new TouchEmulator(this)); |
56 emulator_->Enable(ui::GestureProviderConfigType::GENERIC_MOBILE); | 56 emulator_->Enable(ui::GestureProviderConfigType::GENERIC_MOBILE); |
57 } | 57 } |
58 | 58 |
59 void TearDown() override { | 59 void TearDown() override { |
60 emulator_->Disable(); | 60 emulator_->Disable(); |
61 EXPECT_EQ("", ExpectedEvents()); | 61 EXPECT_EQ("", ExpectedEvents()); |
62 | 62 |
63 #if defined(USE_AURA) | 63 #if defined(USE_AURA) |
64 aura::Env::DeleteInstance(); | 64 aura::Env::DeleteInstance(); |
| 65 gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, nullptr); |
65 screen_.reset(); | 66 screen_.reset(); |
66 #endif | 67 #endif |
67 } | 68 } |
68 | 69 |
69 void ForwardGestureEvent(const blink::WebGestureEvent& event) override { | 70 void ForwardGestureEvent(const blink::WebGestureEvent& event) override { |
70 forwarded_events_.push_back(event.type); | 71 forwarded_events_.push_back(event.type); |
71 } | 72 } |
72 | 73 |
73 void ForwardEmulatedTouchEvent(const blink::WebTouchEvent& event) override { | 74 void ForwardEmulatedTouchEvent(const blink::WebTouchEvent& event) override { |
74 forwarded_events_.push_back(event.type); | 75 forwarded_events_.push_back(event.type); |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 MouseDown(100, 200); | 546 MouseDown(100, 200); |
546 EXPECT_EQ("TouchStart GestureTapDown", ExpectedEvents()); | 547 EXPECT_EQ("TouchStart GestureTapDown", ExpectedEvents()); |
547 MouseUp(200, 200); | 548 MouseUp(200, 200); |
548 EXPECT_EQ( | 549 EXPECT_EQ( |
549 "TouchMove GestureTapCancel GestureScrollBegin GestureScrollUpdate" | 550 "TouchMove GestureTapCancel GestureScrollBegin GestureScrollUpdate" |
550 " TouchEnd GestureScrollEnd", | 551 " TouchEnd GestureScrollEnd", |
551 ExpectedEvents()); | 552 ExpectedEvents()); |
552 } | 553 } |
553 | 554 |
554 } // namespace content | 555 } // namespace content |
OLD | NEW |