Repository: cordova-mobile-spec Updated Branches: refs/heads/master 471ab597e -> 5949f4e71
CB-7491 Fixes bridge tests failure on windows Project: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/commit/71c7c56c Tree: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/tree/71c7c56c Diff: http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/diff/71c7c56c Branch: refs/heads/master Commit: 71c7c56cdab1f2eda70e981ad38055c4017717e3 Parents: 902e420 Author: Vladimir Kotikov <[email protected]> Authored: Tue Sep 9 15:42:52 2014 +0400 Committer: Vladimir Kotikov <[email protected]> Committed: Thu Oct 2 13:19:01 2014 +0400 ---------------------------------------------------------------------- www/autotest/tests/bridge.tests.js | 36 ++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/71c7c56c/www/autotest/tests/bridge.tests.js ---------------------------------------------------------------------- diff --git a/www/autotest/tests/bridge.tests.js b/www/autotest/tests/bridge.tests.js index b2ae043..788182e 100644 --- a/www/autotest/tests/bridge.tests.js +++ b/www/autotest/tests/bridge.tests.js @@ -20,18 +20,26 @@ */ describe('Bridge', function() { - if (cordova.platformId == 'android') { - it("bridge.spec.1 should reject bridge from iframe with data: URL", function() { - var ifr = document.createElement('iframe'); - var done = false; - ifr.src = 'data:text/html,'; - ifr.onload = function() { - var stolenSecret = ifr.contentWindow.prompt('', 'gap_init:'); - done = true; - expect(!!stolenSecret).toBe(false); - }; - document.body.appendChild(ifr); - waitsFor(function() { return done; }); - }); - } + + // Adding this spec is the way to show some useful information to user + // and to avoid failure of test framework (see CB-7491) + it("bridge spec will run on android only", function() { + + expect(cordova.platformId).toBe('android'); + + if (cordova.platformId == 'android') { + it("bridge.spec.1 should reject bridge from iframe with data: URL", function() { + var ifr = document.createElement('iframe'); + var done = false; + ifr.src = 'data:text/html,'; + ifr.onload = function() { + var stolenSecret = ifr.contentWindow.prompt('', 'gap_init:'); + done = true; + expect(!!stolenSecret).toBe(false); + }; + document.body.appendChild(ifr); + waitsFor(function() { return done; }); + }); + } + }); }); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
