Skip to content

Commit

Permalink
Change the hiding strategy of the test_iframe.
Browse files Browse the repository at this point in the history
This commit contains three changes:

  * First, the test_iframe is taken out of span with `display: none`,
    so that it is initially visible
  * That iframe is hidden via absolute positioning now and negative
    `top` and `left` values
  * Also inttroduced is a configurable delay for when the test_iframe
    actally considers a test page being done loading and signaling the
    test-suite that it can continue with running the tests.
  • Loading branch information
marcjansen committed Nov 27, 2014
1 parent 74f9e40 commit c87074c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions tests/Test.AnotherWay.css
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,12 @@ body {

#record_input {
width: 53%;
}
#taw-test-iframe {
padding: 0;
width: 200px;
height: 200px;
position: absolute;
top: -1000px;
left: -1000px;
}
1 change: 1 addition & 0 deletions tests/Test.AnotherWay.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Test.AnotherWay._g_pages_to_run = null; // list of pages to run automatically af
Test.AnotherWay._g_run_on_main_load = false; // special handling for run_pages_to_run when it might be called before onload or before list of test pages is known.
Test.AnotherWay._g_run_on_list_load = false;
Test.AnotherWay._g_main_loaded = false;
Test.AnotherWay._test_page_onload_delay_ms = 2000; // Number of milliseconds to wait after the iframe fired the onload event

Test.AnotherWay._run_pages_to_run = function(called_from_outside){
if (!Test.AnotherWay._g_main_loaded) {
Expand Down
3 changes: 1 addition & 2 deletions tests/run-tests.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,10 @@
</div>
</div>
</div>
<iframe id="taw-test-iframe" name="test_iframe" onload="window.setTimeout(Test.AnotherWay._test_page_onload,Test.AnotherWay._test_page_onload_delay_ms);"></iframe>
<span style="display:none">
<iframe name="list_iframe" onload="Test.AnotherWay._list_iframe_onload();">
</iframe>
<iframe name="test_iframe" onload="Test.AnotherWay._test_page_onload();">
</iframe>
<!-- record_control div is to be imported into other documents, so all its styles are inline -->-
<div id="record_control" style="position:absolute;bottom:0;left:0;margin:0;padding:0.5em;width:22em;height:22em;border:1px solid;background:#ffd;font: normal normal 8pt sans-serif; color:#000; text-align: left">
<p style="margin:0 0 0 0; padding:0">
Expand Down

0 comments on commit c87074c

Please sign in to comment.