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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 | 265 |
266 void DoRunLoopUntilChangesCount(size_t count) { | 266 void DoRunLoopUntilChangesCount(size_t count) { |
267 if (changes_.size() >= count) | 267 if (changes_.size() >= count) |
268 return; | 268 return; |
269 quit_count_ = count - changes_.size(); | 269 quit_count_ = count - changes_.size(); |
270 DoRunLoop(); | 270 DoRunLoop(); |
271 } | 271 } |
272 | 272 |
273 private: | 273 private: |
274 // IViewManagerClient overrides: | 274 // IViewManagerClient overrides: |
275 virtual void OnConnectionEstablished( | 275 virtual void OnViewManagerConnectionEstablished( |
276 TransportConnectionId connection_id, | 276 TransportConnectionId connection_id, |
277 TransportChangeId next_server_change_id, | 277 TransportChangeId next_server_change_id, |
278 const mojo::Array<INode>& nodes) OVERRIDE { | 278 const mojo::Array<INode>& nodes) OVERRIDE { |
279 id_ = connection_id; | 279 id_ = connection_id; |
280 next_server_change_id_ = next_server_change_id; | 280 next_server_change_id_ = next_server_change_id; |
281 initial_nodes_.clear(); | 281 initial_nodes_.clear(); |
282 INodesToTestNodes(nodes, &initial_nodes_); | 282 INodesToTestNodes(nodes, &initial_nodes_); |
283 changes_.push_back("OnConnectionEstablished"); | 283 changes_.push_back("OnConnectionEstablished"); |
284 QuitIfNecessary(); | 284 QuitIfNecessary(); |
285 } | 285 } |
(...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1440 ASSERT_EQ(1u, nodes.size()); | 1440 ASSERT_EQ(1u, nodes.size()); |
1441 EXPECT_EQ("node=1,1 parent=null view=null", nodes[0].ToString()); | 1441 EXPECT_EQ("node=1,1 parent=null view=null", nodes[0].ToString()); |
1442 } | 1442 } |
1443 | 1443 |
1444 // TODO(sky): add coverage of test that destroys connections and ensures other | 1444 // TODO(sky): add coverage of test that destroys connections and ensures other |
1445 // connections get deletion notification (or advanced server id). | 1445 // connections get deletion notification (or advanced server id). |
1446 | 1446 |
1447 } // namespace service | 1447 } // namespace service |
1448 } // namespace view_manager | 1448 } // namespace view_manager |
1449 } // namespace mojo | 1449 } // namespace mojo |
OLD | NEW |