#include "chrome/test/base/interactive_test_utils.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/ui_test_utils.h"
+#include "ui/aura/client/event_client.h"
+#include "ui/aura/env.h"
+#include "ui/aura/test/aura_test_helper.h"
+#include "ui/aura/window_event_dispatcher.h"
+#include "ui/aura/window_tree_host.h"
#include "ui/base/ime/input_method_initializer.h"
#include "ui/base/test/ui_controls.h"
#include "ui/compositor/test/context_factories_for_test.h"
+#include "ui/compositor/test/context_factories_for_test.h"
#include "ui/message_center/message_center.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
+#include "ui/wm/core/default_activation_client.h"
+#include "ui/wm/core/wm_state.h"
#if defined(USE_ASH)
#include "ash/shell.h"
#include "ash/test/test_shell_delegate.h"
#endif
-#if defined(USE_AURA)
-#include "ui/aura/client/event_client.h"
-#include "ui/aura/env.h"
-#include "ui/aura/test/aura_test_helper.h"
-#include "ui/aura/window_event_dispatcher.h"
-#include "ui/aura/window_tree_host.h"
-#include "ui/compositor/test/context_factories_for_test.h"
-#include "ui/wm/core/wm_state.h"
-#endif
-
#if defined(OS_CHROMEOS)
#include "chromeos/audio/cras_audio_handler.h"
#include "chromeos/dbus/dbus_thread_manager.h"
}
void ViewEventTestBase::SetUp() {
-#if defined(USE_AURA)
wm_state_.reset(new wm::WMState);
-#endif
views::ViewsDelegate::views_delegate = &views_delegate_;
ui::InitializeInputMethodForTesting();
gfx::NativeView context = NULL;
-#if defined(USE_AURA)
// The ContextFactory must exist before any Compositors are created.
bool enable_pixel_output = false;
ui::InitializeContextFactoryForTests(enable_pixel_output);
-#endif
#if defined(USE_ASH)
#if defined(OS_WIN)
context = ash::Shell::GetPrimaryRootWindow();
context->GetHost()->Show();
#endif // !OS_WIN
- aura::Env::CreateInstance();
+ aura::Env::CreateInstance(true);
#elif defined(USE_AURA)
// Instead of using the ash shell, use an AuraTestHelper to create and manage
// the test screen.
aura_test_helper_.reset(
new aura::test::AuraTestHelper(base::MessageLoopForUI::current()));
aura_test_helper_->SetUp();
+ new wm::DefaultActivationClient(aura_test_helper_->root_window());
context = aura_test_helper_->root_window();
#endif // !USE_ASH && USE_AURA
aura_test_helper_->TearDown();
#endif // !USE_ASH && USE_AURA
-#if defined(USE_AURA)
ui::TerminateContextFactoryForTests();
-#endif
ui::ShutdownInputMethodForTesting();
views::ViewsDelegate::views_delegate = NULL;
-#if defined(USE_AURA)
wm_state_.reset();
-#endif
}
bool ViewEventTestBase::CanResize() const {