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

Side by Side Diff: ui/aura/test/test_windows.cc

Issue 1484383003: Use WindowTracker when resizing root window as it may delete other window in unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « ash/wm/root_window_layout_manager_unittest.cc ('k') | ui/aura/window_tracker.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/aura/test/test_windows.h" 5 #include "ui/aura/test/test_windows.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "ui/aura/client/aura_constants.h" 8 #include "ui/aura/client/aura_constants.h"
9 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 #include "ui/compositor/layer.h" 10 #include "ui/compositor/layer.h"
(...skipping 28 matching lines...) Expand all
39 39
40 Window* CreateTestWindowWithDelegateAndType(WindowDelegate* delegate, 40 Window* CreateTestWindowWithDelegateAndType(WindowDelegate* delegate,
41 ui::wm::WindowType type, 41 ui::wm::WindowType type,
42 int id, 42 int id,
43 const gfx::Rect& bounds, 43 const gfx::Rect& bounds,
44 Window* parent) { 44 Window* parent) {
45 Window* window = new Window(delegate); 45 Window* window = new Window(delegate);
46 window->set_id(id); 46 window->set_id(id);
47 window->SetType(type); 47 window->SetType(type);
48 window->Init(ui::LAYER_TEXTURED); 48 window->Init(ui::LAYER_TEXTURED);
49 window->SetProperty(aura::client::kCanMaximizeKey, true);
49 window->SetBounds(bounds); 50 window->SetBounds(bounds);
50 window->Show(); 51 window->Show();
51 if (parent) 52 if (parent)
52 parent->AddChild(window); 53 parent->AddChild(window);
53 window->SetProperty(aura::client::kCanMaximizeKey, true);
54 return window; 54 return window;
55 } 55 }
56 56
57 template <typename T> 57 template <typename T>
58 bool ObjectIsAbove(T* upper, T* lower) { 58 bool ObjectIsAbove(T* upper, T* lower) {
59 DCHECK_EQ(upper->parent(), lower->parent()); 59 DCHECK_EQ(upper->parent(), lower->parent());
60 DCHECK_NE(upper, lower); 60 DCHECK_NE(upper, lower);
61 const std::vector<T*>& children = upper->parent()->children(); 61 const std::vector<T*>& children = upper->parent()->children();
62 const size_t upper_i = 62 const size_t upper_i =
63 std::find(children.begin(), children.end(), upper) - children.begin(); 63 std::find(children.begin(), children.end(), upper) - children.begin();
(...skipping 16 matching lines...) Expand all
80 i != parent->children().end(); ++i) { 80 i != parent->children().end(); ++i) {
81 if (!result.empty()) 81 if (!result.empty())
82 result += " "; 82 result += " ";
83 result += base::IntToString((*i)->id()); 83 result += base::IntToString((*i)->id());
84 } 84 }
85 return result; 85 return result;
86 } 86 }
87 87
88 } // namespace test 88 } // namespace test
89 } // namespace aura 89 } // namespace aura
OLDNEW
« no previous file with comments | « ash/wm/root_window_layout_manager_unittest.cc ('k') | ui/aura/window_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698