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

Side by Side Diff: ui/events/platform/platform_event_source_unittest.cc

Issue 1138993007: Substituting pattern push_back(ptr.release()) with push_back(ptr.Pass()) in ui/events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated the review comments Created 5 years, 7 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 "ui/events/platform/platform_event_source.h" 5 #include "ui/events/platform/platform_event_source.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 // Tests that resetting an overridden dispatcher causes the nested message-loop 594 // Tests that resetting an overridden dispatcher causes the nested message-loop
595 // iteration to stop and the rest of the events are dispatched in the next 595 // iteration to stop and the rest of the events are dispatched in the next
596 // iteration. 596 // iteration.
597 class DestroyedNestedOverriddenDispatcherQuitsNestedLoopIteration 597 class DestroyedNestedOverriddenDispatcherQuitsNestedLoopIteration
598 : public PlatformEventTestWithMessageLoop { 598 : public PlatformEventTestWithMessageLoop {
599 public: 599 public:
600 void NestedTask(std::vector<int>* list, 600 void NestedTask(std::vector<int>* list,
601 TestPlatformEventDispatcher* dispatcher) { 601 TestPlatformEventDispatcher* dispatcher) {
602 ScopedVector<PlatformEvent> events; 602 ScopedVector<PlatformEvent> events;
603 scoped_ptr<PlatformEvent> event(CreatePlatformEvent()); 603 scoped_ptr<PlatformEvent> event(CreatePlatformEvent());
604 events.push_back(event.release()); 604 events.push_back(event.Pass());
605 event = CreatePlatformEvent(); 605 event = CreatePlatformEvent();
606 events.push_back(event.release()); 606 events.push_back(event.Pass());
607 607
608 // Attempt to dispatch a couple of events. Dispatching the first event will 608 // Attempt to dispatch a couple of events. Dispatching the first event will
609 // have terminated the ScopedEventDispatcher object, which will terminate 609 // have terminated the ScopedEventDispatcher object, which will terminate
610 // the current iteration of the message-loop. 610 // the current iteration of the message-loop.
611 size_t count = source()->DispatchEventStream(events); 611 size_t count = source()->DispatchEventStream(events);
612 EXPECT_EQ(1u, count); 612 EXPECT_EQ(1u, count);
613 ASSERT_EQ(2u, list->size()); 613 ASSERT_EQ(2u, list->size());
614 EXPECT_EQ(15, (*list)[0]); 614 EXPECT_EQ(15, (*list)[0]);
615 EXPECT_EQ(20, (*list)[1]); 615 EXPECT_EQ(20, (*list)[1]);
616 list->clear(); 616 list->clear();
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 ASSERT_EQ(2u, list.size()); 768 ASSERT_EQ(2u, list.size());
769 EXPECT_EQ(15, list[0]); 769 EXPECT_EQ(15, list[0]);
770 EXPECT_EQ(10, list[1]); 770 EXPECT_EQ(10, list[1]);
771 } 771 }
772 }; 772 };
773 773
774 RUN_TEST_IN_MESSAGE_LOOP( 774 RUN_TEST_IN_MESSAGE_LOOP(
775 ConsecutiveOverriddenDispatcherInTheSameMessageLoopIteration) 775 ConsecutiveOverriddenDispatcherInTheSameMessageLoopIteration)
776 776
777 } // namespace ui 777 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc ('k') | ui/events/test/test_event_target.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698