Bug 509274 - Make sizing reftests more robust

This commit is contained in:
Robert Longson 2009-09-14 21:45:14 +01:00
Родитель a5cd3ff71d
Коммит e33dab1190
8 изменённых файлов: 39 добавлений и 13 удалений

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

@ -30,13 +30,17 @@ html, body {
function handle_load(e) function handle_load(e)
{ {
setTimeout(resize_svg, 50); // allow some time for layout and rendering document.addEventListener("MozReftestInvalidate", resize_svg, false);
// in case we're not gecko
setTimeout(resize_svg, 5000);
} }
function resize_svg() function resize_svg()
{ {
document.getElementById('svg').style.height = '100%'; document.getElementById('svg').style.height = '100%';
setTimeout(notify_test_finished, 50); // allow some time for layout and rendering document.addEventListener("MozReftestInvalidate", notify_test_finished, false);
// in case we're not gecko
setTimeout(notify_test_finished, 5000);
} }
function notify_test_finished() function notify_test_finished()

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

@ -30,13 +30,17 @@ html, body {
function handle_load(e) function handle_load(e)
{ {
setTimeout(resize_svg, 50); // allow some time for layout and rendering document.addEventListener("MozReftestInvalidate", resize_svg, false);
// in case we're not gecko
setTimeout(resize_svg, 5000);
} }
function resize_svg() function resize_svg()
{ {
document.getElementById('svg').style.width = '100%'; document.getElementById('svg').style.width = '100%';
setTimeout(notify_test_finished, 50); // allow some time for layout and rendering document.addEventListener("MozReftestInvalidate", notify_test_finished, false);
// in case we're not gecko
setTimeout(notify_test_finished, 5000);
} }
function notify_test_finished() function notify_test_finished()

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

@ -31,14 +31,18 @@ html, body, div {
function handle_load(e) function handle_load(e)
{ {
setTimeout(resize_div, 50); // allow some time for layout and rendering document.addEventListener("MozReftestInvalidate", resize_div, false);
// in case we're not gecko
setTimeout(resize_div, 5000);
} }
function resize_div() function resize_div()
{ {
var XHTML_NS = 'http://www.w3.org/1999/xhtml'; var XHTML_NS = 'http://www.w3.org/1999/xhtml';
document.getElementsByTagNameNS(XHTML_NS, 'div').item(0).style.height = '100%'; document.getElementsByTagNameNS(XHTML_NS, 'div').item(0).style.height = '100%';
setTimeout(notify_test_finished, 50); // allow some time for layout and rendering document.addEventListener("MozReftestInvalidate", notify_test_finished, false);
// in case we're not gecko
setTimeout(notify_test_finished, 5000);
} }
function notify_test_finished() function notify_test_finished()

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

@ -31,14 +31,18 @@ html, body, div {
function handle_load(e) function handle_load(e)
{ {
setTimeout(resize_div, 50); // allow some time for layout and rendering document.addEventListener("MozReftestInvalidate", resize_div, false);
// in case we're not gecko
setTimeout(resize_div, 5000);
} }
function resize_div() function resize_div()
{ {
var XHTML_NS = 'http://www.w3.org/1999/xhtml'; var XHTML_NS = 'http://www.w3.org/1999/xhtml';
document.getElementsByTagNameNS(XHTML_NS, 'div').item(0).style.width = '100%'; document.getElementsByTagNameNS(XHTML_NS, 'div').item(0).style.width = '100%';
setTimeout(notify_test_finished, 50); // allow some time for layout and rendering document.addEventListener("MozReftestInvalidate", notify_test_finished, false);
// in case we're not gecko
setTimeout(notify_test_finished, 5000);
} }
function notify_test_finished() function notify_test_finished()

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

@ -34,13 +34,17 @@ top.innerHeight /= 2;
function handle_load(e) function handle_load(e)
{ {
setTimeout(restore_height, 50); // allow some time for layout and rendering document.addEventListener("MozReftestInvalidate", restore_height, false);
// in case we're not gecko
setTimeout(restore_height, 5000);
} }
function restore_height() function restore_height()
{ {
top.innerHeight = initial_height; top.innerHeight = initial_height;
setTimeout(notify_test_finished, 50); // allow some time for layout and rendering document.addEventListener("MozReftestInvalidate", notify_test_finished, false);
// in case we're not gecko
setTimeout(notify_test_finished, 5000);
} }
function notify_test_finished() function notify_test_finished()

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

@ -40,7 +40,9 @@ function handle_load(e)
function restore_width() function restore_width()
{ {
top.innerWidth = initial_width; top.innerWidth = initial_width;
setTimeout(notify_test_finished, 50); // allow some time for layout and rendering document.addEventListener("MozReftestInvalidate", notify_test_finished, false);
// in case we're not gecko
setTimeout(notify_test_finished, 5000);
} }
function notify_test_finished() function notify_test_finished()

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

@ -17,7 +17,9 @@ function handle_load(e)
{ {
embedding_element = e.originalTarget.ownerDocument.defaultView.frameElement; embedding_element = e.originalTarget.ownerDocument.defaultView.frameElement;
setTimeout(load_new_page, 50); // allow some time for layout and rendering document.addEventListener("MozReftestInvalidate", load_new_page, false);
// in case we're not gecko
setTimeout(load_new_page, 5000);
} }
function load_new_page() function load_new_page()

До

Ширина:  |  Высота:  |  Размер: 1.2 KiB

После

Ширина:  |  Высота:  |  Размер: 1.2 KiB

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

@ -27,7 +27,9 @@ var embedding_element;
function handle_load(e) function handle_load(e)
{ {
embedding_element = e.originalTarget.defaultView.frameElement; embedding_element = e.originalTarget.defaultView.frameElement;
setTimeout(notify_test_finished, 50); // allow some time for layout and rendering document.addEventListener("MozReftestInvalidate", notify_test_finished, false);
// in case we're not gecko
setTimeout(notify_test_finished, 5000);
} }
function notify_test_finished() function notify_test_finished()