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

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

Issue 30993004: Reland: Implement features in NativeViewHostAura for scroll end effect (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing compile failure on the bots Created 7 years, 2 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
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 f30980bca8bad31eb9c4e2b9a46d89f7ae317892..84d6036e6df6b81279705b9e14e6f96417a8953c 100644
--- a/ui/views/controls/native/native_view_host_unittest.cc
+++ b/ui/views/controls/native/native_view_host_unittest.cc
@@ -148,7 +148,13 @@ TEST_F(NativeViewHostTest, NativeViewHierarchyChanged) {
test_view,
host));
+#if defined(USE_AURA)
+ // One notification is generated from inserting the clipping window into the
+ // hierarchy.
+ EXPECT_EQ(1, test_view->notification_count());
+#else
EXPECT_EQ(0, test_view->notification_count());
+#endif
test_view->ResetCount();
// Detaching should send a NativeViewHierarchyChanged() notification and
@@ -163,8 +169,15 @@ TEST_F(NativeViewHostTest, NativeViewHierarchyChanged) {
// 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(toplevel()->GetNativeView(),
+ GetNativeParent(GetNativeParent(child->GetNativeView())));
+#else
EXPECT_EQ(toplevel()->GetNativeView(),
GetNativeParent(child->GetNativeView()));
+#endif
}
// Verifies ViewHierarchyChanged handles NativeViewHost remove, add and move
« no previous file with comments | « ui/views/controls/native/native_view_host_aura_unittest.cc ('k') | ui/views/controls/native/native_view_host_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698