-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ios): server is receiving two consecutive calls for the same url …
…and cookies updated while reloading webview (#11427) * fix(ios): server is receiving two consecutive calls for the same url * fix(ios): cookies updated while reloading webview Co-authored-by: ssekhri <ssekhri@axway.com>
- Loading branch information
1 parent
a32f713
commit 8646a46
Showing
4 changed files
with
109 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Appcelerator Titanium Mobile | ||
* Copyright (c) 2011-Present by Appcelerator, Inc. All Rights Reserved. | ||
* Licensed under the terms of the Apache Public License | ||
* Please see the LICENSE included with this distribution for details. | ||
*/ | ||
/* eslint-env mocha */ | ||
/* eslint no-unused-expressions: "off" */ | ||
'use strict'; | ||
|
||
describe('Titanium.UI.WebView', function () { | ||
var win; | ||
this.slow(3000); | ||
this.timeout(30000); | ||
|
||
afterEach(function (done) { | ||
if (win) { | ||
// If `win` is already closed, we're done. | ||
let t = setTimeout(function () { | ||
if (win) { | ||
win = null; | ||
done(); | ||
} | ||
}, 3000); | ||
|
||
win.addEventListener('close', function listener () { | ||
clearTimeout(t); | ||
|
||
if (win) { | ||
win.removeEventListener('close', listener); | ||
} | ||
win = null; | ||
done(); | ||
}); | ||
win.close(); | ||
} else { | ||
win = null; | ||
done(); | ||
} | ||
}); | ||
|
||
it('requestHeaders with redirecting url should work properly', function (finish) { | ||
let webView; | ||
const url = 'https://jira.appcelerator.org/'; | ||
|
||
win = Ti.UI.createWindow(); | ||
webView = Ti.UI.createWebView({ | ||
url: url, | ||
requestHeaders: { 'Custom-field1': 'value1' } | ||
}); | ||
|
||
webView.addEventListener('load', function () { | ||
finish(); | ||
}); | ||
|
||
webView.addEventListener('error', function (e) { | ||
finish(e); | ||
}); | ||
|
||
win.add(webView); | ||
win.open(); | ||
}); | ||
}); |