Skip to content

Commit

Permalink
SimonStewart: Modifying the wait for page to load method to try and m…
Browse files Browse the repository at this point in the history
…ake it a little less hasty about returning

r11644
  • Loading branch information
shs96c committed Mar 9, 2011
1 parent 6aad526 commit 7887122
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ protected Void handleSeleneseCommand(final WebDriver driver, String timeout, Str
public boolean until() {
try {
Object result = ((JavascriptExecutor) driver).executeScript(
"return document['readyState'] ? 'complete' == document.readyState : true");
// TODO(simon): Extract the readystate jar and use that
"if (document['readyState']) { return 'complete' == document.readyState; }\n" +
"if (document.all) { return document.all.length > 0; }\n" +
"return true;");
if (result != null && result instanceof Boolean && (Boolean) result) {
long now = System.currentTimeMillis();
if (now - started > timeToWait) {
Expand Down

0 comments on commit 7887122

Please sign in to comment.