removed duplicate hide method in ios source and add jasmine test cases
This commit is contained in:
parent
df8bcaf751
commit
20c21f39df
@ -267,30 +267,6 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)hide:(CDVInvokedUrlCommand*)command
|
|
||||||
{
|
|
||||||
if (self.inAppBrowserViewController == nil) {
|
|
||||||
NSLog(@"Tried to hide IAB after it was closed.");
|
|
||||||
return;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
if (_previousStatusBarStyle == -1) {
|
|
||||||
NSLog(@"Tried to hide IAB while already hidden");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_previousStatusBarStyle = [UIApplication sharedApplication].statusBarStyle;
|
|
||||||
|
|
||||||
// Run later to avoid the "took a long time" log message.
|
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
|
||||||
if (self.inAppBrowserViewController != nil) {
|
|
||||||
_previousStatusBarStyle = -1;
|
|
||||||
[self.viewController dismissViewControllerAnimated:YES completion:nil];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)openInCordovaWebView:(NSURL*)url withOptions:(NSString*)options
|
- (void)openInCordovaWebView:(NSURL*)url withOptions:(NSString*)options
|
||||||
{
|
{
|
||||||
NSURLRequest* request = [NSURLRequest requestWithURL:url];
|
NSURLRequest* request = [NSURLRequest requestWithURL:url];
|
||||||
|
@ -98,6 +98,7 @@ exports.defineAutoTests = function () {
|
|||||||
expect(iabInstance.removeEventListener).toEqual(jasmine.any(Function));
|
expect(iabInstance.removeEventListener).toEqual(jasmine.any(Function));
|
||||||
expect(iabInstance.close).toEqual(jasmine.any(Function));
|
expect(iabInstance.close).toEqual(jasmine.any(Function));
|
||||||
expect(iabInstance.show).toEqual(jasmine.any(Function));
|
expect(iabInstance.show).toEqual(jasmine.any(Function));
|
||||||
|
expect(iabInstance.hide).toEqual(jasmine.any(Function));
|
||||||
expect(iabInstance.executeScript).toEqual(jasmine.any(Function));
|
expect(iabInstance.executeScript).toEqual(jasmine.any(Function));
|
||||||
expect(iabInstance.insertCSS).toEqual(jasmine.any(Function));
|
expect(iabInstance.insertCSS).toEqual(jasmine.any(Function));
|
||||||
});
|
});
|
||||||
@ -421,7 +422,9 @@ exports.defineManualTests = function (contentEl, createActionButton) {
|
|||||||
'<p/> <div id="closeHidden"></div>' +
|
'<p/> <div id="closeHidden"></div>' +
|
||||||
'Expected result: no output. But click on "show hidden" again and nothing should be shown.' +
|
'Expected result: no output. But click on "show hidden" again and nothing should be shown.' +
|
||||||
'<p/> <div id="openHiddenShow"></div>' +
|
'<p/> <div id="openHiddenShow"></div>' +
|
||||||
'Expected result: open successfully in InAppBrowser to https://www.google.co.uk';
|
'Expected result: open successfully in InAppBrowser to https://www.google.co.uk' +
|
||||||
|
'<p/> <div id="openVisibleAndHide"></div>' +
|
||||||
|
'Expected result: open successfully in InAppBrowser to https://www.google.co.uk. Hide after 2 seconds';
|
||||||
|
|
||||||
var clearing_cache_tests = '<h1>Clearing Cache</h1>' +
|
var clearing_cache_tests = '<h1>Clearing Cache</h1>' +
|
||||||
'<div id="openClearCache"></div>' +
|
'<div id="openClearCache"></div>' +
|
||||||
@ -620,6 +623,12 @@ exports.defineManualTests = function (contentEl, createActionButton) {
|
|||||||
createActionButton('google.co.uk Not Hidden', function () {
|
createActionButton('google.co.uk Not Hidden', function () {
|
||||||
openHidden('https://www.google.co.uk', false);
|
openHidden('https://www.google.co.uk', false);
|
||||||
}, 'openHiddenShow');
|
}, 'openHiddenShow');
|
||||||
|
createActionButton('google.co.uk shown for 2 seconds than hidden', function () {
|
||||||
|
var iab = doOpen('https://www.google.co.uk/', 'random_sting');
|
||||||
|
setTimeout(function () {
|
||||||
|
iab.hide();
|
||||||
|
}, 2000);
|
||||||
|
}, 'openVisibleAndHide');
|
||||||
|
|
||||||
//Clearing cache
|
//Clearing cache
|
||||||
createActionButton('Clear Browser Cache', function () {
|
createActionButton('Clear Browser Cache', function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user