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

Unified Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc

Issue 652613003: Fix DesktopWindowTreeHostX11Test.Shape on Unity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc
index 2e1f5dbf3a1b1de25e7fec7b39d132371d205423..eac324b69b19e15c0ff05b4da845251f76ff1986 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc
@@ -12,6 +12,7 @@
#undef None
#include "base/memory/scoped_ptr.h"
+#include "base/run_loop.h"
#include "ui/aura/window.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/hit_test.h"
@@ -189,6 +190,12 @@ bool ShapeRectContainsPoint(const std::vector<gfx::Rect>& shape_rects,
return false;
}
+// Flush the message loop.
+void RunAllPendingInMessageLoop() {
+ base::RunLoop run_loop;
+ run_loop.RunUntilIdle();
+}
+
} // namespace
class DesktopWindowTreeHostX11Test : public ViewsTestBase {
@@ -263,6 +270,9 @@ TEST_F(DesktopWindowTreeHostX11Test, Shape) {
waiter.Wait();
}
+ // Ensure that the task which is posted when a window is resized is run.
+ RunAllPendingInMessageLoop();
+
// xvfb does not support Xrandr so we cannot check the maximized window's
// bounds.
gfx::Rect maximized_bounds;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698