views_test_suite.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Copyright 2016 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. #ifndef UI_VIEWS_VIEWS_TEST_SUITE_H_
  5. #define UI_VIEWS_VIEWS_TEST_SUITE_H_
  6. #include "base/memory/raw_ptr.h"
  7. #include "base/test/test_suite.h"
  8. #include "build/build_config.h"
  9. #if defined(USE_AURA)
  10. #include <memory>
  11. namespace aura {
  12. class Env;
  13. }
  14. #endif
  15. namespace views {
  16. class ViewsTestSuite : public base::TestSuite {
  17. public:
  18. ViewsTestSuite(int argc, char** argv);
  19. ViewsTestSuite(const ViewsTestSuite&) = delete;
  20. ViewsTestSuite& operator=(const ViewsTestSuite&) = delete;
  21. ~ViewsTestSuite() override;
  22. int RunTests();
  23. int RunTestsSerially();
  24. protected:
  25. // base::TestSuite:
  26. void Initialize() override;
  27. void Shutdown() override;
  28. #if defined(USE_AURA)
  29. // Different test suites may wish to create Env differently.
  30. virtual void InitializeEnv();
  31. virtual void DestroyEnv();
  32. #endif
  33. private:
  34. #if defined(USE_AURA)
  35. std::unique_ptr<aura::Env> env_;
  36. #endif
  37. int argc_;
  38. raw_ptr<char*> argv_;
  39. };
  40. } // namespace views
  41. #endif // UI_VIEWS_VIEWS_TEST_SUITE_H_