x11_cursor_factory_unittest.cc 957 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2017 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/base/x/x11_cursor_factory.h"
  5. #include "testing/gtest/include/gtest/gtest.h"
  6. #include "third_party/skia/include/core/SkBitmap.h"
  7. #include "ui/base/cursor/mojom/cursor_type.mojom-shared.h"
  8. #include "ui/base/cursor/platform_cursor.h"
  9. #include "ui/base/x/x11_cursor.h"
  10. #include "ui/gfx/geometry/point.h"
  11. namespace ui {
  12. namespace {
  13. using mojom::CursorType;
  14. } // namespace
  15. TEST(X11CursorFactoryTest, InvisibleCursor) {
  16. X11CursorFactory factory;
  17. // Building an image cursor with an invalid SkBitmap should return the
  18. // invisible cursor in X11.
  19. auto invisible_cursor =
  20. factory.CreateImageCursor({}, SkBitmap(), gfx::Point());
  21. ASSERT_NE(invisible_cursor, nullptr);
  22. EXPECT_EQ(invisible_cursor, factory.GetDefaultCursor(CursorType::kNone));
  23. }
  24. } // namespace ui