forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move CursorLoader and support code to ui/aura/cursor/
CursorLoader code is Aura-specific. This CL moves that code to a new directory ui/aura/cursor/. This allows to simplify the unittests, by relying on AuraTestBase for the cursor factories initialization, and moving platform-specific tests to other directories, so that some disallowed dependencies are fixed. The namespace rename is left for a follow-up CL. Bug: 1270302 Change-Id: Idb7d26fd0055ce08209edd2908c510e97bc93434 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3284990 Reviewed-by: Colin Blundell <blundell@chromium.org> Reviewed-by: Camille Lamy <clamy@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Joe Downing <joedow@chromium.org> Reviewed-by: Finnur Thorarinsson <finnur@chromium.org> Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com> Cr-Commit-Position: refs/heads/main@{#945627}
- Loading branch information
Showing
44 changed files
with
181 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Copyright 2021 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
component("cursor") { | ||
output_name = "ui_aura_cursor" | ||
sources = [ | ||
"cursor_loader.cc", | ||
"cursor_loader.h", | ||
"cursor_lookup.cc", | ||
"cursor_lookup.h", | ||
"cursor_util.cc", | ||
"cursor_util.h", | ||
"cursors_aura.cc", | ||
"cursors_aura.h", | ||
] | ||
defines = [ "IS_UI_AURA_CURSOR_IMPL" ] | ||
public_deps = [ | ||
"//base", | ||
"//ui/base/cursor:cursor_base", | ||
"//ui/base/cursor/mojom:cursor_type", | ||
"//ui/display", | ||
] | ||
deps = [ | ||
"//skia", | ||
"//ui/base", | ||
"//ui/gfx", | ||
"//ui/gfx/geometry", | ||
"//ui/resources:ui_resources_grd", | ||
] | ||
} | ||
|
||
source_set("unittests") { | ||
testonly = true | ||
sources = [ | ||
"cursor_loader_unittest.cc", | ||
"cursor_util_unittest.cc", | ||
] | ||
deps = [ | ||
":cursor", | ||
"//base", | ||
"//skia", | ||
"//testing/gtest", | ||
"//ui/aura:test_support", | ||
"//ui/base/cursor:cursor_base", | ||
"//ui/base/cursor/mojom:cursor_type", | ||
"//ui/gfx/geometry", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
include_rules = [ | ||
"+ui/resources", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
file://ui/base/cursor/OWNERS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright 2020 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "ui/aura/cursor/cursor_loader.h" | ||
|
||
#include "base/memory/scoped_refptr.h" | ||
#include "testing/gtest/include/gtest/gtest.h" | ||
#include "ui/aura/test/aura_test_base.h" | ||
#include "ui/base/cursor/cursor.h" | ||
#include "ui/base/cursor/cursor_factory.h" | ||
#include "ui/base/cursor/mojom/cursor_type.mojom-shared.h" | ||
#include "ui/base/cursor/platform_cursor.h" | ||
|
||
namespace ui { | ||
namespace { | ||
|
||
using mojom::CursorType; | ||
using CursorLoaderTest = ::aura::test::AuraTestBase; | ||
|
||
} // namespace | ||
|
||
TEST_F(CursorLoaderTest, InvisibleCursor) { | ||
CursorLoader cursor_loader; | ||
Cursor invisible_cursor(CursorType::kNone); | ||
cursor_loader.SetPlatformCursor(&invisible_cursor); | ||
|
||
ASSERT_EQ(invisible_cursor.platform(), | ||
CursorFactory::GetInstance()->GetDefaultCursor(CursorType::kNone)); | ||
} | ||
|
||
} // namespace ui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.