| Index: ui/android/view_android_unittests.cc
|
| diff --git a/ui/android/view_android_unittests.cc b/ui/android/view_android_unittests.cc
|
| index 77c9bcae16534428660684bb80c2c99af788a641..e21c2918f1f5f48cc1162d32048c2e712652582c 100644
|
| --- a/ui/android/view_android_unittests.cc
|
| +++ b/ui/android/view_android_unittests.cc
|
| @@ -6,6 +6,7 @@
|
| #include "ui/android/event_forwarder.h"
|
| #include "ui/android/view_android.h"
|
| #include "ui/android/view_client.h"
|
| +#include "ui/android/window_android.h"
|
| #include "ui/events/android/motion_event_android.h"
|
|
|
| namespace ui {
|
| @@ -166,4 +167,18 @@ TEST_F(ViewAndroidBoundsTest, MatchesViewsWithOffset) {
|
| ExpectHit(client3_);
|
| }
|
|
|
| +TEST(ViewAndroidTest, AddChildChecksMultipleEventForwarders) {
|
| + ViewAndroid view1;
|
| + ViewAndroid view2;
|
| + view1.GetEventForwarder();
|
| + view2.GetEventForwarder();
|
| + EXPECT_DEATH(view1.AddChild(&view2), "Check failed:");
|
| +
|
| + WindowAndroid* window = WindowAndroid::CreateForTesting();
|
| + view2.RemoveFromParent();
|
| + window->AddChild(&view1);
|
| + window->AddChild(&view2);
|
| + window->Destroy(nullptr, nullptr);
|
| +}
|
| +
|
| } // namespace ui
|
|
|