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:
Jens Rutschmann 2017-05-14 01:02:54 +02:00 committed by louib
parent 03f00c5526
commit 9a59a124aa
5 changed files with 56 additions and 3 deletions

View file

@ -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!");