Skip to content

Commit

Permalink
[CB-2308] Add Spec tests for InAppBrowser error channel
Browse files Browse the repository at this point in the history
  • Loading branch information
clelland authored and agrieve committed Mar 20, 2013
1 parent 7b41adc commit bcff8c8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions inappbrowser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@
},1000);
}

function openWithErrorHandler(url) {
var iab = window.open(url, '_blank', 'location=yes');
iab.addEventListener('loaderror',
function(error) {
alert("Error Channel Fired\nCode: " + error.code + "\nMessage: " +error.message);
}
);
}
</script>

</head>
Expand Down Expand Up @@ -90,6 +98,10 @@ <h1>Non White Listed URL</h1>
<h1>PDF URL</h1>
<div class="btn large" onclick="window.open('http://www.stluciadance.com/prospectus_file/sample.pdf');">Remote URL</div>
<div class="btn large" onclick="window.open('local.pdf', '_blank');">Local URL</div>
<h1>INVALID URL</h1>
<div class="btn large" onclick="openWithErrorHandler('x-ttp://www.invalid.com/');">Invalid Scheme</div>
<div class="btn large" onclick="openWithErrorHandler('http://www.inv;alid.com/');">Invalid Host</div>
<div class="btn large" onclick="openWithErrorHandler('nonexistent.html');">Missing File</div>
<h2> </h2><div class="backBtn" onclick="backHome();">Back</div>
</body>
</html>

0 comments on commit bcff8c8

Please sign in to comment.