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

Side by Side Diff: components/mus/public/cpp/tests/window_tree_client_unittest.cc

Issue 2029743002: Check WindowTreeClient for empty inflight queue upon teardown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More tests Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/mus/public/cpp/window_tree_client.h" 5 #include "components/mus/public/cpp/window_tree_client.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 1030
1031 transient_parent->AddTransientWindow(transient_child); 1031 transient_parent->AddTransientWindow(transient_child);
1032 1032
1033 WindowTracker tracker; 1033 WindowTracker tracker;
1034 tracker.Add(transient_parent); 1034 tracker.Add(transient_parent);
1035 tracker.Add(transient_child); 1035 tracker.Add(transient_child);
1036 // Request a capture on the transient child, then destroy the transient 1036 // Request a capture on the transient child, then destroy the transient
1037 // parent. That will destroy both windows, and should reset the capture window 1037 // parent. That will destroy both windows, and should reset the capture window
1038 // correctly. 1038 // correctly.
1039 transient_child->SetCapture(); 1039 transient_child->SetCapture();
1040 uint32_t change_id1;
1041 ASSERT_TRUE(setup.window_tree()->GetAndClearChangeId(&change_id1));
1042 setup.window_tree_client()->OnChangeCompleted(change_id1, true);
sadrul 2016/06/15 06:42:46 I think this adds burden to individual tests that
jonross 2016/06/15 14:03:07 An alternate modification I considered was changin
1040 transient_parent->Destroy(); 1043 transient_parent->Destroy();
1041 EXPECT_TRUE(tracker.windows().empty()); 1044 EXPECT_TRUE(tracker.windows().empty());
1042 1045
1043 // Create a new Window, and attempt to place capture on that. 1046 // Create a new Window, and attempt to place capture on that.
1044 Window* child = setup.client()->NewWindow(); 1047 Window* child = setup.client()->NewWindow();
1045 child->SetVisible(true); 1048 child->SetVisible(true);
1046 root->AddChild(child); 1049 root->AddChild(child);
1047 child->SetCapture(); 1050 child->SetCapture();
1051 uint32_t change_id2;
1052 ASSERT_TRUE(setup.window_tree()->GetAndClearChangeId(&change_id2));
1053 setup.window_tree_client()->OnChangeCompleted(change_id2, true);
1048 EXPECT_TRUE(child->HasCapture()); 1054 EXPECT_TRUE(child->HasCapture());
1049 } 1055 }
1050 1056
1051 } // namespace mus 1057 } // namespace mus
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698