зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1892976 - Stop throwing error on nsIClipboard::GetData() when the type isn't available on android; r=geckoview-reviewers,m_kato
Other platforms don't throw error; this patch makes android behave consistently with other platforms. Differential Revision: https://phabricator.services.mozilla.com/D208470
This commit is contained in:
Родитель
03fe5e116a
Коммит
01c5a3987a
|
@ -164,7 +164,7 @@ nsClipboard::GetNativeClipboardData(nsITransferable* aTransferable,
|
|||
}
|
||||
}
|
||||
|
||||
return NS_ERROR_FAILURE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsClipboard::EmptyNativeClipboardData(int32_t aWhichClipboard) {
|
||||
|
|
|
@ -149,5 +149,20 @@ clipboardTypes.forEach(function (clipboardType) {
|
|||
// Clear all clipboard data.
|
||||
cleanupAllClipboard();
|
||||
});
|
||||
|
||||
add_task(function test_unsupport_flavor() {
|
||||
try {
|
||||
is(
|
||||
getClipboardData("foo/bar", clipboardType),
|
||||
null,
|
||||
`Test getData for clipboard type ${clipboardType}`
|
||||
);
|
||||
} catch (e) {
|
||||
ok(
|
||||
false,
|
||||
`getData should not throw error for clipboard type ${clipboardType}`
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче