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

Side by Side Diff: ui/views/mus/drag_interactive_uitest.cc

Issue 2778823002: Simplify WindowManager::OnWmSetBounds (Closed)
Patch Set: Update expectations for DragTestInteractive.DragTest Created 3 years, 8 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
« no previous file with comments | « ui/aura/test/aura_test_base.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "base/strings/utf_string_conversions.h" 5 #include "base/strings/utf_string_conversions.h"
6 #include "services/ui/public/interfaces/window_server_test.mojom.h" 6 #include "services/ui/public/interfaces/window_server_test.mojom.h"
7 #include "services/ui/public/interfaces/window_tree_constants.mojom.h" 7 #include "services/ui/public/interfaces/window_tree_constants.mojom.h"
8 #include "ui/aura/mus/in_flight_change.h" 8 #include "ui/aura/mus/in_flight_change.h"
9 #include "ui/aura/mus/window_tree_host_mus.h" 9 #include "ui/aura/mus/window_tree_host_mus.h"
10 #include "ui/aura/test/mus/change_completion_waiter.h" 10 #include "ui/aura/test/mus/change_completion_waiter.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 base::Bind(&DragTest_Part2, display_id, quit_closure)); 144 base::Bind(&DragTest_Part2, display_id, quit_closure));
145 } 145 }
146 146
147 TEST_F(DragTestInteractive, DragTest) { 147 TEST_F(DragTestInteractive, DragTest) {
148 Widget* source_widget = CreateTopLevelFramelessPlatformWidget(); 148 Widget* source_widget = CreateTopLevelFramelessPlatformWidget();
149 View* source_view = new DraggableView; 149 View* source_view = new DraggableView;
150 source_widget->SetContentsView(source_view); 150 source_widget->SetContentsView(source_view);
151 source_widget->Show(); 151 source_widget->Show();
152 152
153 aura::test::ChangeCompletionWaiter source_waiter( 153 aura::test::ChangeCompletionWaiter source_waiter(
154 MusClient::Get()->window_tree_client(), aura::ChangeType::BOUNDS, true); 154 MusClient::Get()->window_tree_client(), aura::ChangeType::BOUNDS, false);
155 source_widget->SetBounds(gfx::Rect(0, 0, 20, 20)); 155 source_widget->SetBounds(gfx::Rect(0, 0, 20, 20));
156 source_waiter.Wait(); 156 source_waiter.Wait();
157 157
158 Widget* target_widget = CreateTopLevelFramelessPlatformWidget(); 158 Widget* target_widget = CreateTopLevelFramelessPlatformWidget();
159 TargetView* target_view = new TargetView; 159 TargetView* target_view = new TargetView;
160 target_widget->SetContentsView(target_view); 160 target_widget->SetContentsView(target_view);
161 target_widget->Show(); 161 target_widget->Show();
162 162
163 aura::test::ChangeCompletionWaiter target_waiter( 163 aura::test::ChangeCompletionWaiter target_waiter(
164 MusClient::Get()->window_tree_client(), aura::ChangeType::BOUNDS, true); 164 MusClient::Get()->window_tree_client(), aura::ChangeType::BOUNDS, false);
165 target_widget->SetBounds(gfx::Rect(20, 20, 20, 20)); 165 target_widget->SetBounds(gfx::Rect(20, 20, 20, 20));
166 target_waiter.Wait(); 166 target_waiter.Wait();
167 167
168 auto* dnwa = 168 auto* dnwa =
169 static_cast<DesktopNativeWidgetAura*>(source_widget->native_widget()); 169 static_cast<DesktopNativeWidgetAura*>(source_widget->native_widget());
170 ASSERT_TRUE(dnwa); 170 ASSERT_TRUE(dnwa);
171 auto* wth = static_cast<aura::WindowTreeHostMus*>(dnwa->host()); 171 auto* wth = static_cast<aura::WindowTreeHostMus*>(dnwa->host());
172 ASSERT_TRUE(wth); 172 ASSERT_TRUE(wth);
173 int64_t display_id = wth->display_id(); 173 int64_t display_id = wth->display_id();
174 174
(...skipping 17 matching lines...) Expand all
192 192
193 EXPECT_TRUE(target_view->dropped()); 193 EXPECT_TRUE(target_view->dropped());
194 194
195 target_widget->Close(); 195 target_widget->Close();
196 source_widget->Close(); 196 source_widget->Close();
197 RunPendingMessages(); 197 RunPendingMessages();
198 } 198 }
199 199
200 } // namespace test 200 } // namespace test
201 } // namespace views 201 } // namespace views
OLDNEW
« no previous file with comments | « ui/aura/test/aura_test_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698