Skip to content

Commit

Permalink
test: add WebView blockedURLs unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jquick-axway authored and sgtcoolguy committed Aug 21, 2020
1 parent 2ff006d commit aea22bf
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions tests/Resources/ti.ui.webview.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ describe('Titanium.UI.WebView', function () {
win.open();
});

// DEPRECATED: Since Titanium 9.2.0
it.ios('blacklisturl', function (finish) {
win = Ti.UI.createWindow();
const webView = Ti.UI.createWebView({
Expand All @@ -501,6 +502,47 @@ describe('Titanium.UI.WebView', function () {
win.open();
});

it.ios('blockedurl', function (finish) {
win = Ti.UI.createWindow();
const webView = Ti.UI.createWebView({
url: 'https://google.com',
blockedURLs: [ 'https://google.com' ]
});

webView.addEventListener('blockedurl', function () {
finish();
});
win.add(webView);
win.open();
});

// DEPRECATED: Since Titanium 9.2.0
it('blacklistedURLs', (finish) => {
win = Ti.UI.createWindow();
const webView = Ti.UI.createWebView({
url: 'https://www.axway.com',
blacklistedURLs: [ 'www.apple.com', 'www.google.com' ]
});
webView.addEventListener('load', () => {
finish();
});
win.add(webView);
win.open();
});

it('blockedURLs', (finish) => {
win = Ti.UI.createWindow();
const webView = Ti.UI.createWebView({
url: 'https://www.axway.com',
blockedURLs: [ 'www.apple.com', 'www.google.com' ]
});
webView.addEventListener('load', () => {
finish();
});
win.add(webView);
win.open();
});

it.ios('basicAuthentication', function (finish) {
const url = 'https://httpbin.org/basic-auth/user/password';

Expand Down

0 comments on commit aea22bf

Please sign in to comment.