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

Side by Side Diff: ui/events/event_processor_unittest.cc

Issue 2681613002: Avoid two targeting phases in aura client-lib and EventProcessor. (Closed)
Patch Set: early return Created 3 years, 9 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
« no previous file with comments | « ui/events/event_processor.cc ('k') | ui/events/test/test_event_processor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <utility> 5 #include <utility>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 20 matching lines...) Expand all
31 protected: 31 protected:
32 // testing::Test: 32 // testing::Test:
33 void SetUp() override { 33 void SetUp() override {
34 processor_.SetRoot(base::MakeUnique<TestEventTarget>()); 34 processor_.SetRoot(base::MakeUnique<TestEventTarget>());
35 processor_.Reset(); 35 processor_.Reset();
36 root()->SetEventTargeter( 36 root()->SetEventTargeter(
37 base::MakeUnique<TestEventTargeter>(root(), false)); 37 base::MakeUnique<TestEventTargeter>(root(), false));
38 } 38 }
39 39
40 TestEventTarget* root() { 40 TestEventTarget* root() {
41 return static_cast<TestEventTarget*>(processor_.GetRootTarget()); 41 return static_cast<TestEventTarget*>(processor_.GetRoot());
42 } 42 }
43 43
44 TestEventProcessor* processor() { 44 TestEventProcessor* processor() {
45 return &processor_; 45 return &processor_;
46 } 46 }
47 47
48 void DispatchEvent(Event* event) { 48 void DispatchEvent(Event* event) {
49 processor_.OnEventFromSource(event); 49 processor_.OnEventFromSource(event);
50 } 50 }
51 51
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 DispatchEvent(&mouse); 368 DispatchEvent(&mouse);
369 369
370 std::string expected[] = { "PreR", "PreC", "PreG", "G", "PostG", "PostC", 370 std::string expected[] = { "PreR", "PreC", "PreG", "G", "PostG", "PostC",
371 "PostR", "PreR", "PreC", "C", "PostC", "PostR", "PreR", "R", "PostR" }; 371 "PostR", "PreR", "PreC", "C", "PostC", "PostR", "PreR", "R", "PostR" };
372 EXPECT_EQ(std::vector<std::string>( 372 EXPECT_EQ(std::vector<std::string>(
373 expected, expected + arraysize(expected)), recorder); 373 expected, expected + arraysize(expected)), recorder);
374 } 374 }
375 375
376 } // namespace test 376 } // namespace test
377 } // namespace ui 377 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/event_processor.cc ('k') | ui/events/test/test_event_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698