// Copyright 2012 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/controls/native/native_view_host.h" #include <memory> #include "ui/aura/window.h" #include "ui/base/metadata/metadata_header_macros.h" #include "ui/base/metadata/metadata_impl_macros.h" #include "ui/views/controls/native/native_view_host_test_base.h" #include "ui/views/test/views_test_base.h" #include "ui/views/widget/widget.h" namespace views { class NativeViewHostTest : public test::NativeViewHostTestBase { … }; namespace { // View implementation used by NativeViewHierarchyChanged to count number of // times NativeViewHierarchyChanged() is invoked. class NativeViewHierarchyChangedTestView : public View { … }; BEGIN_METADATA(…) aura::Window* GetNativeParent(aura::Window* window) { … } class ViewHierarchyChangedTestHost : public NativeViewHost { … }; BEGIN_METADATA(…) } // namespace // Verifies NativeViewHierarchyChanged is sent. TEST_F(NativeViewHostTest, NativeViewHierarchyChanged) { … } // Verifies ViewHierarchyChanged handles NativeViewHost remove, add and move // (reparent) operations with correct parent changes. // This exercises the non-recursive code paths in // View::PropagateRemoveNotifications() and View::PropagateAddNotifications(). TEST_F(NativeViewHostTest, ViewHierarchyChangedForHost) { … } // Verifies ViewHierarchyChanged handles NativeViewHost's parent remove, add and // move (reparent) operations with correct parent changes. // This exercises the recursive code paths in // View::PropagateRemoveNotifications() and View::PropagateAddNotifications(). TEST_F(NativeViewHostTest, ViewHierarchyChangedForHostParent) { … } } // namespace views