| OLD | NEW |
| 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1272 TEST_F(ViewManagerTest, OnViewInput) { | 1272 TEST_F(ViewManagerTest, OnViewInput) { |
| 1273 // Create node 1 and assign a view from connection 2 to it. | 1273 // Create node 1 and assign a view from connection 2 to it. |
| 1274 ASSERT_TRUE(connection_->CreateNode(BuildNodeId(1, 1))); | 1274 ASSERT_TRUE(connection_->CreateNode(BuildNodeId(1, 1))); |
| 1275 ASSERT_NO_FATAL_FAILURE(EstablishSecondConnection(false)); | 1275 ASSERT_NO_FATAL_FAILURE(EstablishSecondConnection(false)); |
| 1276 ASSERT_TRUE(connection2_->CreateView(BuildViewId(2, 11))); | 1276 ASSERT_TRUE(connection2_->CreateView(BuildViewId(2, 11))); |
| 1277 ASSERT_TRUE(connection2_->SetView(BuildNodeId(1, 1), BuildViewId(2, 11))); | 1277 ASSERT_TRUE(connection2_->SetView(BuildNodeId(1, 1), BuildViewId(2, 11))); |
| 1278 | 1278 |
| 1279 // Dispatch an event to the view and verify its received. | 1279 // Dispatch an event to the view and verify its received. |
| 1280 { | 1280 { |
| 1281 EventPtr event(Event::New()); | 1281 EventPtr event(Event::New()); |
| 1282 event->action = 1; | 1282 event->action = static_cast<EventType>(1); |
| 1283 connection_->view_manager()->DispatchOnViewInputEvent( | 1283 connection_->view_manager()->DispatchOnViewInputEvent( |
| 1284 BuildViewId(2, 11), | 1284 BuildViewId(2, 11), |
| 1285 event.Pass()); | 1285 event.Pass()); |
| 1286 connection2_->DoRunLoopUntilChangesCount(1); | 1286 connection2_->DoRunLoopUntilChangesCount(1); |
| 1287 const Changes changes(ChangesToDescription1(connection2_->changes())); | 1287 const Changes changes(ChangesToDescription1(connection2_->changes())); |
| 1288 ASSERT_EQ(1u, changes.size()); | 1288 ASSERT_EQ(1u, changes.size()); |
| 1289 EXPECT_EQ("InputEvent view=2,11 event_action=1", changes[0]); | 1289 EXPECT_EQ("InputEvent view=2,11 event_action=1", changes[0]); |
| 1290 } | 1290 } |
| 1291 } | 1291 } |
| 1292 | 1292 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1408 // originating connection. | 1408 // originating connection. |
| 1409 | 1409 |
| 1410 // TODO(beng): Add tests for focus: | 1410 // TODO(beng): Add tests for focus: |
| 1411 // - focus between two nodes known to a connection | 1411 // - focus between two nodes known to a connection |
| 1412 // - focus between nodes unknown to one of the connections. | 1412 // - focus between nodes unknown to one of the connections. |
| 1413 // - focus between nodes unknown to either connection. | 1413 // - focus between nodes unknown to either connection. |
| 1414 | 1414 |
| 1415 } // namespace service | 1415 } // namespace service |
| 1416 } // namespace view_manager | 1416 } // namespace view_manager |
| 1417 } // namespace mojo | 1417 } // namespace mojo |
| OLD | NEW |