[Impeller] Skip all playground tests if SHIFT, SUPER, or CTRL is held. (flutter/engine#35446)
This commit is contained in:
@@ -126,12 +126,21 @@ void Playground::TeardownWindow() {
|
|||||||
impl_.reset();
|
impl_.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::atomic_bool gShouldOpenNewPlaygrounds = true;
|
||||||
|
|
||||||
|
bool Playground::ShouldOpenNewPlaygrounds() {
|
||||||
|
return gShouldOpenNewPlaygrounds;
|
||||||
|
}
|
||||||
|
|
||||||
static void PlaygroundKeyCallback(GLFWwindow* window,
|
static void PlaygroundKeyCallback(GLFWwindow* window,
|
||||||
int key,
|
int key,
|
||||||
int scancode,
|
int scancode,
|
||||||
int action,
|
int action,
|
||||||
int mods) {
|
int mods) {
|
||||||
if ((key == GLFW_KEY_ESCAPE || key == GLFW_KEY_Q) && action == GLFW_RELEASE) {
|
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);
|
::glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ class Playground {
|
|||||||
|
|
||||||
static constexpr bool is_enabled() { return is_enabled_; }
|
static constexpr bool is_enabled() { return is_enabled_; }
|
||||||
|
|
||||||
|
static bool ShouldOpenNewPlaygrounds();
|
||||||
|
|
||||||
void SetupWindow(PlaygroundBackend backend);
|
void SetupWindow(PlaygroundBackend backend);
|
||||||
|
|
||||||
void TeardownWindow();
|
void TeardownWindow();
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ void PlaygroundTest::SetUp() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!Playground::ShouldOpenNewPlaygrounds()) {
|
||||||
|
GTEST_SKIP_("Skipping due to user action.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SetupWindow(GetParam());
|
SetupWindow(GetParam());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user