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

Unified Diff: ui/views/controls/native/native_view_host_unittest.cc

Issue 530933002: MacViews: Implement NativeViewHostMac (take 3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: acceptsFirstResponder, cleanup strays Created 6 years, 3 months 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 | « ui/views/controls/native/native_view_host_test_base.cc ('k') | ui/views/views.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/native/native_view_host_unittest.cc
diff --git a/ui/views/controls/native/native_view_host_unittest.cc b/ui/views/controls/native/native_view_host_unittest.cc
index e77fd358bf5827b987f1649eb50e93d9143ffd80..4fa9a75336abe6160855a9dfb98356fbc8aea58f 100644
--- a/ui/views/controls/native/native_view_host_unittest.cc
+++ b/ui/views/controls/native/native_view_host_unittest.cc
@@ -7,55 +7,23 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "ui/aura/window.h"
+#include "ui/views/controls/native/native_view_host_test_base.h"
#include "ui/views/test/views_test_base.h"
#include "ui/views/widget/widget.h"
namespace views {
-class NativeViewHostTest : public ViewsTestBase {
+class NativeViewHostTest : public test::NativeViewHostTestBase {
public:
NativeViewHostTest() {
}
virtual void SetUp() OVERRIDE {
ViewsTestBase::SetUp();
-
- // Create the top level widget.
- toplevel_.reset(new Widget);
- Widget::InitParams toplevel_params =
- CreateParams(Widget::InitParams::TYPE_WINDOW);
- toplevel_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
- toplevel_->Init(toplevel_params);
- }
-
- // Create a child widget whose native parent is |native_parent_view|, uses
- // |contents_view|, and is attached to |host| which is added as a child to
- // |parent_view|.
- Widget* CreateChildForHost(gfx::NativeView native_parent_view,
- View* parent_view,
- View* contents_view,
- NativeViewHost* host) {
- Widget* child = new Widget;
- Widget::InitParams child_params(Widget::InitParams::TYPE_CONTROL);
- child_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
- child_params.parent = native_parent_view;
- child->Init(child_params);
- child->SetContentsView(contents_view);
-
- // Owned by |parent_view|.
- parent_view->AddChildView(host);
- host->Attach(child->GetNativeView());
-
- return child;
- }
-
- Widget* toplevel() {
- return toplevel_.get();
+ CreateTopLevel();
}
private:
- scoped_ptr<Widget> toplevel_;
-
DISALLOW_COPY_AND_ASSIGN(NativeViewHostTest);
};
« no previous file with comments | « ui/views/controls/native/native_view_host_test_base.cc ('k') | ui/views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698