bug 427142 - sporadic test_393498.js failure on bm-win2k3-pgo01 because of VM timer issues. r=dietrich

This commit is contained in:
Marco Bonardo 2008-07-21 11:41:09 -04:00
Родитель ce90fb3c24
Коммит 24b6d38299
1 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -122,14 +122,15 @@ function run_test() {
do_check_eq(bmsvc.getItemLastModified(bookmarkId), childNode.lastModified);
// test live update of lastModified caused by other changes:
// We set lastModified 1ms in the past to workaround a timing bug on
// virtual machines, see bug 427142 for details.
var pastDate = Date.now() * 1000 - 1;
bmsvc.setItemLastModified(bookmarkId, pastDate);
// set title (causing update of last modified)
var oldLastModified = bmsvc.getItemLastModified(bookmarkId);
// This double call to setItemTitle is a temporary hack to workaround a
// timing bug on virtual machines. See bug 427142 for details.
bmsvc.setItemTitle(bookmarkId, "Google");
bmsvc.setItemTitle(bookmarkId, "Google");
// test that lm is updated
do_check_neq(oldLastModified, childNode.lastModified);
// test that lastModified is updated
do_check_true(oldLastModified < childNode.lastModified);
// test that node value matches db value
do_check_eq(bmsvc.getItemLastModified(bookmarkId), childNode.lastModified);