mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[Impeller] Skip all playground tests if SHIFT, SUPER, or CTRL is held. (flutter/engine#35446)
This commit is contained in:
parent
eb9bac63b9
commit
c8dd6748aa
@ -126,12 +126,21 @@ void Playground::TeardownWindow() {
|
||||
impl_.reset();
|
||||
}
|
||||
|
||||
static std::atomic_bool gShouldOpenNewPlaygrounds = true;
|
||||
|
||||
bool Playground::ShouldOpenNewPlaygrounds() {
|
||||
return gShouldOpenNewPlaygrounds;
|
||||
}
|
||||
|
||||
static void PlaygroundKeyCallback(GLFWwindow* window,
|
||||
int key,
|
||||
int scancode,
|
||||
int action,
|
||||
int mods) {
|
||||
if ((key == GLFW_KEY_ESCAPE || key == GLFW_KEY_Q) && action == GLFW_RELEASE) {
|
||||
if (mods & (GLFW_MOD_CONTROL | GLFW_MOD_SUPER | GLFW_MOD_SHIFT)) {
|
||||
gShouldOpenNewPlaygrounds = false;
|
||||
}
|
||||
::glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,6 +34,8 @@ class Playground {
|
||||
|
||||
static constexpr bool is_enabled() { return is_enabled_; }
|
||||
|
||||
static bool ShouldOpenNewPlaygrounds();
|
||||
|
||||
void SetupWindow(PlaygroundBackend backend);
|
||||
|
||||
void TeardownWindow();
|
||||
|
||||
@ -16,6 +16,11 @@ void PlaygroundTest::SetUp() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Playground::ShouldOpenNewPlaygrounds()) {
|
||||
GTEST_SKIP_("Skipping due to user action.");
|
||||
return;
|
||||
}
|
||||
|
||||
SetupWindow(GetParam());
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user