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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc

Issue 9026013: aura: Allow fullscreen RWHVAs (i.e. Flash) to be focused. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 years 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
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | content/content_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..be6cda6e27885422ca6b5bcbb2dfe35388e524d3
--- /dev/null
+++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
@@ -0,0 +1,62 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/browser/renderer_host/render_widget_host_view_aura.h"
+
+#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+#include "content/browser/renderer_host/test_render_view_host.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/aura/client/aura_constants.h"
+#include "ui/aura/window.h"
+#include "ui/base/ui_base_types.h"
+
+// This approach (of using RenderViewHostTestHarness's RenderViewHost for a new
+// RenderWidgetHostView) is borrowed from RenderWidgetHostViewMacTest.
+class RenderWidgetHostViewAuraTest : public RenderViewHostTestHarness {
+ public:
+ RenderWidgetHostViewAuraTest() : old_rwhv_(NULL) {}
+
+ virtual void SetUp() {
+ RenderViewHostTestHarness::SetUp();
+ old_rwhv_ = rvh()->view();
+ rwhv_aura_.reset(new RenderWidgetHostViewAura(rvh()));
+ }
+
+ virtual void TearDown() {
+ aura::Window* window = rwhv_aura_->GetNativeView();
+ if (window->parent())
+ window->parent()->RemoveChild(window);
+
+ rvh()->SetView(old_rwhv_);
+ rwhv_aura_.reset();
+ RenderViewHostTestHarness::TearDown();
+ }
+
+ protected:
+ scoped_ptr<RenderWidgetHostViewAura> rwhv_aura_;
+
+ private:
+ RenderWidgetHostView* old_rwhv_;
+
+ DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAuraTest);
+};
+
+// Checks that a fullscreen view has the correct show-state and receives the
+// focus.
+TEST_F(RenderWidgetHostViewAuraTest, Fullscreen) {
+ rwhv_aura_->InitAsFullscreen(NULL);
+
+ aura::Window* window = rwhv_aura_->GetNativeView();
+ ASSERT_TRUE(window != NULL);
+ EXPECT_EQ(ui::SHOW_STATE_FULLSCREEN,
+ window->GetIntProperty(aura::client::kShowStateKey));
+
+ // Check that we requested and received the focus.
+ EXPECT_TRUE(window->HasFocus());
+
+ // Check that we'll also say it's okay to activate the window when there's an
+ // ActivationClient defined.
+ EXPECT_TRUE(rwhv_aura_->ShouldActivate(NULL));
+}
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | content/content_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698