Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Windows] Reduce log level of unsupported accessibility event message
  • Loading branch information
loic-sharma committed Feb 28, 2024
commit 6ad4592655402be7a307049ecb78aa141fdb0d30
4 changes: 2 additions & 2 deletions shell/platform/windows/accessibility_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ void HandleMessage(AccessibilityPlugin* plugin, const EncodableValue& message) {

plugin->Announce(*message);
} else {
FML_LOG(ERROR) << "Accessibility message type '" << *type
<< "' is not supported.";
FML_LOG(WARNING) << "Accessibility message type '" << *type
<< "' is not supported.";
}
}

Expand Down
8 changes: 8 additions & 0 deletions shell/platform/windows/flutter_windows_engine_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "flutter/shell/platform/windows/flutter_windows_engine.h"

#include "flutter/fml/logging.h"
#include "flutter/fml/macros.h"
#include "flutter/shell/platform/embedder/embedder.h"
#include "flutter/shell/platform/embedder/test_utils/proc_table_replacement.h"
Expand Down Expand Up @@ -716,6 +717,8 @@ TEST_F(FlutterWindowsEngineTest, AccessibilityAnnouncementHeadless) {
// Verify the engine does not crash if it receives an accessibility event
// it does not support yet.
TEST_F(FlutterWindowsEngineTest, AccessibilityTooltip) {
fml::testing::LogCapture log_capture;

auto& context = GetContext();
WindowsConfigBuilder builder{context};
builder.SetDartEntrypoint("sendAccessibilityTooltipEvent");
Expand All @@ -736,6 +739,11 @@ TEST_F(FlutterWindowsEngineTest, AccessibilityTooltip) {
while (!done) {
windows_engine->task_runner()->ProcessTasks();
}

// Verify no error was logged.
// Regression test for:
// https://github.com/flutter/flutter/issues/144274
EXPECT_EQ(log_capture.str().find("tooltip"), std::string::npos);
}

class MockWindowsLifecycleManager : public WindowsLifecycleManager {
Expand Down