| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
| 6 #include "ui/views/controls/native/native_view_host.h" | 6 #include "ui/views/controls/native/native_view_host.h" |
| 7 #include "ui/views/test/views_test_base.h" | 7 #include "ui/views/test/views_test_base.h" |
| 8 #include "ui/views/view.h" |
| 8 #include "ui/views/widget/native_widget_private.h" | 9 #include "ui/views/widget/native_widget_private.h" |
| 9 #include "ui/views/widget/native_widget_test_utils.h" | 10 #include "ui/views/widget/native_widget_test_utils.h" |
| 10 #include "ui/views/widget/widget.h" | 11 #include "ui/views/widget/widget.h" |
| 11 #include "views/view.h" | |
| 12 | 12 |
| 13 namespace views { | 13 namespace views { |
| 14 | 14 |
| 15 class ScopedTestWidget { | 15 class ScopedTestWidget { |
| 16 public: | 16 public: |
| 17 ScopedTestWidget(internal::NativeWidgetPrivate* native_widget) | 17 ScopedTestWidget(internal::NativeWidgetPrivate* native_widget) |
| 18 : native_widget_(native_widget) { | 18 : native_widget_(native_widget) { |
| 19 } | 19 } |
| 20 ~ScopedTestWidget() { | 20 ~ScopedTestWidget() { |
| 21 // |CloseNow| deletes both |native_widget_| and its associated | 21 // |CloseNow| deletes both |native_widget_| and its associated |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 internal::NativeWidgetPrivate* child_widget = | 74 internal::NativeWidgetPrivate* child_widget = |
| 75 internal::CreateNativeSubWidget(); | 75 internal::CreateNativeSubWidget(); |
| 76 child_host->Attach(child_widget->GetWidget()->GetNativeView()); | 76 child_host->Attach(child_widget->GetWidget()->GetNativeView()); |
| 77 | 77 |
| 78 EXPECT_EQ(toplevel_widget.get(), | 78 EXPECT_EQ(toplevel_widget.get(), |
| 79 internal::NativeWidgetPrivate::GetTopLevelNativeWidget( | 79 internal::NativeWidgetPrivate::GetTopLevelNativeWidget( |
| 80 child_widget->GetWidget()->GetNativeView())); | 80 child_widget->GetWidget()->GetNativeView())); |
| 81 } | 81 } |
| 82 | 82 |
| 83 } // namespace views | 83 } // namespace views |
| OLD | NEW |