From 01587211cb0d98463d11bf8bc9ff02f5a18ca268 Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Sun, 2 Jun 2013 12:22:17 -0700 Subject: [PATCH] Unit test: secure connection check becomes async. Issue #10882: https://github.com/ariya/phantomjs/issues/10882 --- test/webpage-spec.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/webpage-spec.js b/test/webpage-spec.js index e04c2be6..403343d9 100644 --- a/test/webpage-spec.js +++ b/test/webpage-spec.js @@ -1095,16 +1095,19 @@ describe("WebPage object", function() { var page = require('webpage').create(); var url = 'https://www.google.com/m'; - var handled = false; + var loaded = false, handled = false; runs(function() { page.open(url, function(status) { + loaded = true; expect(status == 'success').toEqual(true); handled = true; }); }); - waits(3000); + waitsFor(function () { + return loaded; + }, 'Can not load ' + url, 3000); runs(function() { expect(handled).toEqual(true);