| 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "services/service_manager/public/cpp/service_test.h" | 8 #include "services/service_manager/public/cpp/service_test.h" |
| 9 #include "services/ui/public/interfaces/constants.mojom.h" |
| 9 #include "services/ui/public/interfaces/window_server_test.mojom.h" | 10 #include "services/ui/public/interfaces/window_server_test.mojom.h" |
| 10 | 11 |
| 11 namespace ash { | 12 namespace ash { |
| 12 namespace mus { | 13 namespace mus { |
| 13 | 14 |
| 14 void RunCallback(bool* success, const base::Closure& callback, bool result) { | 15 void RunCallback(bool* success, const base::Closure& callback, bool result) { |
| 15 *success = result; | 16 *success = result; |
| 16 callback.Run(); | 17 callback.Run(); |
| 17 } | 18 } |
| 18 | 19 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 37 #if defined(USE_OZONE) | 38 #if defined(USE_OZONE) |
| 38 #define MAYBE_TestQuickLaunch TestQuickLaunch | 39 #define MAYBE_TestQuickLaunch TestQuickLaunch |
| 39 #else | 40 #else |
| 40 #define MAYBE_TestQuickLaunch DISABLED_TestQuickLaunch | 41 #define MAYBE_TestQuickLaunch DISABLED_TestQuickLaunch |
| 41 #endif // defined(USE_OZONE) | 42 #endif // defined(USE_OZONE) |
| 42 TEST_F(AppLaunchTest, MAYBE_TestQuickLaunch) { | 43 TEST_F(AppLaunchTest, MAYBE_TestQuickLaunch) { |
| 43 connector()->Connect("ash"); | 44 connector()->Connect("ash"); |
| 44 connector()->Connect("quick_launch"); | 45 connector()->Connect("quick_launch"); |
| 45 | 46 |
| 46 ui::mojom::WindowServerTestPtr test_interface; | 47 ui::mojom::WindowServerTestPtr test_interface; |
| 47 connector()->ConnectToInterface("ui", &test_interface); | 48 connector()->ConnectToInterface(ui::mojom::kServiceName, &test_interface); |
| 48 | 49 |
| 49 base::RunLoop run_loop; | 50 base::RunLoop run_loop; |
| 50 bool success = false; | 51 bool success = false; |
| 51 test_interface->EnsureClientHasDrawnWindow( | 52 test_interface->EnsureClientHasDrawnWindow( |
| 52 "quick_launch", | 53 "quick_launch", |
| 53 base::Bind(&RunCallback, &success, run_loop.QuitClosure())); | 54 base::Bind(&RunCallback, &success, run_loop.QuitClosure())); |
| 54 run_loop.Run(); | 55 run_loop.Run(); |
| 55 EXPECT_TRUE(success); | 56 EXPECT_TRUE(success); |
| 56 } | 57 } |
| 57 | 58 |
| 58 } // namespace mus | 59 } // namespace mus |
| 59 } // namespace ash | 60 } // namespace ash |
| OLD | NEW |