OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_aura.h" | 5 #include "ui/views/controls/native/native_view_host_aura.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 "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
318 EXPECT_EQ(NativeViewHostWindowObserver::EVENT_HIDDEN, | 318 EXPECT_EQ(NativeViewHostWindowObserver::EVENT_HIDDEN, |
319 test_observer.events()[2].first); | 319 test_observer.events()[2].first); |
320 EXPECT_EQ(child()->GetNativeView(), test_observer.events()[2].second); | 320 EXPECT_EQ(child()->GetNativeView(), test_observer.events()[2].second); |
321 | 321 |
322 clipping_window()->RemoveObserver(&test_observer); | 322 clipping_window()->RemoveObserver(&test_observer); |
323 child()->GetNativeView()->RemoveObserver(&test_observer); | 323 child()->GetNativeView()->RemoveObserver(&test_observer); |
324 | 324 |
325 DestroyHost(); | 325 DestroyHost(); |
326 } | 326 } |
327 | 327 |
328 // Regression test for crbug.com/391316 | |
329 TEST_F(NativeViewHostAuraTest, PositionPopupsInScreenCoordinates) { | |
330 CreateHost(); | |
331 toplevel()->SetBounds(gfx::Rect(20, 20, 100, 100)); | |
332 native_host()->ShowWidget(10, 20, 100, 100); | |
333 native_host()->InstallClip(35, 45, 50, 50); | |
334 | |
335 Widget* popup = new views::Widget; | |
336 Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); | |
337 params.parent = clipping_window(); | |
sky
2014/07/22 13:12:27
parent should be the native view here, right?
Evan Stade
2014/07/22 21:45:30
That won't demonstrate the bug. If I change params
sky
2014/07/22 21:52:33
Isn't the real bug that widget->GetNativeView() en
Evan Stade
2014/07/22 22:33:22
That only happened because of code in RootWindowCo
| |
338 popup->Init(params); | |
339 popup->Show(); | |
340 popup->SetBounds(gfx::Rect(15, 15, 30, 30)); | |
341 | |
342 EXPECT_EQ(gfx::Rect(15, 15, 30, 30), | |
343 popup->GetRootView()->GetBoundsInScreen()); | |
344 | |
345 DestroyHost(); | |
346 } | |
347 | |
328 } // namespace views | 348 } // namespace views |
OLD | NEW |