Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / athena / test / athena_test_base.cc
index 8ddc437..82a0928 100644 (file)
@@ -4,8 +4,12 @@
 
 #include "athena/test/athena_test_base.h"
 
+#include "athena/env/public/athena_env.h"
+#include "athena/screen/public/screen_manager.h"
 #include "athena/test/athena_test_helper.h"
+#include "ui/aura/client/window_tree_client.h"
 #include "ui/aura/test/event_generator_delegate_aura.h"
+#include "ui/aura/window.h"
 #include "ui/compositor/test/context_factories_for_test.h"
 
 #if defined(USE_X11)
@@ -44,6 +48,8 @@ void AthenaTestBase::SetUp() {
 }
 
 void AthenaTestBase::TearDown() {
+  AthenaEnv::Get()->OnTerminating();
+
   teardown_called_ = true;
 
   // Flush the message loop because we have pending release tasks
@@ -59,5 +65,16 @@ void AthenaTestBase::RunAllPendingInMessageLoop() {
   helper_->RunAllPendingInMessageLoop();
 }
 
+scoped_ptr<aura::Window> AthenaTestBase::CreateTestWindow(
+    aura::WindowDelegate* delegate,
+    const gfx::Rect& bounds) {
+  scoped_ptr<aura::Window> window(new aura::Window(delegate));
+  window->SetType(ui::wm::WINDOW_TYPE_NORMAL);
+  window->Init(aura::WINDOW_LAYER_SOLID_COLOR);
+  aura::client::ParentWindowWithContext(
+      window.get(), ScreenManager::Get()->GetContext(), bounds);
+  return window.Pass();
+}
+
 }  // namespace test
 }  // namespace athena