| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "content/browser/renderer_host/test_render_view_host.h" | 9 #include "content/browser/renderer_host/test_render_view_host.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "ui/aura/client/aura_constants.h" | 11 #include "ui/aura/client/aura_constants.h" |
| 12 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
| 13 #include "ui/base/ui_base_types.h" | 13 #include "ui/base/ui_base_types.h" |
| 14 | 14 |
| 15 using content::RenderWidgetHostView; |
| 16 |
| 15 // This approach (of using RenderViewHostTestHarness's RenderViewHost for a new | 17 // This approach (of using RenderViewHostTestHarness's RenderViewHost for a new |
| 16 // RenderWidgetHostView) is borrowed from RenderWidgetHostViewMacTest. | 18 // RenderWidgetHostView) is borrowed from RenderWidgetHostViewMacTest. |
| 17 class RenderWidgetHostViewAuraTest : public RenderViewHostTestHarness { | 19 class RenderWidgetHostViewAuraTest : public RenderViewHostTestHarness { |
| 18 public: | 20 public: |
| 19 RenderWidgetHostViewAuraTest() : old_rwhv_(NULL) {} | 21 RenderWidgetHostViewAuraTest() : old_rwhv_(NULL) {} |
| 20 | 22 |
| 21 virtual void SetUp() { | 23 virtual void SetUp() { |
| 22 RenderViewHostTestHarness::SetUp(); | 24 RenderViewHostTestHarness::SetUp(); |
| 23 old_rwhv_ = rvh()->view(); | 25 old_rwhv_ = rvh()->view(); |
| 24 rwhv_aura_.reset(static_cast<RenderWidgetHostViewAura*>( | 26 rwhv_aura_.reset(static_cast<RenderWidgetHostViewAura*>( |
| (...skipping 29 matching lines...) Expand all Loading... |
| 54 EXPECT_EQ(ui::SHOW_STATE_FULLSCREEN, | 56 EXPECT_EQ(ui::SHOW_STATE_FULLSCREEN, |
| 55 window->GetProperty(aura::client::kShowStateKey)); | 57 window->GetProperty(aura::client::kShowStateKey)); |
| 56 | 58 |
| 57 // Check that we requested and received the focus. | 59 // Check that we requested and received the focus. |
| 58 EXPECT_TRUE(window->HasFocus()); | 60 EXPECT_TRUE(window->HasFocus()); |
| 59 | 61 |
| 60 // Check that we'll also say it's okay to activate the window when there's an | 62 // Check that we'll also say it's okay to activate the window when there's an |
| 61 // ActivationClient defined. | 63 // ActivationClient defined. |
| 62 EXPECT_TRUE(rwhv_aura_->ShouldActivate(NULL)); | 64 EXPECT_TRUE(rwhv_aura_->ShouldActivate(NULL)); |
| 63 } | 65 } |
| OLD | NEW |