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 "mojo/services/public/cpp/view_manager/view_manager.h" | 5 #include "mojo/services/public/cpp/view_manager/view_manager.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "mojo/application_manager/application_manager.h" | 10 #include "mojo/application_manager/application_manager.h" |
11 #include "mojo/public/cpp/application/application_connection.h" | 11 #include "mojo/public/cpp/application/application_connection.h" |
12 #include "mojo/public/cpp/application/application_delegate.h" | 12 #include "mojo/public/cpp/application/application_delegate.h" |
13 #include "mojo/public/cpp/application/application_impl.h" | 13 #include "mojo/public/cpp/application/application_impl.h" |
14 #include "mojo/public/cpp/application/service_provider_impl.h" | 14 #include "mojo/public/cpp/application/service_provider_impl.h" |
15 #include "mojo/public/interfaces/application/service_provider.mojom.h" | 15 #include "mojo/public/interfaces/application/service_provider.mojom.h" |
| 16 #include "mojo/services/public/cpp/geometry/geometry_util.h" |
16 #include "mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h" | 17 #include "mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h" |
17 #include "mojo/services/public/cpp/view_manager/lib/view_private.h" | 18 #include "mojo/services/public/cpp/view_manager/lib/view_private.h" |
18 #include "mojo/services/public/cpp/view_manager/util.h" | 19 #include "mojo/services/public/cpp/view_manager/util.h" |
19 #include "mojo/services/public/cpp/view_manager/view_manager_client_factory.h" | 20 #include "mojo/services/public/cpp/view_manager/view_manager_client_factory.h" |
20 #include "mojo/services/public/cpp/view_manager/view_manager_delegate.h" | 21 #include "mojo/services/public/cpp/view_manager/view_manager_delegate.h" |
21 #include "mojo/services/public/cpp/view_manager/view_observer.h" | 22 #include "mojo/services/public/cpp/view_manager/view_observer.h" |
22 #include "mojo/shell/shell_test_helper.h" | 23 #include "mojo/shell/shell_test_helper.h" |
23 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
24 | 25 |
25 namespace mojo { | 26 namespace mojo { |
26 | 27 |
27 // TODO(jam): move these somewhere else so they can be shared? | |
28 | |
29 inline bool operator==(const Rect& lhs, const Rect& rhs) { | |
30 return lhs.x == rhs.x && lhs.y == rhs.y && lhs.width == rhs.width && | |
31 lhs.height == lhs.height; | |
32 } | |
33 | |
34 inline bool operator!=(const Rect& lhs, const Rect& rhs) { | |
35 return !(lhs == rhs); | |
36 } | |
37 | |
38 namespace { | 28 namespace { |
39 | 29 |
40 const char kWindowManagerURL[] = "mojo:window_manager"; | 30 const char kWindowManagerURL[] = "mojo:window_manager"; |
41 const char kEmbeddedApp1URL[] = "mojo:embedded_app_1"; | 31 const char kEmbeddedApp1URL[] = "mojo:embedded_app_1"; |
42 | 32 |
43 base::RunLoop* current_run_loop = NULL; | 33 base::RunLoop* current_run_loop = NULL; |
44 | 34 |
45 void DoRunLoop() { | 35 void DoRunLoop() { |
46 base::RunLoop run_loop; | 36 base::RunLoop run_loop; |
47 current_run_loop = &run_loop; | 37 current_run_loop = &run_loop; |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 | 626 |
637 // TODO(beng): tests for view event dispatcher. | 627 // TODO(beng): tests for view event dispatcher. |
638 // - verify that we see events for all views. | 628 // - verify that we see events for all views. |
639 | 629 |
640 // TODO(beng): tests for focus: | 630 // TODO(beng): tests for focus: |
641 // - focus between two views known to a connection | 631 // - focus between two views known to a connection |
642 // - focus between views unknown to one of the connections. | 632 // - focus between views unknown to one of the connections. |
643 // - focus between views unknown to either connection. | 633 // - focus between views unknown to either connection. |
644 | 634 |
645 } // namespace mojo | 635 } // namespace mojo |
OLD | NEW |