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

Side by Side Diff: services/ui/ws/window_manager_client_unittest.cc

Issue 2387013003: Adds OnChildWindowVisibilityChanged to ui::WindowObserver (Closed)
Patch Set: fix test Created 4 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 537
538 class VisibilityChangeObserver : public WindowObserver { 538 class VisibilityChangeObserver : public WindowObserver {
539 public: 539 public:
540 explicit VisibilityChangeObserver(Window* window) : window_(window) { 540 explicit VisibilityChangeObserver(Window* window) : window_(window) {
541 window_->AddObserver(this); 541 window_->AddObserver(this);
542 } 542 }
543 ~VisibilityChangeObserver() override { window_->RemoveObserver(this); } 543 ~VisibilityChangeObserver() override { window_->RemoveObserver(this); }
544 544
545 private: 545 private:
546 // Overridden from WindowObserver: 546 // Overridden from WindowObserver:
547 void OnWindowVisibilityChanged(Window* window) override { 547 void OnWindowVisibilityChanged(Window* window, bool visible) override {
548 EXPECT_EQ(window, window_); 548 EXPECT_EQ(window, window_);
549 EXPECT_TRUE(WindowServerTestBase::QuitRunLoop()); 549 EXPECT_TRUE(WindowServerTestBase::QuitRunLoop());
550 } 550 }
551 551
552 Window* window_; 552 Window* window_;
553 553
554 DISALLOW_COPY_AND_ASSIGN(VisibilityChangeObserver); 554 DISALLOW_COPY_AND_ASSIGN(VisibilityChangeObserver);
555 }; 555 };
556 556
557 } // namespace 557 } // namespace
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
1130 ASSERT_TRUE(window_in_wm); 1130 ASSERT_TRUE(window_in_wm);
1131 1131
1132 // Change the bounds in the wm, and make sure the child sees it. 1132 // Change the bounds in the wm, and make sure the child sees it.
1133 window_in_wm->SetBounds(gfx::Rect(1, 11, 12, 101)); 1133 window_in_wm->SetBounds(gfx::Rect(1, 11, 12, 101));
1134 ASSERT_TRUE(WaitForBoundsToChange(window_in_second_client)); 1134 ASSERT_TRUE(WaitForBoundsToChange(window_in_second_client));
1135 EXPECT_EQ(gfx::Rect(1, 11, 12, 101), window_in_second_client->bounds()); 1135 EXPECT_EQ(gfx::Rect(1, 11, 12, 101), window_in_second_client->bounds());
1136 } 1136 }
1137 1137
1138 } // namespace ws 1138 } // namespace ws
1139 } // namespace ui 1139 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698