mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-12-06 08:42:36 -08:00
Fix Auto-Type Empty Window Behavior
* Fixes #9282 * Also improve documentation for window title matching behavior
This commit is contained in:
4 files changed
+38
-2
No files matched your search
@@ -123,6 +123,20 @@ void TestAutoType::init()
|
||||
m_entry5->setPassword("example5");
|
||||
m_entry5->setTitle("some title");
|
||||
m_entry5->setUrl("http://example.org");
|
||||
|
||||
m_entry6 = new Entry();
|
||||
m_entry6->setGroup(m_group);
|
||||
m_entry6->setPassword("example6");
|
||||
m_entry6->setTitle("empty window test");
|
||||
association.window = "";
|
||||
association.sequence = "{S:Empty Window}";
|
||||
m_entry6->autoTypeAssociations()->add(association);
|
||||
association.window = "non-matching window";
|
||||
association.sequence = "should not match";
|
||||
m_entry6->autoTypeAssociations()->add(association);
|
||||
association.window = "*notepad*";
|
||||
association.sequence = "{USERNAME}";
|
||||
m_entry6->autoTypeAssociations()->add(association);
|
||||
}
|
||||
|
||||
void TestAutoType::cleanup()
|
||||
@@ -444,3 +458,13 @@ void TestAutoType::testAutoTypeEffectiveSequences()
|
||||
QCOMPARE(entry6->defaultAutoTypeSequence(), sequenceOrphan);
|
||||
QCOMPARE(entry6->effectiveAutoTypeSequence(), QString());
|
||||
}
|
||||
|
||||
void TestAutoType::testAutoTypeEmptyWindowAssociation()
|
||||
{
|
||||
auto assoc = m_entry6->autoTypeSequences("Windows Notepad");
|
||||
QCOMPARE(assoc.size(), 2);
|
||||
QVERIFY(assoc.contains("{S:Empty Window}"));
|
||||
|
||||
assoc = m_entry6->autoTypeSequences("Some Other Window");
|
||||
QVERIFY(assoc.isEmpty());
|
||||
}
|
||||
Reference in new issue
Block a user