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

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

Issue 2693823004: aura-mus: Implement DesktopWindowTreeHostMus::SetOpacity(). (Closed)
Patch Set: Removed the comments in WindowPortMus::SetOpacityFromServer 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 unified diff | Download patch
« no previous file with comments | « ui/views/mus/desktop_window_tree_host_mus.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ui/views/mus/desktop_window_tree_host_mus.h" 5 #include "ui/views/mus/desktop_window_tree_host_mus.h"
6 6
7 #include "base/debug/stack_trace.h" 7 #include "base/debug/stack_trace.h"
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "ui/aura/client/cursor_client.h" 10 #include "ui/aura/client/cursor_client.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 std::unique_ptr<Widget> widget2(CreateWidget(nullptr)); 261 std::unique_ptr<Widget> widget2(CreateWidget(nullptr));
262 widget2->Show(); 262 widget2->Show();
263 263
264 aura::test::ChangeCompletionWaiter waiter( 264 aura::test::ChangeCompletionWaiter waiter(
265 MusClient::Get()->window_tree_client(), 265 MusClient::Get()->window_tree_client(),
266 aura::ChangeType::REORDER, true); 266 aura::ChangeType::REORDER, true);
267 widget1->StackAboveWidget(widget2.get()); 267 widget1->StackAboveWidget(widget2.get());
268 waiter.Wait(); 268 waiter.Wait();
269 } 269 }
270 270
271 TEST_F(DesktopWindowTreeHostMusTest, SetOpacity) {
272 std::unique_ptr<Widget> widget1(CreateWidget(nullptr));
273 widget1->Show();
274
275 aura::test::ChangeCompletionWaiter waiter(
276 MusClient::Get()->window_tree_client(), aura::ChangeType::OPACITY, true);
277 widget1->SetOpacity(0.5f);
278 waiter.Wait();
279 }
280
271 TEST_F(DesktopWindowTreeHostMusTest, TransientParentWiredToHostWindow) { 281 TEST_F(DesktopWindowTreeHostMusTest, TransientParentWiredToHostWindow) {
272 std::unique_ptr<Widget> widget1(CreateWidget()); 282 std::unique_ptr<Widget> widget1(CreateWidget());
273 widget1->Show(); 283 widget1->Show();
274 284
275 std::unique_ptr<Widget> widget2( 285 std::unique_ptr<Widget> widget2(
276 CreateWidget(nullptr, widget1->GetNativeView())); 286 CreateWidget(nullptr, widget1->GetNativeView()));
277 widget2->Show(); 287 widget2->Show();
278 288
279 aura::client::TransientWindowClient* transient_window_client = 289 aura::client::TransientWindowClient* transient_window_client =
280 aura::client::GetTransientWindowClient(); 290 aura::client::GetTransientWindowClient();
281 // Even though the widget1->GetNativeView() was specified as the parent we 291 // Even though the widget1->GetNativeView() was specified as the parent we
282 // expect the transient parents to be marked at the host level. 292 // expect the transient parents to be marked at the host level.
283 EXPECT_EQ(widget1->GetNativeView()->GetHost()->window(), 293 EXPECT_EQ(widget1->GetNativeView()->GetHost()->window(),
284 transient_window_client->GetTransientParent( 294 transient_window_client->GetTransientParent(
285 widget2->GetNativeView()->GetHost()->window())); 295 widget2->GetNativeView()->GetHost()->window()));
286 } 296 }
287 297
288 } // namespace views 298 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/mus/desktop_window_tree_host_mus.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698