Chromium Code Reviews| Index: services/ui/public/cpp/tests/window_unittest.cc |
| diff --git a/services/ui/public/cpp/tests/window_unittest.cc b/services/ui/public/cpp/tests/window_unittest.cc |
| index 59b73726827450a8cbb9d606ccfbec926c951fde..0eda0b6f3f768c412d3398a4d5db4fde16bdd7b1 100644 |
| --- a/services/ui/public/cpp/tests/window_unittest.cc |
| +++ b/services/ui/public/cpp/tests/window_unittest.cc |
| @@ -679,15 +679,20 @@ class VisibilityChangeObserver : public WindowObserver { |
| private: |
| // Overridden from WindowObserver: |
| - void OnWindowVisibilityChanging(Window* window) override { |
| - changes_.push_back(base::StringPrintf( |
| - "window=%d phase=changing wisibility=%s", window->local_id(), |
| - window->visible() ? "true" : "false")); |
| + void OnWindowVisibilityChanging(Window* window, bool visible) override { |
| + changes_.push_back( |
| + base::StringPrintf("window=%d phase=changing visibility=%s", |
| + window->local_id(), visible ? "true" : "false")); |
| } |
| - void OnWindowVisibilityChanged(Window* window) override { |
| - changes_.push_back(base::StringPrintf( |
| - "window=%d phase=changed wisibility=%s", window->local_id(), |
| - window->visible() ? "true" : "false")); |
| + void OnChildWindowVisibilityChanged(Window* window, bool visible) override { |
| + changes_.push_back( |
| + base::StringPrintf("window=%d phase=child-changed visibility=%s", |
| + window->local_id(), visible ? "true" : "false")); |
| + } |
| + void OnWindowVisibilityChanged(Window* window, bool visible) override { |
| + changes_.push_back( |
| + base::StringPrintf("window=%d phase=changed visibility=%s", |
| + window->local_id(), visible ? "true" : "false")); |
| } |
| Window* window_; |
| @@ -705,14 +710,14 @@ TEST_F(WindowObserverTest, SetVisible) { |
| w1.SetVisible(true); |
| EXPECT_TRUE(w1.visible()); |
| { |
| - // Change wisibility from true to false and make sure we get notifications. |
| + // Change visibility from true to false and make sure we get notifications. |
|
James Cook
2016/10/03 20:33:08
Thanks for fixing the wisibility.
|
| VisibilityChangeObserver observer(&w1); |
| w1.SetVisible(false); |
| Changes changes = observer.GetAndClearChanges(); |
| ASSERT_EQ(2U, changes.size()); |
| - EXPECT_EQ("window=1 phase=changing wisibility=true", changes[0]); |
| - EXPECT_EQ("window=1 phase=changed wisibility=false", changes[1]); |
| + EXPECT_EQ("window=1 phase=changing visibility=false", changes[0]); |
| + EXPECT_EQ("window=1 phase=changed visibility=false", changes[1]); |
| } |
| { |
| // Set visible to existing walue and werify no notifications. |
|
James Cook
2016/10/03 20:33:08
optional: walue and werify
sky
2016/10/03 20:52:13
Done.
|
| @@ -733,14 +738,15 @@ TEST_F(WindowObserverTest, SetVisibleParent) { |
| EXPECT_TRUE(parent.visible()); |
| EXPECT_TRUE(child.visible()); |
| { |
| - // Change wisibility from true to false and make sure we get notifications |
| + // Change visibility from true to false and make sure we get notifications |
| // on the parent. |
| VisibilityChangeObserver observer(&parent); |
| child.SetVisible(false); |
| Changes changes = observer.GetAndClearChanges(); |
| - ASSERT_EQ(1U, changes.size()); |
| - EXPECT_EQ("window=2 phase=changed wisibility=false", changes[0]); |
| + ASSERT_EQ(2U, changes.size()); |
| + EXPECT_EQ("window=2 phase=child-changed visibility=false", changes[0]); |
| + EXPECT_EQ("window=2 phase=changed visibility=false", changes[1]); |
| } |
| } |
| @@ -755,14 +761,14 @@ TEST_F(WindowObserverTest, SetVisibleChild) { |
| EXPECT_TRUE(parent.visible()); |
| EXPECT_TRUE(child.visible()); |
| { |
| - // Change wisibility from true to false and make sure we get notifications |
| + // Change visibility from true to false and make sure we get notifications |
| // on the child. |
| VisibilityChangeObserver observer(&child); |
| parent.SetVisible(false); |
| Changes changes = observer.GetAndClearChanges(); |
| ASSERT_EQ(1U, changes.size()); |
| - EXPECT_EQ("window=1 phase=changed wisibility=false", changes[0]); |
| + EXPECT_EQ("window=1 phase=changed visibility=false", changes[0]); |
| } |
| } |