// Copyright 2014 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ui/views/view.h" #include <memory> #include "ui/aura/window.h" #include "ui/compositor/layer.h" #include "ui/compositor/layer_tree_owner.h" #include "ui/compositor/test/test_layers.h" #include "ui/gfx/geometry/rect.h" #include "ui/views/test/views_test_base.h" #include "ui/views/view_constants_aura.h" #include "ui/views/widget/widget.h" #include "ui/wm/core/window_util.h" namespace views { namespace { // Creates a widget of TYPE_CONTROL. // The caller takes ownership of the returned widget. std::unique_ptr<Widget> CreateControlWidget(aura::Window* parent, const gfx::Rect& bounds) { … } // Returns a view with a layer with the passed in |bounds| and |layer_name|. // The caller takes ownership of the returned view. std::unique_ptr<View> CreateViewWithLayer(const gfx::Rect& bounds, const char* layer_name) { … } } // namespace class ViewAuraTest : public ViewsTestBase { … }; // Test that wm::RecreateLayers() recreates the layers for all child windows and // all child views and that the z-order of the recreated layers matches that of // the original layers. // Test hierarchy: // w1 // +-- v1 // +-- v2 (no layer) // +-- v3 (no layer) // +-- v4 // +-- w2 // +-- v5 // +-- v6 // +-- v7 // +-- v8 // +-- v9 TEST_F(ViewAuraTest, RecreateLayersWithWindows) { … } } // namespace views