blob: 4025209888636244fef88ac7a04a1a7d7eb712fe [file] [log] [blame] [edit]
<!DOCTYPE html>
<html>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script>
function defaultTimeZone() {
return (new Intl.DateTimeFormat()).resolvedOptions().timeZone;
}
promise_test(async t => {
const oldTimeZone = "Pacific/Fakaofo";
const newTimeZone = "Asia/Taipei";
// First, setup the time zone in a fixed place.
await window.test_driver.set_time_zone(oldTimeZone);
assert_equals(defaultTimeZone(), oldTimeZone);
return new Promise(async r => {
window.addEventListener('timezonechange', r);
await window.test_driver.set_time_zone(newTimeZone);
}).then(e => {
assert_false(e.cancelable);
assert_false(e.bubbles);
assert_equals(defaultTimeZone(), newTimeZone);
});
}, "Test properties of the fired event.");
</script>
</body>
</html>