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

Side by Side Diff: ui/views/controls/native/native_view_host_unittest.cc

Issue 11416251: Desktop aura: Continue threading context through views. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix erroneously removed line from NWWin tests. Created 8 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 | Annotate | Revision Log
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/views/controls/native/native_view_host.h" 5 #include "ui/views/controls/native/native_view_host.h"
6 6
7 #if defined(OS_WIN) && !defined(USE_AURA) 7 #if defined(OS_WIN) && !defined(USE_AURA)
8 #include <windows.h> 8 #include <windows.h>
9 #endif 9 #endif
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 71 }
72 72
73 #endif 73 #endif
74 74
75 } // namespace 75 } // namespace
76 76
77 // Verifies NativeViewHierarchyChanged is sent. 77 // Verifies NativeViewHierarchyChanged is sent.
78 TEST_F(NativeViewHostTest, NativeViewHierarchyChanged) { 78 TEST_F(NativeViewHostTest, NativeViewHierarchyChanged) {
79 // Create the top level widget. 79 // Create the top level widget.
80 scoped_ptr<Widget> toplevel(new Widget); 80 scoped_ptr<Widget> toplevel(new Widget);
81 Widget::InitParams toplevel_params(Widget::InitParams::TYPE_WINDOW); 81 Widget::InitParams toplevel_params =
82 toplevel_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 82 CreateParams(Widget::InitParams::TYPE_POPUP);
83 toplevel->Init(toplevel_params); 83 toplevel->Init(toplevel_params);
84 toplevel->SetContentsView(new View); 84 toplevel->SetContentsView(new View);
85 85
86 // And the child widget. 86 // And the child widget.
87 NativeViewHierarchyChangedTestView* test_view = 87 NativeViewHierarchyChangedTestView* test_view =
88 new NativeViewHierarchyChangedTestView; 88 new NativeViewHierarchyChangedTestView;
89 scoped_ptr<Widget> child(new Widget); 89 scoped_ptr<Widget> child(new Widget);
90 Widget::InitParams child_params(Widget::InitParams::TYPE_CONTROL); 90 Widget::InitParams child_params(Widget::InitParams::TYPE_CONTROL);
91 child_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 91 child_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
92 child_params.parent_widget = toplevel.get(); 92 child_params.parent_widget = toplevel.get();
(...skipping 19 matching lines...) Expand all
112 112
113 // Attaching should send both an attach and detach and reset parent. 113 // Attaching should send both an attach and detach and reset parent.
114 host->Attach(child->GetNativeView()); 114 host->Attach(child->GetNativeView());
115 EXPECT_EQ(1, test_view->attached_count()); 115 EXPECT_EQ(1, test_view->attached_count());
116 EXPECT_EQ(1, test_view->detached_count()); 116 EXPECT_EQ(1, test_view->detached_count());
117 EXPECT_EQ(toplevel->GetNativeView(), 117 EXPECT_EQ(toplevel->GetNativeView(),
118 GetNativeParent(child->GetNativeView())); 118 GetNativeParent(child->GetNativeView()));
119 } 119 }
120 120
121 } // namespace views 121 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/combobox/native_combobox_views_unittest.cc ('k') | ui/views/controls/scrollbar/scrollbar_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698