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

Side by Side Diff: ui/ozone/platform/wayland/wayland_window_unittest.cc

Issue 1739193004: ozone/platform/wayland: Use more realistic event processing and request flushing in tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wayland-test2
Patch Set: Use watching_ instead of base::MessageLoopForUI::IsCurrent() Created 4 years, 9 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/ozone/platform/wayland/wayland_window.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 <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
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
OLDNEW
« no previous file with comments | « ui/ozone/platform/wayland/wayland_window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698