| Index: ui/views/controls/native/native_view_host_aura_unittest.cc
|
| diff --git a/ui/views/controls/native/native_view_host_aura_unittest.cc b/ui/views/controls/native/native_view_host_aura_unittest.cc
|
| index 30999326b66c86481def586954968ed2ade624b7..bd63433b74e0804d63f83b5a5dc57a9b4e84d2e7 100644
|
| --- a/ui/views/controls/native/native_view_host_aura_unittest.cc
|
| +++ b/ui/views/controls/native/native_view_host_aura_unittest.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "base/basictypes.h"
|
| #include "base/memory/scoped_ptr.h"
|
| +#include "ui/aura/client/aura_constants.h"
|
| #include "ui/aura/window.h"
|
| #include "ui/views/controls/native/native_view_host.h"
|
| #include "ui/views/test/views_test_base.h"
|
| @@ -23,6 +24,10 @@ class NativeViewHostAuraTest : public ViewsTestBase {
|
| return static_cast<NativeViewHostAura*>(host_->native_wrapper_.get());
|
| }
|
|
|
| + NativeViewHost* host() {
|
| + return host_.get();
|
| + }
|
| +
|
| Widget* child() {
|
| return child_.get();
|
| }
|
| @@ -73,4 +78,21 @@ TEST_F(NativeViewHostAuraTest, StopObservingNativeViewOnDestruct) {
|
| 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(aura::client::kHostViewKey));
|
| +
|
| + host()->Detach();
|
| + EXPECT_FALSE(child_win->GetProperty(aura::client::kHostViewKey));
|
| +
|
| + host()->Attach(child_win);
|
| + EXPECT_EQ(host(), child_win->GetProperty(aura::client::kHostViewKey));
|
| +
|
| + DestroyHost();
|
| + EXPECT_FALSE(child_win->GetProperty(aura::client::kHostViewKey));
|
| +}
|
| +
|
| } // namespace views
|
|
|