Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: content/browser/renderer_host/input/touch_emulator_unittest.cc

Issue 857283002: Makes a couple of tests reset state appropriately (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweak Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/test/base/view_event_test_platform_part_ash.cc ('k') | content/browser/renderer_host/render_widget_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698