mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-14 07:02:54 +00:00
Calling test() multiple times in the same test file is not actually valid, and can cause the following test to hang forever. So let's stop doing that in the one test that did so, and also prevent the same mistake happening again. :^) Throwing an exception on subsequent test() calls means that we don't hang, the test will fail with missing output, and we get a log message explaining why.
22 lines
580 B
HTML
22 lines
580 B
HTML
<!DOCTYPE html>
|
|
<style type="text/css">
|
|
#box {
|
|
margin-top: 500px;
|
|
padding-top: 100px;
|
|
background-color: navy;
|
|
width: 100%;
|
|
height: 50px;
|
|
}
|
|
</style>
|
|
<div id="box"></div>
|
|
<a id="inline">inline</a>
|
|
<script src="include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
const box_rect = document.getElementById("box").getBoundingClientRect();
|
|
println(JSON.stringify(box_rect));
|
|
|
|
const inline_rect = document.getElementById("inline").getBoundingClientRect();
|
|
println(JSON.stringify(inline_rect));
|
|
});
|
|
</script>
|