| function test(message, success) |
| var li = document.createElement("li"); |
| var text = document.createTextNode(message + ': ' + (success ? 'PASS' : 'FAIL')); |
| document.getElementById("console").appendChild(li); |
| var languages = internals.userPreferredLanguages(); |
| test('internals.userPreferredLanguages returns a non-empty array', languages.length); |
| languages.unshift("first-language"); |
| languages.push("last-language"); |
| internals.setUserPreferredLanguages(languages); |
| var newLanguages = internals.userPreferredLanguages(); |
| var sameContents = newLanguages.length == languages.length; |
| for (var i = 0; i < newLanguages.length; i++) { |
| if (newLanguages[i] != languages[i]) { |
| test('internals.userPreferredLanguages is mutable, and returns the same value passed to it', sameContents); |
| <body onload="runTest()"> |
| <p>This test verifies that internals.userPreferredLanguages returns a mutable Array of the user's preferred languages.</p> |