6 testRunner
.dumpAsText();
8 function test(message
, success
)
10 var li
= document
.createElement("li");
11 var text
= document
.createTextNode(message
+ ': ' + (success
? 'PASS' : 'FAIL'));
13 document
.getElementById("console").appendChild(li
);
18 var languages
= internals
.userPreferredLanguages();
20 test('internals.userPreferredLanguages returns a non-empty array', languages
.length
);
22 languages
.unshift("first-language");
23 languages
.push("last-language");
24 internals
.setUserPreferredLanguages(languages
);
26 var newLanguages
= internals
.userPreferredLanguages();
27 var sameContents
= newLanguages
.length
== languages
.length
;
29 for (var i
= 0; i
< newLanguages
.length
; i
++) {
30 if (newLanguages
[i
] != languages
[i
]) {
36 test('internals.userPreferredLanguages is mutable, and returns the same value passed to it', sameContents
);
41 <body onload=
"runTest()">
42 <p>This test verifies that internals.userPreferredLanguages returns a mutable Array of the user's preferred languages.
</p>
43 <ul id=
"console"></ul>