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

Unified Diff: ui/app_list/views/app_list_view_unittest.cc

Issue 438533002: MacViews: Changes to allow app_list_unittests to compile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Ash Created 6 years, 5 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/app_list/views/app_list_main_view_unittest.cc ('k') | ui/views/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/app_list_view_unittest.cc
diff --git a/ui/app_list/views/app_list_view_unittest.cc b/ui/app_list/views/app_list_view_unittest.cc
index c2d3079076e3e721161e576c9b6742ed65e47df0..880269afd800d454cdfcc0c00affe6782503f379 100644
--- a/ui/app_list/views/app_list_view_unittest.cc
+++ b/ui/app_list/views/app_list_view_unittest.cc
@@ -25,8 +25,6 @@
#include "ui/app_list/views/start_page_view.h"
#include "ui/app_list/views/test/apps_grid_view_test_api.h"
#include "ui/app_list/views/tile_item_view.h"
-#include "ui/aura/test/aura_test_base.h"
-#include "ui/aura/window.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/test/views_test_base.h"
#include "ui/views/views_delegate.h"
@@ -67,7 +65,7 @@ const int kInitialItems = 34;
// root window or a desktop window tree host.
class AppListViewTestContext {
public:
- AppListViewTestContext(int test_type, aura::Window* parent);
+ AppListViewTestContext(int test_type, gfx::NativeView parent);
~AppListViewTestContext();
// Test displaying the app list and performs a standard set of checks on its
@@ -150,7 +148,7 @@ class UnitTestViewDelegate : public app_list::test::AppListTestViewDelegate {
};
AppListViewTestContext::AppListViewTestContext(int test_type,
- aura::Window* parent)
+ gfx::NativeView parent)
: test_type_(static_cast<TestType>(test_type)) {
switch (test_type_) {
case NORMAL:
@@ -530,7 +528,17 @@ class AppListViewTestAura : public views::ViewsTestBase,
// testing::Test overrides:
virtual void SetUp() OVERRIDE {
views::ViewsTestBase::SetUp();
- test_context_.reset(new AppListViewTestContext(GetParam(), GetContext()));
+
+ // On Ash (only) the app list is placed into an aura::Window "container",
+ // which is also used to determine the context. In tests, use the ash root
+ // window as the parent. This only works on aura where the root window is a
+ // NativeView as well as a NativeWindow.
+ gfx::NativeView container = NULL;
+#if defined(USE_AURA)
+ container = GetContext();
+#endif
+
+ test_context_.reset(new AppListViewTestContext(GetParam(), container));
}
virtual void TearDown() OVERRIDE {
« no previous file with comments | « ui/app_list/views/app_list_main_view_unittest.cc ('k') | ui/views/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698