| Index: trunk/src/ui/views/controls/native/native_view_host_aura_unittest.cc
|
| ===================================================================
|
| --- trunk/src/ui/views/controls/native/native_view_host_aura_unittest.cc (revision 203401)
|
| +++ trunk/src/ui/views/controls/native/native_view_host_aura_unittest.cc (working copy)
|
| @@ -10,6 +10,7 @@
|
| #include "ui/views/controls/native/native_view_host.h"
|
| #include "ui/views/test/views_test_base.h"
|
| #include "ui/views/view.h"
|
| +#include "ui/views/view_constants_aura.h"
|
| #include "ui/views/widget/widget.h"
|
|
|
| namespace views {
|
| @@ -23,6 +24,10 @@
|
| return static_cast<NativeViewHostAura*>(host_->native_wrapper_.get());
|
| }
|
|
|
| + NativeViewHost* host() {
|
| + return host_.get();
|
| + }
|
| +
|
| Widget* child() {
|
| return child_.get();
|
| }
|
| @@ -73,4 +78,21 @@
|
| EXPECT_FALSE(child_win->HasObserver(aura_host));
|
| }
|
|
|
| +// Tests that the kHostViewKey is correctly set and cleared.
|
| +TEST_F(NativeViewHostAuraTest, HostViewPropertyKey) {
|
| + // Create the NativeViewHost and attach a NativeView.
|
| + CreateHost();
|
| + aura::Window* child_win = child()->GetNativeView();
|
| + EXPECT_EQ(host(), child_win->GetProperty(views::kHostViewKey));
|
| +
|
| + host()->Detach();
|
| + EXPECT_FALSE(child_win->GetProperty(views::kHostViewKey));
|
| +
|
| + host()->Attach(child_win);
|
| + EXPECT_EQ(host(), child_win->GetProperty(views::kHostViewKey));
|
| +
|
| + DestroyHost();
|
| + EXPECT_FALSE(child_win->GetProperty(views::kHostViewKey));
|
| +}
|
| +
|
| } // namespace views
|
|
|