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

Unified Diff: ash/root_window_controller_unittest.cc

Issue 2721103002: mash_unittests: Enable RootWindowControllerTest.MoveWindows_Basic. (Closed)
Patch Set: Created 3 years, 10 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 | ash/test/ash_test_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/root_window_controller_unittest.cc
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc
index 074b48e9bc6ca8bf86e7036c34dcb165427e5739..f4af922465e7e7fd3cf7a0a23613c1535823a51a 100644
--- a/ash/root_window_controller_unittest.cc
+++ b/ash/root_window_controller_unittest.cc
@@ -135,10 +135,6 @@ class RootWindowControllerTest : public AshTestBase {
};
TEST_F(RootWindowControllerTest, MoveWindows_Basic) {
- // TODO: triggers shutdown crash in mash. http://crbug.com/695632.
- if (WmShell::Get()->IsRunningInMash())
- return;
-
// Windows origin should be doubled when moved to the 1st display.
UpdateDisplay("600x600,300x300");
aura::Window::Windows root_windows = Shell::GetAllRootWindows();
@@ -191,20 +187,32 @@ TEST_F(RootWindowControllerTest, MoveWindows_Basic) {
EXPECT_EQ(root_windows[1], panel->GetRootWindow());
EXPECT_EQ(kShellWindowId_PanelContainer, panel->parent()->id());
- // Make sure a window that will delete itself when losing focus
- // will not crash.
- aura::WindowTracker tracker;
- DeleteOnBlurDelegate delete_on_blur_delegate;
- aura::Window* d2 = CreateTestWindowInShellWithDelegate(
- &delete_on_blur_delegate, 0, gfx::Rect(50, 50, 100, 100));
- delete_on_blur_delegate.SetWindow(d2);
- aura::client::GetFocusClient(root_windows[0])->FocusWindow(d2);
- tracker.Add(d2);
-
- UpdateDisplay("600x600");
-
- // d2 must have been deleted.
- EXPECT_FALSE(tracker.Contains(d2));
+ if (WmShell::Get()->IsRunningInMash()) {
+ // TODO(erg): Ignore this one part of the test when running mash. We would
+ // crash because the aura::Window |d2| created in the other block doesn't
+ // get deleted, and thus continues to contain a reference to its delegate,
+ // |delete_on_blur_delegate|, which is declared on the stack.
+ //
+ // Making this work requires building out enough of the display management
+ // system; notably the part where updating the display may cause focus
+ // changes. http://crbug.com/695632.
+ UpdateDisplay("600x600");
+ } else {
+ // Make sure a window that will delete itself when losing focus
+ // will not crash.
+ aura::WindowTracker tracker;
+ DeleteOnBlurDelegate delete_on_blur_delegate;
+ aura::Window* d2 = CreateTestWindowInShellWithDelegate(
+ &delete_on_blur_delegate, 0, gfx::Rect(50, 50, 100, 100));
+ delete_on_blur_delegate.SetWindow(d2);
+ aura::client::GetFocusClient(root_windows[0])->FocusWindow(d2);
+ tracker.Add(d2);
+
+ UpdateDisplay("600x600");
+
+ // d2 must have been deleted.
+ EXPECT_FALSE(tracker.Contains(d2));
+ }
EXPECT_EQ(root_windows[0], normal->GetNativeView()->GetRootWindow());
EXPECT_EQ("100,20 100x100", normal->GetWindowBoundsInScreen().ToString());
« no previous file with comments | « no previous file | ash/test/ash_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698