<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<script>
description("Tests the languagechange event.");
jsTestIsAsync = true;

internals.setUserPreferredLanguages(["en-US"]);

shouldBeEqualToString("navigator.language", "en-US");

window.onlanguagechange = function() {
    debug("* received languagechange event");

    shouldBeEqualToString("navigator.language", "fr-FR");

    window.onlanguagechange = null;

    finishJSTest();
}

internals.setUserPreferredLanguages(["fr-FR"]);
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>
