Index: ui/aura/mus/window_tree_client.cc |
diff --git a/ui/aura/mus/window_tree_client.cc b/ui/aura/mus/window_tree_client.cc |
index 6f6c35090eac6685e39216ac8f3fa86a5eb27309..10a25a3a5f241c711602d5fb4d7c58674d261782 100644 |
--- a/ui/aura/mus/window_tree_client.cc |
+++ b/ui/aura/mus/window_tree_client.cc |
@@ -264,6 +264,9 @@ void WindowTreeClient::Embed( |
uint32_t flags, |
const ui::mojom::WindowTree::EmbedCallback& callback) { |
DCHECK(tree_); |
+ // Window::Init() must be called before Embed() (otherwise the server hasn't |
+ // been told about the window). |
+ DCHECK(window->layer()); |
if (!window->children().empty()) { |
// The window server removes all children before embedding. In other words, |
// it's generally an error to Embed() with existing children. So, fail |