Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(847)

Unified Diff: services/ui/demo/mus_demo_unittests.cc

Issue 2138433002: Add unit test for mus_demo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change name. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/demo/mus_demo.cc ('k') | services/ui/demo/test_manifest.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « services/ui/demo/mus_demo.cc ('k') | services/ui/demo/test_manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698