Bug 1156566 - Polyfill Array.includes() in test_gmpProvider.js, so that test passes when it uplifts out of Nightly. r=preemptive-bustage-fix

This commit is contained in:
Chris Pearce 2015-05-21 14:00:57 +12:00
parent 6c37c65ba1
commit 9813726ed4

View File

@ -249,6 +249,14 @@ function createMockPluginFilesIfNeeded(aFile, aPluginId) {
createFile(aPluginId.substring(4) + ".info");
}
// Array.includes() is only in Nightly channel, so polyfill so we don't fail
// on other branches.
if (![].includes) {
Array.prototype.includes = function(element) {
return Object(this).indexOf(element) != -1;
}
}
add_task(function* test_pluginRegistration() {
const TEST_VERSION = "1.2.3.4";