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

Side by Side Diff: ui/aura/root_window_unittest.cc

Issue 154203002: Remove unnecessary uses of aura::Env::GetDispatcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
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 "ui/aura/root_window.h" 5 #include "ui/aura/root_window.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 } 436 }
437 437
438 const Events& events() const { return events_; } 438 const Events& events() const { return events_; }
439 439
440 const EventLocations& mouse_locations() const { return mouse_locations_; } 440 const EventLocations& mouse_locations() const { return mouse_locations_; }
441 gfx::Point mouse_location(int i) const { return mouse_locations_[i]; } 441 gfx::Point mouse_location(int i) const { return mouse_locations_[i]; }
442 const EventLocations& touch_locations() const { return touch_locations_; } 442 const EventLocations& touch_locations() const { return touch_locations_; }
443 443
444 void WaitUntilReceivedEvent(ui::EventType type) { 444 void WaitUntilReceivedEvent(ui::EventType type) {
445 wait_until_event_ = type; 445 wait_until_event_ = type;
446 run_loop_.reset(new base::RunLoop( 446 run_loop_.reset(new base::RunLoop());
447 Env::GetInstance()->GetDispatcher()));
448 run_loop_->Run(); 447 run_loop_->Run();
449 } 448 }
450 449
451 Events GetAndResetEvents() { 450 Events GetAndResetEvents() {
452 Events events = events_; 451 Events events = events_;
453 Reset(); 452 Reset();
454 return events; 453 return events;
455 } 454 }
456 455
457 void Reset() { 456 void Reset() {
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1672 EXPECT_EQ("TOUCH_MOVED TOUCH_RELEASED GESTURE_SCROLL_END GESTURE_END", 1671 EXPECT_EQ("TOUCH_MOVED TOUCH_RELEASED GESTURE_SCROLL_END GESTURE_END",
1673 EventTypesToString(events)); 1672 EventTypesToString(events));
1674 ASSERT_EQ(2u, filter->touch_locations().size()); 1673 ASSERT_EQ(2u, filter->touch_locations().size());
1675 EXPECT_EQ(gfx::Point(-40, 10).ToString(), 1674 EXPECT_EQ(gfx::Point(-40, 10).ToString(),
1676 filter->touch_locations()[0].ToString()); 1675 filter->touch_locations()[0].ToString());
1677 EXPECT_EQ(gfx::Point(-40, 10).ToString(), 1676 EXPECT_EQ(gfx::Point(-40, 10).ToString(),
1678 filter->touch_locations()[1].ToString()); 1677 filter->touch_locations()[1].ToString());
1679 } 1678 }
1680 1679
1681 } // namespace aura 1680 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698