mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
3
apps/app/ui-tests-app/web-view/web-view-error.ts
Normal file
3
apps/app/ui-tests-app/web-view/web-view-error.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export function onLoadFinished(args) {
|
||||||
|
console.log("### onLoadFinished with error: " + args.error);
|
||||||
|
}
|
3
apps/app/ui-tests-app/web-view/web-view-error.xml
Normal file
3
apps/app/ui-tests-app/web-view/web-view-error.xml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<Page>
|
||||||
|
<WebView src="https://www.google.com" loadFinished="onLoadFinished" />
|
||||||
|
</Page>
|
@ -127,27 +127,6 @@ export class WebViewTest extends testModule.UITest<webViewModule.WebView> {
|
|||||||
// << webview-string
|
// << webview-string
|
||||||
}
|
}
|
||||||
|
|
||||||
public testLoadInvalidUrl(done) {
|
|
||||||
let webView = this.testView;
|
|
||||||
let actualError;
|
|
||||||
|
|
||||||
webView.on(webViewModule.WebView.loadFinishedEvent, function (args: webViewModule.LoadEventData) {
|
|
||||||
if (actualError) {
|
|
||||||
// Android call this twice -- the second time args.error is undefined.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
actualError = args.error;
|
|
||||||
try {
|
|
||||||
TKUnit.assert(actualError !== undefined, "There should be an error.");
|
|
||||||
done(null);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
done(e);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
webView.src = "kofti://mnogokofti";
|
|
||||||
}
|
|
||||||
|
|
||||||
public testLoadUpperCaseSrc(done) {
|
public testLoadUpperCaseSrc(done) {
|
||||||
let webView = this.testView;
|
let webView = this.testView;
|
||||||
let targetSrc = "HTTPS://github.com/";
|
let targetSrc = "HTTPS://github.com/";
|
||||||
|
Reference in New Issue
Block a user