| 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/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 tracker_.OnNodeDeleted(node, server_change_id); | 337 tracker_.OnNodeDeleted(node, server_change_id); |
| 338 } | 338 } |
| 339 virtual void OnViewDeleted(TransportViewId view) OVERRIDE { | 339 virtual void OnViewDeleted(TransportViewId view) OVERRIDE { |
| 340 tracker_.OnViewDeleted(view); | 340 tracker_.OnViewDeleted(view); |
| 341 } | 341 } |
| 342 virtual void OnNodeViewReplaced(TransportNodeId node, | 342 virtual void OnNodeViewReplaced(TransportNodeId node, |
| 343 TransportViewId new_view_id, | 343 TransportViewId new_view_id, |
| 344 TransportViewId old_view_id) OVERRIDE { | 344 TransportViewId old_view_id) OVERRIDE { |
| 345 tracker_.OnNodeViewReplaced(node, new_view_id, old_view_id); | 345 tracker_.OnNodeViewReplaced(node, new_view_id, old_view_id); |
| 346 } | 346 } |
| 347 virtual void OnViewInputEvent(uint32_t view, | |
| 348 EventPtr event, | |
| 349 const Callback<void()>& callback) OVERRIDE { | |
| 350 } | |
| 351 | 347 |
| 352 private: | 348 private: |
| 353 TestChangeTracker tracker_; | 349 TestChangeTracker tracker_; |
| 354 BackgroundConnection connection_; | 350 BackgroundConnection connection_; |
| 355 | 351 |
| 356 DISALLOW_COPY_AND_ASSIGN(TestViewManagerClientConnection); | 352 DISALLOW_COPY_AND_ASSIGN(TestViewManagerClientConnection); |
| 357 }; | 353 }; |
| 358 | 354 |
| 359 // Used with IViewManager::Connect(). Creates a TestViewManagerClientConnection, | 355 // Used with IViewManager::Connect(). Creates a TestViewManagerClientConnection, |
| 360 // which creates and owns the BackgroundConnection. | 356 // which creates and owns the BackgroundConnection. |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 tracker_.OnNodeDeleted(node, server_change_id); | 633 tracker_.OnNodeDeleted(node, server_change_id); |
| 638 } | 634 } |
| 639 virtual void OnViewDeleted(TransportViewId view) OVERRIDE { | 635 virtual void OnViewDeleted(TransportViewId view) OVERRIDE { |
| 640 tracker_.OnViewDeleted(view); | 636 tracker_.OnViewDeleted(view); |
| 641 } | 637 } |
| 642 virtual void OnNodeViewReplaced(TransportNodeId node, | 638 virtual void OnNodeViewReplaced(TransportNodeId node, |
| 643 TransportViewId new_view_id, | 639 TransportViewId new_view_id, |
| 644 TransportViewId old_view_id) OVERRIDE { | 640 TransportViewId old_view_id) OVERRIDE { |
| 645 tracker_.OnNodeViewReplaced(node, new_view_id, old_view_id); | 641 tracker_.OnNodeViewReplaced(node, new_view_id, old_view_id); |
| 646 } | 642 } |
| 647 virtual void OnViewInputEvent(uint32_t view, | |
| 648 EventPtr event, | |
| 649 const Callback<void()>& callback) OVERRIDE { | |
| 650 } | |
| 651 | 643 |
| 652 TransportConnectionId id_; | 644 TransportConnectionId id_; |
| 653 TransportChangeId next_server_change_id_; | 645 TransportChangeId next_server_change_id_; |
| 654 | 646 |
| 655 // Set of nodes sent when connection created. | 647 // Set of nodes sent when connection created. |
| 656 std::vector<TestNode> initial_nodes_; | 648 std::vector<TestNode> initial_nodes_; |
| 657 | 649 |
| 658 // Nodes sent from last OnNodeHierarchyChanged. | 650 // Nodes sent from last OnNodeHierarchyChanged. |
| 659 std::vector<TestNode> hierarchy_changed_nodes_; | 651 std::vector<TestNode> hierarchy_changed_nodes_; |
| 660 | 652 |
| (...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1703 ASSERT_EQ(1u, changes.size()); | 1695 ASSERT_EQ(1u, changes.size()); |
| 1704 EXPECT_EQ("OnConnectionEstablished", changes[0]); | 1696 EXPECT_EQ("OnConnectionEstablished", changes[0]); |
| 1705 } | 1697 } |
| 1706 | 1698 |
| 1707 // TODO(sky): add coverage of test that destroys connections and ensures other | 1699 // TODO(sky): add coverage of test that destroys connections and ensures other |
| 1708 // connections get deletion notification (or advanced server id). | 1700 // connections get deletion notification (or advanced server id). |
| 1709 | 1701 |
| 1710 } // namespace service | 1702 } // namespace service |
| 1711 } // namespace view_manager | 1703 } // namespace view_manager |
| 1712 } // namespace mojo | 1704 } // namespace mojo |
| OLD | NEW |