| OLD | NEW |
| 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 <wayland-server-core.h> | 5 #include <wayland-server-core.h> |
| 6 #include <xdg-shell-unstable-v5-server-protocol.h> | 6 #include <xdg-shell-unstable-v5-server-protocol.h> |
| 7 | 7 |
| 8 #include "base/run_loop.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 9 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "ui/ozone/platform/wayland/fake_server.h" | 12 #include "ui/ozone/platform/wayland/fake_server.h" |
| 12 #include "ui/ozone/platform/wayland/mock_platform_window_delegate.h" | 13 #include "ui/ozone/platform/wayland/mock_platform_window_delegate.h" |
| 13 #include "ui/ozone/platform/wayland/wayland_test.h" | 14 #include "ui/ozone/platform/wayland/wayland_test.h" |
| 14 #include "ui/ozone/platform/wayland/wayland_window.h" | 15 #include "ui/ozone/platform/wayland/wayland_window.h" |
| 15 | 16 |
| 16 using ::testing::Eq; | 17 using ::testing::Eq; |
| 17 using ::testing::Mock; | 18 using ::testing::Mock; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 61 } |
| 61 | 62 |
| 62 TEST_F(WaylandWindowTest, ConfigureEvent) { | 63 TEST_F(WaylandWindowTest, ConfigureEvent) { |
| 63 wl_array states; | 64 wl_array states; |
| 64 wl_array_init(&states); | 65 wl_array_init(&states); |
| 65 xdg_surface_send_configure(xdg_surface->resource(), 1000, 1000, &states, 12); | 66 xdg_surface_send_configure(xdg_surface->resource(), 1000, 1000, &states, 12); |
| 66 xdg_surface_send_configure(xdg_surface->resource(), 1500, 1000, &states, 13); | 67 xdg_surface_send_configure(xdg_surface->resource(), 1500, 1000, &states, 13); |
| 67 | 68 |
| 68 // Make sure that the implementation does not call OnBoundsChanged for each | 69 // Make sure that the implementation does not call OnBoundsChanged for each |
| 69 // configure event if it receives multiple in a row. | 70 // configure event if it receives multiple in a row. |
| 70 EXPECT_CALL(delegate, OnBoundsChanged(_)).Times(0); | |
| 71 Sync(); | |
| 72 Mock::VerifyAndClearExpectations(&delegate); | |
| 73 | |
| 74 EXPECT_CALL(delegate, OnBoundsChanged(Eq(gfx::Rect(0, 0, 1500, 1000)))); | 71 EXPECT_CALL(delegate, OnBoundsChanged(Eq(gfx::Rect(0, 0, 1500, 1000)))); |
| 75 EXPECT_CALL(*xdg_surface, AckConfigure(13)); | 72 EXPECT_CALL(*xdg_surface, AckConfigure(13)); |
| 76 window.ApplyPendingBounds(); | |
| 77 } | 73 } |
| 78 | 74 |
| 79 } // namespace ui | 75 } // namespace ui |
| OLD | NEW |