Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add test to verify error
  • Loading branch information
bparrishMines committed Apr 22, 2022
commit e48695f0505206a869bd2a2f224fff306c051d0f
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,25 @@ - (void)testLoadRequest {
XCTAssertNil(error);
}

- (void)testLoadRequestWithInvalidUrl {
FWFWebView *mockWebView = OCMClassMock(FWFWebView.class);
OCMReject([mockWebView loadRequest:OCMOCK_ANY]);

FWFInstanceManager *instanceManager = [[FWFInstanceManager alloc] init];
[instanceManager addInstance:mockWebView withIdentifier:0];

FWFWebViewHostApiImpl *hostApi =
[[FWFWebViewHostApiImpl alloc] initWithInstanceManager:instanceManager];

FlutterError *error;
FWFNSUrlRequestData *requestData = [FWFNSUrlRequestData makeWithUrl:@"%invalidUrl%"
httpMethod:nil
httpBody:nil
allHttpHeaderFields:@{}];
[hostApi webView:@(0) loadRequest:requestData error:&error];
XCTAssertNotNil(error);
}

- (void)testSetCustomUserAgent {
FWFWebView *mockWebView = OCMClassMock(FWFWebView.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#import <Flutter/Flutter.h>
#import <WebKit/WebKit.h>
#import "FWFGeneratedWebKitApis.h"
#import "FWFInstanceManager.h"

Expand Down