OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/memory/ptr_util.h" | 6 #include "base/memory/ptr_util.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "services/shell/background/background_shell.h" | 8 #include "services/shell/background/background_shell.h" |
9 #include "services/shell/background/tests/test_catalog_store.h" | 9 #include "services/shell/background/tests/test_catalog_store.h" |
10 #include "services/shell/public/cpp/connector.h" | 10 #include "services/shell/public/cpp/connector.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 // TODO(rockot): Remove this RunLoop. http://crbug.com/594852. | 53 // TODO(rockot): Remove this RunLoop. http://crbug.com/594852. |
54 base::RunLoop wait_loop; | 54 base::RunLoop wait_loop; |
55 shell_connection_->set_initialize_handler(wait_loop.QuitClosure()); | 55 shell_connection_->set_initialize_handler(wait_loop.QuitClosure()); |
56 wait_loop.Run(); | 56 wait_loop.Run(); |
57 | 57 |
58 // ui/views/mus requires a WindowManager running, for now use the desktop | 58 // ui/views/mus requires a WindowManager running, for now use the desktop |
59 // one. | 59 // one. |
60 shell::Connector* connector = shell_connection_->connector(); | 60 shell::Connector* connector = shell_connection_->connector(); |
61 connector->Connect("mojo:desktop_wm"); | 61 connector->Connect("mojo:desktop_wm"); |
62 WindowManagerConnection::Create(connector); | 62 WindowManagerConnection::Create(connector, shell_connection_->identity()); |
63 | 63 |
64 // On X we need to reset the ContextFactory before every NativeWidgetMus | 64 // On X we need to reset the ContextFactory before every NativeWidgetMus |
65 // is created. | 65 // is created. |
66 // TODO(sad): this is a hack, figure out a better solution. | 66 // TODO(sad): this is a hack, figure out a better solution. |
67 ViewsDelegate::GetInstance()->set_native_widget_factory(base::Bind( | 67 ViewsDelegate::GetInstance()->set_native_widget_factory(base::Bind( |
68 &PlatformTestHelperMus::CreateNativeWidgetMus, base::Unretained(this), | 68 &PlatformTestHelperMus::CreateNativeWidgetMus, base::Unretained(this), |
69 std::map<std::string, std::vector<uint8_t>>())); | 69 std::map<std::string, std::vector<uint8_t>>())); |
70 } | 70 } |
71 | 71 |
72 ~PlatformTestHelperMus() override { | 72 ~PlatformTestHelperMus() override { |
(...skipping 26 matching lines...) Expand all Loading... |
99 }; | 99 }; |
100 | 100 |
101 } // namespace | 101 } // namespace |
102 | 102 |
103 // static | 103 // static |
104 std::unique_ptr<PlatformTestHelper> PlatformTestHelper::Create() { | 104 std::unique_ptr<PlatformTestHelper> PlatformTestHelper::Create() { |
105 return base::WrapUnique(new PlatformTestHelperMus); | 105 return base::WrapUnique(new PlatformTestHelperMus); |
106 } | 106 } |
107 | 107 |
108 } // namespace views | 108 } // namespace views |
OLD | NEW |