Skip to content

Commit 83dae97

Browse files
updated integration tests
1 parent 75c7473 commit 83dae97

File tree

7 files changed

+34
-57
lines changed

7 files changed

+34
-57
lines changed

example/integration_test/.env.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
final environment = {"NODE_SERVER_IP":"192.168.1.129"};
1+
final environment = {"NODE_SERVER_IP":"192.168.1.123"};

example/integration_test/webview_flutter_test.dart

+7-6
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ void main() {
397397
late File fileJs;
398398

399399
setUpAll(() async {
400-
appSupportDir = (await getApplicationSupportDirectory())!;
400+
appSupportDir = (await getApplicationSupportDirectory());
401401

402402
final Directory htmlFolder = Directory('${appSupportDir.path}/html/');
403403
if (!await htmlFolder.exists()) {
@@ -476,7 +476,7 @@ void main() {
476476
}, skip: !Platform.isIOS);
477477

478478
testWidgets(
479-
'loadUrl with file:// scheme and iosAllowingReadAccessTo argument',
479+
'loadUrl with file:// scheme and allowingReadAccessTo argument',
480480
(WidgetTester tester) async {
481481
final Completer<ConsoleMessage?> consoleMessageShouldNotComplete =
482482
Completer<ConsoleMessage?>();
@@ -511,7 +511,7 @@ void main() {
511511
controller.loadUrl(
512512
urlRequest:
513513
URLRequest(url: Uri.parse('file://${fileHtml.path}')),
514-
iosAllowingReadAccessTo:
514+
allowingReadAccessTo:
515515
Uri.parse('file://${appSupportDir.path}/'));
516516
},
517517
onConsoleMessage: (controller, consoleMessage) {
@@ -1558,6 +1558,7 @@ void main() {
15581558
onWebViewCreated: (controller) {
15591559
controllerCompleter.complete(controller);
15601560
},
1561+
initialUrlRequest: URLRequest(url: Uri.parse("about:blank")),
15611562
initialOptions: InAppWebViewGroupOptions(
15621563
crossPlatform: InAppWebViewOptions(
15631564
javaScriptEnabled: true,
@@ -3804,7 +3805,7 @@ setTimeout(function() {
38043805
""",
38053806
encoding: 'utf-8',
38063807
mimeType: 'text/html',
3807-
androidHistoryUrl: Uri.parse("https://flutter.dev"),
3808+
historyUrl: Uri.parse("https://flutter.dev"),
38083809
baseUrl: Uri.parse("https://flutter.dev"));
38093810
await pageLoads.stream.first;
38103811

@@ -4550,7 +4551,7 @@ setTimeout(function() {
45504551
await pageLoaded.future;
45514552

45524553
await expectLater(
4553-
controller.zoomBy(zoomFactor: 3.0, iosAnimated: true), completes);
4554+
controller.zoomBy(zoomFactor: 3.0, animated: true), completes);
45544555
});
45554556

45564557
testWidgets('getZoomScale', (WidgetTester tester) async {
@@ -4853,7 +4854,7 @@ setTimeout(function() {
48534854
fileName = fileName + WebArchiveFormat.WEBARCHIVE.toValue();
48544855
}
48554856

4856-
var fullPath = supportDir!.path + Platform.pathSeparator + fileName;
4857+
var fullPath = supportDir.path + Platform.pathSeparator + fileName;
48574858
var path = await controller.saveWebArchive(filePath: fullPath);
48584859
expect(path, isNotNull);
48594860
expect(path, endsWith(fileName));

example/ios/Flutter/Flutter.podspec

-18
This file was deleted.

example/ios/Flutter/flutter_export_environment.sh

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
export "FLUTTER_ROOT=/Users/lorenzopichilli/fvm/versions/2.10.4"
44
export "FLUTTER_APPLICATION_PATH=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example"
55
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
6-
export "FLUTTER_TARGET=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example/lib/main.dart"
6+
export "FLUTTER_TARGET=lib/main.dart"
77
export "FLUTTER_BUILD_DIR=build"
88
export "FLUTTER_BUILD_NAME=1.0.0"
99
export "FLUTTER_BUILD_NUMBER=1"
10-
export "DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ=="
1110
export "DART_OBFUSCATION=false"
12-
export "TRACK_WIDGET_CREATION=true"
11+
export "TRACK_WIDGET_CREATION=false"
1312
export "TREE_SHAKE_ICONS=false"
14-
export "PACKAGE_CONFIG=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example/.dart_tool/package_config.json"
13+
export "PACKAGE_CONFIG=.packages"

example/ios/Runner.xcodeproj/project.pbxproj

+6-12
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/* Begin PBXBuildFile section */
1010
020EF14E4245221B2C22ACE5 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B0FC2CF7A6002799890B3102 /* Pods_Runner.framework */; };
1111
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
12-
25A517508F43E58C47090625 /* BuildFile in Frameworks */ = {isa = PBXBuildFile; };
12+
25A517508F43E58C47090625 /* (null) in Frameworks */ = {isa = PBXBuildFile; };
1313
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
1414
61FF730023634CA10069C557 /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 61FF72FF23634CA10069C557 /* libsqlite3.tbd */; };
1515
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
@@ -58,7 +58,7 @@
5858
buildActionMask = 2147483647;
5959
files = (
6060
61FF730023634CA10069C557 /* libsqlite3.tbd in Frameworks */,
61-
25A517508F43E58C47090625 /* BuildFile in Frameworks */,
61+
25A517508F43E58C47090625 /* (null) in Frameworks */,
6262
020EF14E4245221B2C22ACE5 /* Pods_Runner.framework in Frameworks */,
6363
);
6464
runOnlyForDeploymentPostprocessing = 0;
@@ -451,15 +451,12 @@
451451
"$(PROJECT_DIR)/Flutter",
452452
);
453453
INFOPLIST_FILE = Runner/Info.plist;
454-
LD_RUNPATH_SEARCH_PATHS = (
455-
"$(inherited)",
456-
"@executable_path/Frameworks",
457-
);
454+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
458455
LIBRARY_SEARCH_PATHS = (
459456
"$(inherited)",
460457
"$(PROJECT_DIR)/Flutter",
461458
);
462-
PRODUCT_BUNDLE_IDENTIFIER = "flutter-inappwebviewExample";
459+
PRODUCT_BUNDLE_IDENTIFIER = "com.pichillilorenzo.flutter-inappwebview-Example";
463460
PRODUCT_NAME = "$(TARGET_NAME)";
464461
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
465462
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -482,15 +479,12 @@
482479
"$(PROJECT_DIR)/Flutter",
483480
);
484481
INFOPLIST_FILE = Runner/Info.plist;
485-
LD_RUNPATH_SEARCH_PATHS = (
486-
"$(inherited)",
487-
"@executable_path/Frameworks",
488-
);
482+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
489483
LIBRARY_SEARCH_PATHS = (
490484
"$(inherited)",
491485
"$(PROJECT_DIR)/Flutter",
492486
);
493-
PRODUCT_BUNDLE_IDENTIFIER = com.pichillilorenzo.flutter_inappwebviewExample;
487+
PRODUCT_BUNDLE_IDENTIFIER = "com.pichillilorenzo.flutter-inappwebview-Example";
494488
PRODUCT_NAME = "$(TARGET_NAME)";
495489
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
496490
SWIFT_VERSION = 5.0;

example/ios/Runner/Info.plist

+14-14
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>NSDocumentsFolderUsageDescription</key>
6-
<string>InAppWebView requires access to documents folder</string>
7-
<key>NSMicrophoneUsageDescription</key>
8-
<string>InAppWebView requires access to mic.</string>
95
<key>CFBundleDevelopmentRegion</key>
106
<string>en</string>
117
<key>CFBundleExecutable</key>
@@ -28,19 +24,31 @@
2824
<true/>
2925
<key>NSAppTransportSecurity</key>
3026
<dict>
31-
<key>NSAllowsArbitraryLoadsInWebContent</key>
32-
<true/>
3327
<key>NSAllowsArbitraryLoads</key>
3428
<true/>
29+
<key>NSAllowsArbitraryLoadsInWebContent</key>
30+
<true/>
3531
<key>NSAllowsLocalNetworking</key>
3632
<true/>
3733
</dict>
34+
<key>NSBonjourServices</key>
35+
<array>
36+
<string>_dartobservatory._tcp</string>
37+
</array>
38+
<key>NSCameraUsageDescription</key>
39+
<string>InAppWebView requires access to cam.</string>
40+
<key>NSDocumentsFolderUsageDescription</key>
41+
<string>InAppWebView requires access to documents folder</string>
42+
<key>NSLocalNetworkUsageDescription</key>
43+
<string>Allow Flutter tools on your computer to connect and debug your application.</string>
3844
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
3945
<string>Need location</string>
4046
<key>NSLocationAlwaysUsageDescription</key>
4147
<string>Need location</string>
4248
<key>NSLocationWhenInUseUsageDescription</key>
4349
<string>Need location</string>
50+
<key>NSMicrophoneUsageDescription</key>
51+
<string>InAppWebView requires access to mic.</string>
4452
<key>UIBackgroundModes</key>
4553
<array>
4654
<string>fetch</string>
@@ -63,15 +71,7 @@
6371
<string>UIInterfaceOrientationLandscapeLeft</string>
6472
<string>UIInterfaceOrientationLandscapeRight</string>
6573
</array>
66-
<key>NSBonjourServices</key>
67-
<array>
68-
<string>_dartobservatory._tcp</string>
69-
</array>
7074
<key>UIViewControllerBasedStatusBarAppearance</key>
7175
<false/>
72-
<key>NSCameraUsageDescription</key>
73-
<string>InAppWebView requires access to cam.</string>
74-
<key>NSLocalNetworkUsageDescription</key>
75-
<string>Allow Flutter tools on your computer to connect and debug your application.</string>
7676
</dict>
7777
</plist>

scripts/test.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ function error() {
77
echo "$@" 1>&2
88
}
99

10-
# on macOS local IP can be found using $(ipconfig getifaddr en0)
11-
# on linux local IP can be found using $(ifconfig en0 | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}') or $(ip route get 1 | awk '{print $NF;exit}')
10+
# on macOS local IP can be found using something like $(ipconfig getifaddr en0)
11+
# on linux local IP can be found using something like $(ifconfig en0 | grep "inet " | grep -Fv 127.0.0.1 | awk '{print $2}') or $(ip route get 1 | awk '{print $NF;exit}')
1212
export NODE_SERVER_IP=$1
1313
FAILED=0
1414

@@ -17,6 +17,7 @@ dart $PROJECT_DIR/tool/env.dart
1717
cd $PROJECT_DIR/nodejs_server_test_auth_basic_and_ssl
1818
node index.js &
1919

20+
flutter --version
2021
flutter clean
2122
cd $PROJECT_DIR/example
2223
flutter clean

0 commit comments

Comments
 (0)