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 3 // found in the LICENSE file. 4 5 #ifndef UI_AURA_TEST_TEST_WINDOWS_H_ 6 #define UI_AURA_TEST_TEST_WINDOWS_H_ 7 8 #include <string> 9 10 #include "base/compiler_specific.h" 11 #include "third_party/skia/include/core/SkColor.h" 12 #include "ui/aura/client/window_types.h" 13 #include "ui/aura/test/aura_test_base.h" 14 #include "ui/aura/test/test_window_delegate.h" 15 16 namespace aura { 17 class Env; 18 19 namespace test { 20 21 // Sets the Env to use for creation of new Windows. If null, Env::GetInstance() 22 // is used. 23 void SetEnvForTestWindows(Env* env); 24 Env* GetEnvForTestWindows(); 25 26 Window* CreateTestWindowWithId(int id, Window* parent); 27 Window* CreateTestWindowWithBounds(const gfx::Rect& bounds, Window* parent); 28 Window* CreateTestWindow(SkColor color, 29 int id, 30 const gfx::Rect& bounds, 31 Window* parent); 32 Window* CreateTestWindowWithDelegate(WindowDelegate* delegate, 33 int id, 34 const gfx::Rect& bounds, 35 Window* parent); 36 Window* CreateTestWindowWithDelegateAndType(WindowDelegate* delegate, 37 client::WindowType type, 38 int id, 39 const gfx::Rect& bounds, 40 Window* parent, 41 bool show_on_creation); 42 43 // Returns true if |upper| is above |lower| in the window stacking order. 44 bool WindowIsAbove(Window* upper, Window* lower); 45 46 // Returns true if |upper|'s layer is above |lower|'s layer in the layer 47 // stacking order. 48 bool LayerIsAbove(Window* upper, Window* lower); 49 50 // Returns a string containing the id of each of the child windows (bottommost 51 // first) of |parent|. The format of the string is "id1 id2 id...". 52 std::string ChildWindowIDsAsString(aura::Window* parent); 53 54 } // namespace test 55 } // namespace aura 56 57 #endif // UI_AURA_TEST_TEST_WINDOWS_H_ 58