test_suite.cc 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Copyright (c) 2012 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. #include "ui/compositor/test/test_suite.h"
  5. #include "base/command_line.h"
  6. #include "build/build_config.h"
  7. #include "ui/compositor/compositor.h"
  8. #include "ui/compositor/compositor_switches.h"
  9. #include "ui/compositor/layer.h"
  10. #include "ui/gl/test/gl_surface_test_support.h"
  11. #if defined(USE_OZONE)
  12. #include "ui/ozone/public/ozone_platform.h"
  13. #endif
  14. #if BUILDFLAG(IS_WIN)
  15. #include "ui/display/win/dpi.h"
  16. #endif
  17. #if BUILDFLAG(IS_APPLE)
  18. // gn check complains on other platforms, because //gpu/ipc/service:service
  19. // is added to dependencies only for mac.
  20. #include "gpu/ipc/service/image_transport_surface.h" // nogncheck
  21. #endif
  22. #if BUILDFLAG(IS_FUCHSIA)
  23. #include "ui/platform_window/fuchsia/initialize_presenter_api_view.h"
  24. #endif
  25. namespace ui {
  26. namespace test {
  27. CompositorTestSuite::CompositorTestSuite(int argc, char** argv)
  28. : TestSuite(argc, argv) {}
  29. CompositorTestSuite::~CompositorTestSuite() {}
  30. void CompositorTestSuite::Initialize() {
  31. base::TestSuite::Initialize();
  32. gl::GLSurfaceTestSupport::InitializeOneOff();
  33. #if defined(USE_OZONE)
  34. OzonePlatform::InitParams params;
  35. params.single_process = true;
  36. OzonePlatform::InitializeForUI(params);
  37. #endif
  38. #if BUILDFLAG(IS_WIN)
  39. display::win::SetDefaultDeviceScaleFactor(1.0f);
  40. #endif
  41. #if BUILDFLAG(IS_FUCHSIA)
  42. ui::fuchsia::IgnorePresentCallsForTest();
  43. #endif // BUILDFLAG(IS_FUCHSIA)
  44. }
  45. } // namespace test
  46. } // namespace ui