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

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

Issue 2715533005: Make mus_demo_unittests work with multiple root windows (Closed)
Patch Set: Pass the count to the callback. Created 3 years, 10 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
Index: services/ui/demo/mus_demo_unittests.cc
diff --git a/services/ui/demo/mus_demo_unittests.cc b/services/ui/demo/mus_demo_unittests.cc
index 9fdb8107a2c0aff014de2d237164dce0aaecd753..0e1aaa524704ef37a8a86ab884031bfb1c4d8007 100644
--- a/services/ui/demo/mus_demo_unittests.cc
+++ b/services/ui/demo/mus_demo_unittests.cc
@@ -18,8 +18,10 @@ namespace {
const char kTestAppName[] = "mus_demo_unittests";
-void RunCallback(bool* success, const base::Closure& callback, bool result) {
- *success = result;
+void RunCallback(uint64_t* root_window_count,
+ const base::Closure& callback,
+ uint64_t result) {
+ *root_window_count = result;
callback.Run();
}
@@ -46,14 +48,16 @@ TEST_F(MusDemoTest, CheckMusDemoDraws) {
connector()->BindInterface(ui::mojom::kServiceName, &test_interface);
base::RunLoop run_loop;
- bool success = false;
+ uint64_t root_window_count = 0;
// TODO(kylechar): Fix WindowServer::CreateTreeForWindowManager so that the
// WindowTree has the correct name instead of an empty name.
- test_interface->EnsureClientHasDrawnWindow(
+ // TODO(tonikitoo,fwang): Also fix the WindowTree name for MusDemoExternal.
+ test_interface->EnsureClientHasDrawnRootWindows(
"", // WindowTree name is empty.
- base::Bind(&RunCallback, &success, run_loop.QuitClosure()));
+ base::Bind(&RunCallback, &root_window_count, run_loop.QuitClosure()));
run_loop.Run();
- EXPECT_TRUE(success);
+ // TODO(tonikitoo,fwang): Test multiple windows for MusDemoExternal.
+ EXPECT_EQ(1u, root_window_count);
}
} // namespace demo

Powered by Google App Engine
This is Rietveld 408576698