forked from mirrors/gecko-dev
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:
parent
03fe5e116a
commit
01c5a3987a
2 changed files with 16 additions and 1 deletions
|
|
@ -164,7 +164,7 @@ nsClipboard::GetNativeClipboardData(nsITransferable* aTransferable,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_ERROR_FAILURE;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult nsClipboard::EmptyNativeClipboardData(int32_t aWhichClipboard) {
|
nsresult nsClipboard::EmptyNativeClipboardData(int32_t aWhichClipboard) {
|
||||||
|
|
|
||||||
|
|
@ -149,5 +149,20 @@ clipboardTypes.forEach(function (clipboardType) {
|
||||||
// Clear all clipboard data.
|
// Clear all clipboard data.
|
||||||
cleanupAllClipboard();
|
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}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue