mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-05-02 06:36:07 -04:00
Compare window title with entry URLs during autotype matching. (#556)
* Compare window title with entry URLs during autotype matching. * Adapted option label to reflect that both entry title and URL are used for auto-type window matching.
This commit is contained in:
parent
03f00c5526
commit
9a59a124aa
5 changed files with 56 additions and 3 deletions
|
@ -104,6 +104,12 @@ void TestAutoType::init()
|
|||
association.window = "//^CustomAttr3$//";
|
||||
association.sequence = "{PaSSworD}";
|
||||
m_entry4->autoTypeAssociations()->add(association);
|
||||
|
||||
m_entry5 = new Entry();
|
||||
m_entry5->setGroup(m_group);
|
||||
m_entry5->setPassword("example5");
|
||||
m_entry5->setTitle("some title");
|
||||
m_entry5->setUrl("http://example.org");
|
||||
}
|
||||
|
||||
void TestAutoType::cleanup()
|
||||
|
@ -172,6 +178,28 @@ void TestAutoType::testGlobalAutoTypeTitleMatch()
|
|||
QString("%1%2").arg(m_entry2->password(), m_test->keyToString(Qt::Key_Enter)));
|
||||
}
|
||||
|
||||
void TestAutoType::testGlobalAutoTypeUrlMatch()
|
||||
{
|
||||
config()->set("AutoTypeEntryTitleMatch", true);
|
||||
|
||||
m_test->setActiveWindowTitle("Dummy - http://example.org/ - <My Browser>");
|
||||
m_autoType->performGlobalAutoType(m_dbList);
|
||||
|
||||
QCOMPARE(m_test->actionChars(),
|
||||
QString("%1%2").arg(m_entry5->password(), m_test->keyToString(Qt::Key_Enter)));
|
||||
}
|
||||
|
||||
void TestAutoType::testGlobalAutoTypeUrlSubdomainMatch()
|
||||
{
|
||||
config()->set("AutoTypeEntryTitleMatch", true);
|
||||
|
||||
m_test->setActiveWindowTitle("Dummy - http://sub.example.org/ - <My Browser>");
|
||||
m_autoType->performGlobalAutoType(m_dbList);
|
||||
|
||||
QCOMPARE(m_test->actionChars(),
|
||||
QString("%1%2").arg(m_entry5->password(), m_test->keyToString(Qt::Key_Enter)));
|
||||
}
|
||||
|
||||
void TestAutoType::testGlobalAutoTypeTitleMatchDisabled()
|
||||
{
|
||||
m_test->setActiveWindowTitle("An Entry Title!");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue