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

Side by Side Diff: views/widget/widget_unittest.cc

Issue 7996008: Get views and views_unittests to build w/ use_aura=1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed review issue Created 9 years, 3 months 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
« no previous file with comments | « views/views.gyp ('k') | views/window/dialog_client_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "views/widget/native_widget_views.h" 5 #include "views/widget/native_widget_views.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 return static_cast<const internal::NativeWidgetPrivate*>(widget-> 150 return static_cast<const internal::NativeWidgetPrivate*>(widget->
151 native_widget())-> HasMouseCapture(); 151 native_widget())-> HasMouseCapture();
152 } 152 }
153 153
154 //////////////////////////////////////////////////////////////////////////////// 154 ////////////////////////////////////////////////////////////////////////////////
155 // Widget::GetTopLevelWidget tests. 155 // Widget::GetTopLevelWidget tests.
156 156
157 TEST_F(WidgetTest, GetTopLevelWidget_Native) { 157 TEST_F(WidgetTest, GetTopLevelWidget_Native) {
158 // Create a hierarchy of native widgets. 158 // Create a hierarchy of native widgets.
159 Widget* toplevel = CreateTopLevelPlatformWidget(); 159 Widget* toplevel = CreateTopLevelPlatformWidget();
160 #if defined(OS_WIN) 160 #if defined(TOOLKIT_USES_GTK)
161 gfx::NativeView parent = toplevel->GetNativeView();
162 #elif defined(TOOLKIT_USES_GTK)
163 NativeWidgetGtk* native_widget = 161 NativeWidgetGtk* native_widget =
164 static_cast<NativeWidgetGtk*>(toplevel->native_widget()); 162 static_cast<NativeWidgetGtk*>(toplevel->native_widget());
165 gfx::NativeView parent = native_widget->window_contents(); 163 gfx::NativeView parent = native_widget->window_contents();
164 #else
165 gfx::NativeView parent = toplevel->GetNativeView();
166 #endif 166 #endif
167 Widget* child = CreateChildPlatformWidget(parent); 167 Widget* child = CreateChildPlatformWidget(parent);
168 168
169 EXPECT_EQ(toplevel, toplevel->GetTopLevelWidget()); 169 EXPECT_EQ(toplevel, toplevel->GetTopLevelWidget());
170 EXPECT_EQ(toplevel, child->GetTopLevelWidget()); 170 EXPECT_EQ(toplevel, child->GetTopLevelWidget());
171 171
172 toplevel->CloseNow(); 172 toplevel->CloseNow();
173 // |child| should be automatically destroyed with |toplevel|. 173 // |child| should be automatically destroyed with |toplevel|.
174 } 174 }
175 175
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 708
709 child1->Show(); 709 child1->Show();
710 EXPECT_EQ(child1, widget_shown()); 710 EXPECT_EQ(child1, widget_shown());
711 711
712 child2->Show(); 712 child2->Show();
713 EXPECT_EQ(child2, widget_shown()); 713 EXPECT_EQ(child2, widget_shown());
714 } 714 }
715 715
716 } // namespace 716 } // namespace
717 } // namespace views 717 } // namespace views
OLDNEW
« no previous file with comments | « views/views.gyp ('k') | views/window/dialog_client_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698