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

Unified Diff: ui/views/controls/native/native_view_host_unittest.cc

Issue 399343003: Make WebContents get the correct screen coordinates when initially added. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: set kHostViewKey earlier Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/native/native_view_host_aura.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/native/native_view_host_unittest.cc
diff --git a/ui/views/controls/native/native_view_host_unittest.cc b/ui/views/controls/native/native_view_host_unittest.cc
index 400f6db3c19fccaef736c881003f457653ece26b..e77fd358bf5827b987f1649eb50e93d9143ffd80 100644
--- a/ui/views/controls/native/native_view_host_unittest.cc
+++ b/ui/views/controls/native/native_view_host_unittest.cc
@@ -135,9 +135,10 @@ TEST_F(NativeViewHostTest, NativeViewHierarchyChanged) {
test_view,
host));
#if defined(USE_AURA)
- // One notification is generated from inserting the native view into the
- // clipping window.
- EXPECT_EQ(1, test_view->notification_count());
+ // Two notifications are generated from inserting the native view into the
+ // clipping window and then inserting the clipping window into the root
+ // window.
+ EXPECT_EQ(2, test_view->notification_count());
#else
EXPECT_EQ(0, test_view->notification_count());
#endif
@@ -160,13 +161,14 @@ TEST_F(NativeViewHostTest, NativeViewHierarchyChanged) {
// Attaching should send a NativeViewHierarchyChanged() notification and
// reset the parent.
host->Attach(child->GetNativeView());
- EXPECT_EQ(1, test_view->notification_count());
#if defined(USE_AURA)
// There is a clipping window inserted above the native view that needs to be
// accounted for when looking at the relationship between the native views.
+ EXPECT_EQ(2, test_view->notification_count());
EXPECT_EQ(toplevel()->GetNativeView(),
GetNativeParent(GetNativeParent(child->GetNativeView())));
#else
+ EXPECT_EQ(1, test_view->notification_count());
EXPECT_EQ(toplevel()->GetNativeView(),
GetNativeParent(child->GetNativeView()));
#endif
« no previous file with comments | « ui/views/controls/native/native_view_host_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698