1 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CHROME_TEST_BASE_VIEW_EVENT_TEST_PLATFORM_PART_H_ 6 #define CHROME_TEST_BASE_VIEW_EVENT_TEST_PLATFORM_PART_H_ 7 8 #include "base/macros.h" 9 #include "ui/gfx/native_widget_types.h" 10 11 namespace ui { 12 class ContextFactory; 13 } 14 15 // A helper class owned by tests that performs platform specific initialization. 16 // ViewEventTestPlatformPart behaves a bit like views::ViewsTestHelper, but on 17 // ChromeOS it will create an Ash shell environment, rather than using an 18 // AuraTestHelper. 19 class ViewEventTestPlatformPart { 20 public: 21 virtual ~ViewEventTestPlatformPart() {} 22 23 // Set up the platform-specific environment. Teardown is performed in the 24 // destructor. 25 static ViewEventTestPlatformPart* Create(ui::ContextFactory* context_factory); 26 27 // The Widget context for creating the test window. This will be the Ash root 28 // window on ChromeOS environments. Otherwise it should return NULL. 29 virtual gfx::NativeWindow GetContext() = 0; 30 31 protected: 32 ViewEventTestPlatformPart() {} 33 34 private: 35 DISALLOW_COPY_AND_ASSIGN(ViewEventTestPlatformPart); 36 }; 37 38 #endif // CHROME_TEST_BASE_VIEW_EVENT_TEST_PLATFORM_PART_H_ 39