Skip to content

Commit

Permalink
Fix based on review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankYFTang committed Feb 24, 2021
1 parent 90988a7 commit b318f8c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion infrastructure/testdriver/set_timezone.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
async_test(t => {
let timeZone = "Asia/Taipei";
let timeZone2 = "Asia/Hong_Kong";
let timeZone2 = "Pacific/Fakaofo";
test_driver
.set_time_zone(timeZone)
.then(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
self.addEventListener('message', function(e) {
const message = e.data;
if ('port' in message) {
const port = message.port;
const oldTimeZone =
(new Intl.DateTimeFormat()).resolvedOptions().timeZone;
self.addEventListener('timezonechange', function(evt) {
const newTimeZone =
(new Intl.DateTimeFormat()).resolvedOptions().timeZone;
port.postMessage('SUCCESS:' + newTimeZone);
});
port.postMessage('READY:' + oldTimeZone);
}
const message = e.data;
if ('port' in message) {
const port = message.port;
const oldTimeZone =
(new Intl.DateTimeFormat()).resolvedOptions().timeZone;
self.addEventListener('timezonechange', function(evt) {
const newTimeZone =
(new Intl.DateTimeFormat()).resolvedOptions().timeZone;
port.postMessage('SUCCESS:' + newTimeZone);
});
port.postMessage('READY:' + oldTimeZone);
}
});
2 changes: 1 addition & 1 deletion timezonechange/addeventlistener-timezonechange-fired.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
window.addEventListener('timezonechange', r);
window.test_driver.set_time_zone(newTimeZone);
}).then(e => {
assert_equals(defaultTimeZone(), newTimeZone);
assert_equals(defaultTimeZone(), newTimeZone);
});
}, "Test that the timezonechange event fires on window.addEventListener('timezonechange')");
</script>
2 changes: 1 addition & 1 deletion timezonechange/resources/shared-worker-timezonechange.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ onconnect = connectEvent => {
port.postMessage("SUCCESS:" + timezone);
};
port.postMessage("READY:" + oldtimezone); // (the html will change the timezone)
}
};
2 changes: 1 addition & 1 deletion timezonechange/resources/worker-timezonechange.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ let oldtimezone = (new Intl.DateTimeFormat()).resolvedOptions().timeZone;
ontimezonechange = evt => {
let timezone = (new Intl.DateTimeFormat()).resolvedOptions().timeZone;
postMessage("SUCCESS:" + timezone);
}
};
postMessage("READY:" + oldtimezone);

0 comments on commit b318f8c

Please sign in to comment.