| OLD | NEW |
| 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 Loading... |
| 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_.GetRoot()); | 41 return static_cast<TestEventTarget*>(processor_.GetRootTarget()); |
| 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 Loading... |
| 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 |
| OLD | NEW |