Chromium Code Reviews| Index: services/ui/demo/mus_demo_unittests.cc |
| diff --git a/ash/mus/app_launch_unittest.cc b/services/ui/demo/mus_demo_unittests.cc |
| similarity index 58% |
| copy from ash/mus/app_launch_unittest.cc |
| copy to services/ui/demo/mus_demo_unittests.cc |
| index b11bb3b969ac19bd23126d7b86e6f43e34fa8aa5..e097e875b8817d9c424ce85f76021aca45c64541 100644 |
| --- a/ash/mus/app_launch_unittest.cc |
| +++ b/services/ui/demo/mus_demo_unittests.cc |
| @@ -4,47 +4,56 @@ |
| #include "base/bind.h" |
| #include "base/command_line.h" |
| +#include "base/macros.h" |
| #include "base/run_loop.h" |
| #include "services/shell/public/cpp/service_test.h" |
| #include "services/ui/public/interfaces/window_server_test.mojom.h" |
| +#include "testing/gtest/include/gtest/gtest.h" |
| -namespace ash { |
| -namespace mus { |
| +namespace ui { |
| +namespace demo { |
| + |
| +namespace { |
| + |
| +const char kTestAppName[] = "exe:mus_demo_unittests"; |
| void RunCallback(bool* success, const base::Closure& callback, bool result) { |
| *success = result; |
| callback.Run(); |
| } |
| -class AppLaunchTest : public shell::test::ServiceTest { |
| +class MusDemoTest : public shell::test::ServiceTest { |
|
rjkroege
2016/07/08 21:38:32
Given that we renamed mus to services/ui -- maybe
kylechar
2016/07/13 13:55:32
I see the thread. Hmmm, UIServiceDemo doesn't have
|
| public: |
| - AppLaunchTest() : ServiceTest("exe:mash_unittests") {} |
| - ~AppLaunchTest() override {} |
| + MusDemoTest() : shell::test::ServiceTest(kTestAppName) {} |
| + ~MusDemoTest() override {} |
| - private: |
| void SetUp() override { |
| base::CommandLine::ForCurrentProcess()->AppendSwitch("use-test-config"); |
| ServiceTest::SetUp(); |
| } |
| - DISALLOW_COPY_AND_ASSIGN(AppLaunchTest); |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(MusDemoTest); |
| }; |
| -TEST_F(AppLaunchTest, TestQuickLaunch) { |
| - connector()->Connect("mojo:ash"); |
| - connector()->Connect("mojo:quick_launch"); |
| +} // namespace |
| + |
| +TEST_F(MusDemoTest, CheckMusDemoDraws) { |
| + connector()->Connect("mojo:mus_demo"); |
| ::ui::mojom::WindowServerTestPtr test_interface; |
| connector()->ConnectToInterface("mojo:ui", &test_interface); |
| base::RunLoop run_loop; |
| bool success = false; |
| + // TODO(kylechar): Fix WindowServer::CreateTreeForWindowManager so that the |
| + // WindowTree has the correct name instead of an empty name. |
| test_interface->EnsureClientHasDrawnWindow( |
| - "mojo:quick_launch", |
| + "", // WindowTree name is empty. |
| base::Bind(&RunCallback, &success, run_loop.QuitClosure())); |
| run_loop.Run(); |
| EXPECT_TRUE(success); |
| } |
| -} // namespace mus |
| -} // namespace ash |
| +} // namespace demo |
| +} // namespace ui |