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" | |
9 #include "base/bind.h" | 8 #include "base/bind.h" |
10 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
11 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
12 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
13 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
14 #include "mojo/common/common_type_converters.h" | 13 #include "mojo/common/common_type_converters.h" |
15 #include "mojo/geometry/geometry_type_converters.h" | 14 #include "mojo/geometry/geometry_type_converters.h" |
16 #include "mojo/public/cpp/bindings/allocation_scope.h" | 15 #include "mojo/public/cpp/bindings/allocation_scope.h" |
| 16 #include "mojo/public/cpp/environment/environment.h" |
17 #include "mojo/public/cpp/shell/connect.h" | 17 #include "mojo/public/cpp/shell/connect.h" |
18 #include "mojo/services/public/cpp/view_manager/util.h" | 18 #include "mojo/services/public/cpp/view_manager/util.h" |
19 #include "mojo/services/public/cpp/view_manager/view_manager_types.h" | 19 #include "mojo/services/public/cpp/view_manager/view_manager_types.h" |
20 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" | 20 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" |
21 #include "mojo/shell/shell_test_helper.h" | 21 #include "mojo/shell/shell_test_helper.h" |
22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
23 #include "ui/gfx/geometry/rect.h" | 23 #include "ui/gfx/geometry/rect.h" |
24 | 24 |
25 namespace mojo { | 25 namespace mojo { |
26 | 26 |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 ASSERT_NE(0u, client2_.id()); | 408 ASSERT_NE(0u, client2_.id()); |
409 const std::vector<TestNode>& nodes(client2_.initial_nodes()); | 409 const std::vector<TestNode>& nodes(client2_.initial_nodes()); |
410 ASSERT_EQ(1u, nodes.size()); | 410 ASSERT_EQ(1u, nodes.size()); |
411 EXPECT_EQ("node=1,1 parent=null view=null", nodes[0].ToString()); | 411 EXPECT_EQ("node=1,1 parent=null view=null", nodes[0].ToString()); |
412 } | 412 } |
413 | 413 |
414 void DestroySecondConnection() { | 414 void DestroySecondConnection() { |
415 view_manager2_.reset(); | 415 view_manager2_.reset(); |
416 } | 416 } |
417 | 417 |
418 base::ShadowingAtExitManager at_exit_; | |
419 base::MessageLoop loop_; | 418 base::MessageLoop loop_; |
420 shell::ShellTestHelper test_helper_; | 419 shell::ShellTestHelper test_helper_; |
421 | 420 |
422 ViewManagerClientImpl client_; | 421 ViewManagerClientImpl client_; |
423 IViewManagerPtr view_manager_; | 422 IViewManagerPtr view_manager_; |
424 | 423 |
425 ViewManagerClientImpl client2_; | 424 ViewManagerClientImpl client2_; |
426 IViewManagerPtr view_manager2_; | 425 IViewManagerPtr view_manager2_; |
427 | 426 |
428 DISALLOW_COPY_AND_ASSIGN(ViewManagerConnectionTest); | 427 DISALLOW_COPY_AND_ASSIGN(ViewManagerConnectionTest); |
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1440 ASSERT_EQ(1u, nodes.size()); | 1439 ASSERT_EQ(1u, nodes.size()); |
1441 EXPECT_EQ("node=1,1 parent=null view=null", nodes[0].ToString()); | 1440 EXPECT_EQ("node=1,1 parent=null view=null", nodes[0].ToString()); |
1442 } | 1441 } |
1443 | 1442 |
1444 // TODO(sky): add coverage of test that destroys connections and ensures other | 1443 // TODO(sky): add coverage of test that destroys connections and ensures other |
1445 // connections get deletion notification (or advanced server id). | 1444 // connections get deletion notification (or advanced server id). |
1446 | 1445 |
1447 } // namespace service | 1446 } // namespace service |
1448 } // namespace view_manager | 1447 } // namespace view_manager |
1449 } // namespace mojo | 1448 } // namespace mojo |
OLD | NEW |