Commit ec47b191 authored by Lorenzo Pichilli's avatar Lorenzo Pichilli

fixed android content blocker, updated flutter driver tests

parent 64f6995d
...@@ -9,6 +9,7 @@ about: Something is crashing or not working as intended ...@@ -9,6 +9,7 @@ about: Something is crashing or not working as intended
**App version:** <!-- Add branch if necessary --> **App version:** <!-- Add branch if necessary -->
**Android version:** <!-- If customize ROM, write which --> **Android version:** <!-- If customize ROM, write which -->
**Device information:** <!-- Manufacturer and model --> **Device information:** <!-- Manufacturer and model -->
**Flutter version:** <!-- Flutter version used -->
## Description ## Description
......
...@@ -15,23 +15,50 @@ ...@@ -15,23 +15,50 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="9b41f7a2-a71e-4923-91fb-249d7815b3e7" name="Default" comment=""> <list default="true" id="9b41f7a2-a71e-4923-91fb-249d7815b3e7" name="Default" comment="">
<change afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_received_http_auth_request_test.dart" afterDir="false" /> <change afterPath="$PROJECT_DIR$/example/test_assets/in_app_webview_on_navigation_state_change_test.html" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_safe_browsing_hit_test.dart" afterDir="false" /> <change afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_content_blocker_test.dart" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_cookie_manager_test.dart" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_http_auth_credential_database_test.dart" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_initial_data_test.dart" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_find_result_received_test.dart" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_load_error_test.dart" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_load_http_error_test.dart" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_navigation_state_change_test.dart" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_progress_changed_test.dart" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_scroll_changed_test.dart" afterDir="false" />
<change afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_ssl_request_test.dart" afterDir="false" />
<change afterPath="$PROJECT_DIR$/test.sh" afterDir="false" />
<change afterPath="$PROJECT_DIR$/tool/env.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.github/ISSUE_TEMPLATE/BUG_REPORT.md" beforeDir="false" afterPath="$PROJECT_DIR$/.github/ISSUE_TEMPLATE/BUG_REPORT.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/CHANGELOG.md" beforeDir="false" afterPath="$PROJECT_DIR$/CHANGELOG.md" afterDir="false" /> <change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/ContentBlocker/ContentBlockerHandler.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/ContentBlocker/ContentBlockerHandler.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebChromeClient.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebViewChromeClient.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/example/ios/Flutter/flutter_export_environment.sh" beforeDir="false" afterPath="$PROJECT_DIR$/example/ios/Flutter/flutter_export_environment.sh" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebViewClient.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebViewClient.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/lib/chrome_safari_browser_example.screen.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/lib/chrome_safari_browser_example.screen.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/lib/in_app_browser_example.screen.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/lib/in_app_browser_example.screen.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart" afterDir="false" /> <change beforePath="$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/pubspec.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/example/pubspec.yaml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/test_assets/in_app_webview_ajax_test.html" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/example/test_assets/in_app_webview_fetch_test.html" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/example/test_assets/in_app_webview_on_download_start_test.html" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/example/test_driver/app.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/test_driver/app.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/test_driver/app_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/test_driver/app_test.dart" afterDir="false" /> <change beforePath="$PROJECT_DIR$/example/test_driver/app_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/test_driver/app_test.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/test_driver/custom_widget_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/test_driver/custom_widget_test.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/test_driver/in_app_webview_ajax_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_ajax_test.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/test_driver/in_app_webview_fetch_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_fetch_test.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/test_driver/in_app_webview_initial_file_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_initial_file_test.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/test_driver/in_app_webview_initial_url_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_initial_url_test.dart" afterDir="false" /> <change beforePath="$PROJECT_DIR$/example/test_driver/in_app_webview_initial_url_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_initial_url_test.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/test_driver/in_app_webview_javascript_handler_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_javascript_handler_test.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_console_message_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_console_message_test.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_download_start_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_download_start_test.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_js_dialog_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_js_dialog_test.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_load_resource_custom_scheme_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_load_resource_custom_scheme_test.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_load_resource_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_load_resource_test.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_received_http_auth_request_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_received_http_auth_request_test.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_safe_browsing_hit_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_safe_browsing_hit_test.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_target_blank_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_on_target_blank_test.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/test_driver/in_app_webview_should_override_url_loading_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/test_driver/in_app_webview_should_override_url_loading_test.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/test_driver/main_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/test_driver/main_test.dart" afterDir="false" /> <change beforePath="$PROJECT_DIR$/example/test_driver/main_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/test_driver/main_test.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ios/Classes/InAppWebView.swift" beforeDir="false" afterPath="$PROJECT_DIR$/ios/Classes/InAppWebView.swift" afterDir="false" /> <change beforePath="$PROJECT_DIR$/example/test_driver/util_test.dart" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/content_blocker.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/content_blocker.dart" afterDir="false" /> <change beforePath="$PROJECT_DIR$/lib/src/content_blocker.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/content_blocker.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/in_app_browser.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/in_app_browser.dart" afterDir="false" /> <change beforePath="$PROJECT_DIR$/lib/src/cookie_manager.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/cookie_manager.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/in_app_webview.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/in_app_webview.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/types.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/types.dart" afterDir="false" /> <change beforePath="$PROJECT_DIR$/lib/src/types.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/types.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/index.js" afterDir="false" /> <change beforePath="$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/index.js" afterDir="false" />
</list> </list>
...@@ -56,8 +83,8 @@ ...@@ -56,8 +83,8 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/types.dart"> <entry file="file://$PROJECT_DIR$/lib/src/types.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-195"> <state relative-caret-position="383">
<caret line="344" column="6" selection-start-line="344" selection-start-column="6" selection-end-line="344" selection-end-column="6" /> <caret line="1585" column="9" selection-start-line="1585" selection-start-column="9" selection-end-line="1585" selection-end-column="9" />
<folding> <folding>
<element signature="e#0#20#0" expanded="true" /> <element signature="e#0#20#0" expanded="true" />
</folding> </folding>
...@@ -66,19 +93,10 @@ ...@@ -66,19 +93,10 @@
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/test_driver/app_test.dart"> <entry file="file://$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-6">
<caret line="207" selection-start-line="207" selection-end-line="207" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/test_driver/main_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="284"> <state relative-caret-position="420">
<caret line="37" column="94" selection-start-line="37" selection-start-column="94" selection-end-line="37" selection-end-column="94" /> <caret line="73" column="23" selection-start-line="73" selection-start-column="23" selection-end-line="73" selection-end-column="23" />
<folding> <folding>
<element signature="e#0#20#0" expanded="true" /> <element signature="e#0#20#0" expanded="true" />
</folding> </folding>
...@@ -86,23 +104,23 @@ ...@@ -86,23 +104,23 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_load_http_error_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="254"> <state relative-caret-position="94">
<caret line="97" column="63" selection-start-line="97" selection-start-column="63" selection-end-line="97" selection-end-column="63" /> <caret line="29" column="38" selection-start-line="29" selection-start-column="38" selection-end-line="29" selection-end-column="38" />
<folding> <folding>
<element signature="e#0#20#0" expanded="true" /> <element signature="e#0#39#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="true"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/lib/chrome_safari_browser_example.screen.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_console_message_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="432"> <state relative-caret-position="492">
<caret line="70" column="48" selection-start-line="70" selection-start-column="48" selection-end-line="70" selection-end-column="48" /> <caret line="49" column="22" selection-start-line="45" selection-start-column="20" selection-end-line="49" selection-end-column="22" />
<folding> <folding>
<element signature="e#0#39#0" expanded="true" /> <element signature="e#0#39#0" expanded="true" />
</folding> </folding>
...@@ -111,43 +129,48 @@ ...@@ -111,43 +129,48 @@
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/in_app_webview.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_load_error_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="152"> <state relative-caret-position="362">
<caret line="348" column="14" selection-start-line="348" selection-start-column="7" selection-end-line="348" selection-end-column="14" /> <caret line="50" column="21" selection-start-line="46" selection-start-column="20" selection-end-line="50" selection-end-column="21" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_safe_browsing_hit_test.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/main_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="242"> <state relative-caret-position="459">
<caret line="61" column="22" selection-start-line="61" selection-start-column="22" selection-end-line="61" selection-end-column="22" /> <caret line="115" column="25" selection-start-line="115" selection-start-column="16" selection-end-line="115" selection-end-column="25" />
<folding> <folding>
<element signature="e#0#17#0" expanded="true" /> <element signature="e#0#20#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/test_driver/util_test.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/app.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="225"> <state>
<caret line="15" column="36" selection-start-line="15" selection-start-column="16" selection-end-line="15" selection-end-column="36" />
<folding> <folding>
<element signature="e#0#20#0" expanded="true" /> <element signature="e#0#54#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/index.js"> <entry file="file://$PROJECT_DIR$/example/test_driver/app_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="423"> <state relative-caret-position="127">
<caret line="91" column="22" selection-start-line="91" selection-start-column="12" selection-end-line="91" selection-end-column="22" /> <caret line="503" column="45" selection-start-line="503" selection-start-column="45" selection-end-line="503" selection-end-column="45" />
<folding>
<element signature="e#35#55#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
...@@ -158,34 +181,12 @@ ...@@ -158,34 +181,12 @@
<option name="RECENT_TEMPLATES"> <option name="RECENT_TEMPLATES">
<list> <list>
<option value="Class" /> <option value="Class" />
<option value="Dart File" />
</list> </list>
</option> </option>
</component> </component>
<component name="FindInProjectRecents"> <component name="FindInProjectRecents">
<findStrings> <findStrings>
<find>removeJavaScriptHandler</find>
<find>__safeBrowsingEnabled__</find>
<find>__safe</find>
<find>__textZoom</find>
<find>hidden</find>
<find>builtInZoomControls</find>
<find>__builtInZoomControls__</find>
<find>android.support.v4</find>
<find>__transparentBackground__</find>
<find>_dispose</find>
<find>ù</find>
<find>setC</find>
<find>_textFieldController</find>
<find>in_app_webview_on_target_blank_test</find>
<find>createPromptDialog</find>
<find>houldOverrideUrlLoad</find>
<find>InAppWebViewShouldOverrideUrlLoadingTest</find>
<find>toValue</find>
<find>toValue()</find>
<find>url</find>
<find>targetB</find>
<find>availa</find>
<find>onLoadHttpError</find>
<find>onReceivedHttpAuthRequest</find> <find>onReceivedHttpAuthRequest</find>
<find>onLoadHtt</find> <find>onLoadHtt</find>
<find>onLoadError</find> <find>onLoadError</find>
...@@ -193,6 +194,29 @@ ...@@ -193,6 +194,29 @@
<find>onSafeBrowsingHit</find> <find>onSafeBrowsingHit</find>
<find>dispose</find> <find>dispose</find>
<find>onSafe</find> <find>onSafe</find>
<find>192.1</find>
<find>flutter</find>
<find>InAppWebView</find>
<find>onFindResultReceived</find>
<find>highlighted</find>
<find>onLoadErr</find>
<find>InAppWebViewInitialFileTest</find>
<find>InAppWebViewInitialDataTest</find>
<find>Fetch</find>
<find>OnLoadHttpError</find>
<find>ONnaviga</find>
<find>InAppWebViewOnNavigationChangeTest</find>
<find>InAppWebViewOnReceivedHttpAuthRequestTest</find>
<find>.css</find>
<find>InAppWebViewOnSafeBrowsingHitTest</find>
<find>InAppWebViewHttpAuthCredentialDatabaseTest</find>
<find>InAppWebViewOnFindResultReceivedTest</find>
<find>InAppWebViewOnProgressChangedTest</find>
<find>nextTest</find>
<find>clear</find>
<find>InAppWebViewOnScrollChangedTest</find>
<find>InAppWebViewOnConsoleMessageTest</find>
<find>Change:</find>
</findStrings> </findStrings>
<replaceStrings> <replaceStrings>
<replace>activity.getPreferences(0)</replace> <replace>activity.getPreferences(0)</replace>
...@@ -210,61 +234,61 @@ ...@@ -210,61 +234,61 @@
<component name="IdeDocumentHistory"> <component name="IdeDocumentHistory">
<option name="CHANGED_PATHS"> <option name="CHANGED_PATHS">
<list> <list>
<option value="$PROJECT_DIR$/android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppBrowser.java" />
<option value="$PROJECT_DIR$/ios/flutter_inappbrowser.podspec" />
<option value="$PROJECT_DIR$/example/ios/Podfile" />
<option value="$PROJECT_DIR$/example/html/css/style.css" />
<option value="$PROJECT_DIR$/example/html/index.html" />
<option value="$PROJECT_DIR$/example/ios/Flutter/Generated.xcconfig" />
<option value="$PROJECT_DIR$/example/ios/Runner/Info.plist" />
<option value="$PROJECT_DIR$/android/gradle/wrapper/gradle-wrapper.properties" />
<option value="$PROJECT_DIR$/example/android/app/build.gradle" />
<option value="$PROJECT_DIR$/example/android/gradle.properties" />
<option value="$PROJECT_DIR$/android/build.gradle" />
<option value="$PROJECT_DIR$/example/android/build.gradle" />
<option value="$PROJECT_DIR$/example/assets/page-3.html" />
<option value="$PROJECT_DIR$/example/lib/chrome_safari_example.screen.dart" />
<option value="$PROJECT_DIR$/example/lib/test.dart" />
<option value="$PROJECT_DIR$/example/lib/main.dart" />
<option value="$PROJECT_DIR$/example/assets/page-2.html" />
<option value="$PROJECT_DIR$/example/assets/page-1.html" />
<option value="$PROJECT_DIR$/pubspec.yaml" />
<option value="$PROJECT_DIR$/example/assets/css/style.css" />
<option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/lib/flutter_inappbrowser.dart" />
<option value="$PROJECT_DIR$/example/lib/inline_example.screen.dart" />
<option value="$PROJECT_DIR$/example/lib/webview_example.screen.dart" />
<option value="$PROJECT_DIR$/../cartella senza titolo/flutter_inappbrowser/ios/Classes/MyCookieManager.swift" />
<option value="$PROJECT_DIR$/../cartella senza titolo/flutter_inappbrowser/pubspec.yaml" />
<option value="$PROJECT_DIR$/../cartella senza titolo/flutter_inappbrowser/CHANGELOG.md" />
<option value="$PROJECT_DIR$/example/test_assets/in_app_webview_on_js_dialog_test.html" />
<option value="$PROJECT_DIR$/example/pubspec.yaml" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_console_message_test.dart" />
<option value="$PROJECT_DIR$/example/test_assets/in_app_webview_initial_file_test.html" /> <option value="$PROJECT_DIR$/example/test_assets/in_app_webview_initial_file_test.html" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_should_override_url_loading_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_js_dialog_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_download_start_test.dart" />
<option value="$PROJECT_DIR$/example/test_assets/in_app_webview_on_target_blank_test.html" /> <option value="$PROJECT_DIR$/example/test_assets/in_app_webview_on_target_blank_test.html" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_target_blank_test.dart" />
<option value="$PROJECT_DIR$/example/assets/index.html" /> <option value="$PROJECT_DIR$/example/assets/index.html" />
<option value="$PROJECT_DIR$/lib/src/types.dart" />
<option value="$PROJECT_DIR$/lib/src/content_blocker.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_initial_url_test.dart" />
<option value="$PROJECT_DIR$/CHANGELOG.md" /> <option value="$PROJECT_DIR$/CHANGELOG.md" />
<option value="$PROJECT_DIR$/lib/src/in_app_browser.dart" /> <option value="$PROJECT_DIR$/lib/src/in_app_browser.dart" />
<option value="$PROJECT_DIR$/example/test_driver/main_test.dart" />
<option value="$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/index.js" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_received_http_auth_request_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/app_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_safe_browsing_hit_test.dart" />
<option value="$PROJECT_DIR$/lib/src/in_app_webview.dart" /> <option value="$PROJECT_DIR$/lib/src/in_app_webview.dart" />
<option value="$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart" />
<option value="$PROJECT_DIR$/example/lib/in_app_browser_example.screen.dart" /> <option value="$PROJECT_DIR$/example/lib/in_app_browser_example.screen.dart" />
<option value="$PROJECT_DIR$/example/lib/chrome_safari_browser_example.screen.dart" /> <option value="$PROJECT_DIR$/example/lib/chrome_safari_browser_example.screen.dart" />
<option value="$PROJECT_DIR$/tool/env.dart" />
<option value="$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/index.js" />
<option value="$PROJECT_DIR$/example/test_assets/in_app_webview_on_navigation_change_test.html" />
<option value="$PROJECT_DIR$/test.sh" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_navigation_change_test.dart" />
<option value="$PROJECT_DIR$/example/test_assets/in_app_webview_on_navigation_state_change_test.html" />
<option value="$PROJECT_DIR$/example/pubspec.yaml" />
<option value="$PROJECT_DIR$/lib/src/content_blocker.dart" />
<option value="$PROJECT_DIR$/lib/src/types.dart" />
<option value="$PROJECT_DIR$/lib/src/cookie_manager.dart" />
<option value="$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart" />
<option value="$PROJECT_DIR$/example/test_driver/app.dart" />
<option value="$PROJECT_DIR$/example/test_driver/util_test.dart" />
<option value="$PROJECT_DIR$/lib/src/webview_options.dart" />
<option value="$PROJECT_DIR$/example/test_driver/custom_widget_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_initial_url_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_ajax_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_content_blocker_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_cookie_manager_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_fetch_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_initial_data_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_initial_file_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_javascript_handler_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_console_message_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_download_start_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_find_result_received_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_js_dialog_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_load_error_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_load_resource_custom_scheme_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_load_resource_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_navigation_state_change_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_progress_changed_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_received_http_auth_request_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_safe_browsing_hit_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_scroll_changed_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_target_blank_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_should_override_url_loading_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/main_test.dart" />
<option value="$PROJECT_DIR$/.github/ISSUE_TEMPLATE/BUG_REPORT.md" />
<option value="$PROJECT_DIR$/example/test_driver/app_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_ssl_request_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_http_auth_credential_database_test.dart" />
<option value="$PROJECT_DIR$/example/test_driver/in_app_webview_on_load_http_error_test.dart" />
</list> </list>
</option> </option>
</component> </component>
<component name="ProjectFrameBounds" extendedState="6"> <component name="ProjectFrameBounds">
<option name="y" value="23" /> <option name="y" value="23" />
<option name="width" value="1920" /> <option name="width" value="1920" />
<option name="height" value="1057" /> <option name="height" value="1057" />
...@@ -275,6 +299,17 @@ ...@@ -275,6 +299,17 @@
<foldersAlwaysOnTop value="true" /> <foldersAlwaysOnTop value="true" />
</navigator> </navigator>
<panes> <panes>
<pane id="Scope">
<subPane subId="Project Files">
<expand>
<path>
<item name="Root" type="cbb8eebc:String" user="Root" />
<item name="flutter_inappbrowser" type="cbb8eebc:String" user="flutter_inappbrowser" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="AndroidView"> <pane id="AndroidView">
<subPane> <subPane>
<expand> <expand>
...@@ -320,7 +355,7 @@ ...@@ -320,7 +355,7 @@
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" /> <item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
<item name="flutter_inappbrowser" type="462c0819:PsiDirectoryNode" /> <item name="flutter_inappbrowser" type="462c0819:PsiDirectoryNode" />
<item name="example" type="462c0819:PsiDirectoryNode" /> <item name="example" type="462c0819:PsiDirectoryNode" />
<item name="lib" type="462c0819:PsiDirectoryNode" /> <item name="test_assets" type="462c0819:PsiDirectoryNode" />
</path> </path>
<path> <path>
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" /> <item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
...@@ -341,18 +376,12 @@ ...@@ -341,18 +376,12 @@
</path> </path>
<path> <path>
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" /> <item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
<item name="External Libraries" type="cb654da1:ExternalLibrariesNode" /> <item name="flutter_inappbrowser" type="462c0819:PsiDirectoryNode" />
<item name="tool" type="462c0819:PsiDirectoryNode" />
</path> </path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope">
<subPane subId="Project Files">
<expand>
<path> <path>
<item name="Root" type="cbb8eebc:String" user="Root" /> <item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
<item name="flutter_inappbrowser" type="cbb8eebc:String" user="flutter_inappbrowser" /> <item name="External Libraries" type="cb654da1:ExternalLibrariesNode" />
</path> </path>
</expand> </expand>
<select /> <select />
...@@ -378,10 +407,6 @@ ...@@ -378,10 +407,6 @@
<property name="show.migrate.to.gradle.popup" value="false" /> <property name="show.migrate.to.gradle.popup" value="false" />
</component> </component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/example/assets/images" />
<recent name="$PROJECT_DIR$/android/src/main/java" />
</key>
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/example/test_driver" /> <recent name="$PROJECT_DIR$/example/test_driver" />
<recent name="$PROJECT_DIR$/example/test_assets" /> <recent name="$PROJECT_DIR$/example/test_assets" />
...@@ -389,6 +414,10 @@ ...@@ -389,6 +414,10 @@
<recent name="$PROJECT_DIR$/example/assets/images" /> <recent name="$PROJECT_DIR$/example/assets/images" />
<recent name="$PROJECT_DIR$/android/libs" /> <recent name="$PROJECT_DIR$/android/libs" />
</key> </key>
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/example/assets/images" />
<recent name="$PROJECT_DIR$/android/src/main/java" />
</key>
</component> </component>
<component name="RunDashboard"> <component name="RunDashboard">
<option name="ruleStates"> <option name="ruleStates">
...@@ -509,7 +538,7 @@ ...@@ -509,7 +538,7 @@
<frame x="0" y="23" width="1920" height="1057" extended-state="6" /> <frame x="0" y="23" width="1920" height="1057" extended-state="6" />
<editor active="true" /> <editor active="true" />
<layout> <layout>
<window_info active="true" content_ui="combo" id="Project" order="0" sideWeight="0.6177474" visible="true" weight="0.20766774" /> <window_info content_ui="combo" id="Project" order="0" sideWeight="0.6177474" visible="true" weight="0.20766774" />
<window_info id="Structure" order="1" sideWeight="0.38225257" side_tool="true" weight="0.2087327" /> <window_info id="Structure" order="1" sideWeight="0.38225257" side_tool="true" weight="0.2087327" />
<window_info id="Designer" order="2" /> <window_info id="Designer" order="2" />
<window_info id="Build Variants" order="3" side_tool="true" /> <window_info id="Build Variants" order="3" side_tool="true" />
...@@ -528,7 +557,7 @@ ...@@ -528,7 +557,7 @@
<window_info anchor="bottom" id="Android Profiler" order="7" show_stripe_button="false" /> <window_info anchor="bottom" id="Android Profiler" order="7" show_stripe_button="false" />
<window_info anchor="bottom" id="Event Log" order="8" sideWeight="0.50532484" side_tool="true" weight="0.35751295" /> <window_info anchor="bottom" id="Event Log" order="8" sideWeight="0.50532484" side_tool="true" weight="0.35751295" />
<window_info anchor="bottom" id="Version Control" order="9" /> <window_info anchor="bottom" id="Version Control" order="9" />
<window_info anchor="bottom" id="Terminal" order="10" sideWeight="0.4946752" visible="true" weight="0.49015543" /> <window_info active="true" anchor="bottom" id="Terminal" order="10" sideWeight="0.4946752" visible="true" weight="0.42279792" />
<window_info anchor="bottom" id="Logcat" order="11" weight="0.32953367" /> <window_info anchor="bottom" id="Logcat" order="11" weight="0.32953367" />
<window_info anchor="bottom" id="Messages" order="12" sideWeight="0.4968051" weight="0.33782384" /> <window_info anchor="bottom" id="Messages" order="12" sideWeight="0.4968051" weight="0.33782384" />
<window_info anchor="bottom" id="Dependency Viewer" order="13" weight="0.32800853" /> <window_info anchor="bottom" id="Dependency Viewer" order="13" weight="0.32800853" />
...@@ -548,7 +577,9 @@ ...@@ -548,7 +577,9 @@
</layout> </layout>
</component> </component>
<component name="UnknownFeatures"> <component name="UnknownFeatures">
<option featureType="com.intellij.fileTypeFactory" implementationName="*.sh" />
<option featureType="com.intellij.fileTypeFactory" implementationName="*.css" /> <option featureType="com.intellij.fileTypeFactory" implementationName="*.css" />
<option featureType="com.intellij.fileTypeFactory" implementationName="*.js" />
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<ignored-roots> <ignored-roots>
...@@ -556,382 +587,439 @@ ...@@ -556,382 +587,439 @@
</ignored-roots> </ignored-roots>
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$USER_HOME$/flutter/bin/cache/pkg/sky_engine/lib/convert/json.dart" /> <entry file="file://$PROJECT_DIR$/example/test_assets/in_app_webview_on_target_blank_test.html">
<entry file="file://$PROJECT_DIR$/example/lib/test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="450"> <state relative-caret-position="180">
<caret line="230" column="13" selection-start-line="223" selection-start-column="6" selection-end-line="230" selection-end-column="13" /> <caret line="12" column="60" selection-end-line="15" selection-end-column="7" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/assets/page-2.html"> <entry file="file://$PROJECT_DIR$/example/test_assets/in_app_webview_on_load_resource_custom_scheme_test.html">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/example/test_assets/in_app_webview_on_js_dialog_test.html">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="162"> <state relative-caret-position="270">
<caret line="15" column="63" selection-start-line="15" selection-start-column="63" selection-end-line="15" selection-end-column="63" /> <caret line="18" column="7" selection-start-line="18" selection-start-column="7" selection-end-line="18" selection-end-column="7" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/android/build.gradle"> <entry file="file://$PROJECT_DIR$/example/test_assets/in_app_webview_on_download_start_test.html">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="256"> <state>
<caret line="25" column="1" lean-forward="true" selection-start-line="25" selection-start-column="1" selection-end-line="25" selection-end-column="1" /> <caret selection-end-line="17" selection-end-column="7" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$USER_HOME$/flutter/packages/flutter/lib/src/widgets/platform_view.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/.env.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-182"> <state>
<caret line="62" column="8" selection-start-line="62" selection-start-column="8" selection-end-line="62" selection-end-column="8" /> <caret column="54" lean-forward="true" selection-start-column="54" selection-end-column="54" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$USER_HOME$/flutter/packages/flutter/lib/src/widgets/framework.dart"> <entry file="file://$PROJECT_DIR$/example/test_assets/in_app_webview_javascript_handler_test.html">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="125"> <state relative-caret-position="90">
<caret line="779" column="15" selection-start-line="779" selection-start-column="15" selection-end-line="779" selection-end-column="15" /> <caret line="6" column="56" lean-forward="true" selection-start-line="6" selection-start-column="56" selection-end-line="6" selection-end-column="56" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$USER_HOME$/flutter/packages/flutter/lib/src/widgets/container.dart"> <entry file="file://$PROJECT_DIR$/example/test_assets/in_app_webview_initial_file_test.html">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-382"> <state relative-caret-position="385">
<caret line="253" column="2" selection-start-line="253" selection-start-column="2" selection-end-line="253" selection-end-column="2" /> <caret line="26" column="69" selection-start-line="26" selection-start-column="42" selection-end-line="26" selection-end-column="69" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/lib/main.dart"> <entry file="file://$PROJECT_DIR$/example/test_assets/in_app_webview_on_navigation_state_change_test.html">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="495"> <state relative-caret-position="315">
<caret line="38" column="18" selection-start-line="38" selection-start-column="18" selection-end-line="38" selection-end-column="18" /> <caret line="21" column="24" lean-forward="true" selection-start-line="13" selection-start-column="16" selection-end-line="21" selection-end-column="24" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/assets/css/style.css"> <entry file="file://$PROJECT_DIR$/pubspec.yaml">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/example/pubspec.yaml">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="435"> <state relative-caret-position="380">
<caret line="29" column="24" selection-start-line="29" selection-start-column="20" selection-end-line="29" selection-end-column="24" /> <caret line="58" column="55" selection-start-line="58" selection-start-column="55" selection-end-line="58" selection-end-column="55" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/lib/inline_example.screen.dart" /> <entry file="file://$PROJECT_DIR$/test.sh">
<entry file="file://$PROJECT_DIR$/example/lib/webview_example.screen.dart" />
<entry file="file://$PROJECT_DIR$/../cartella senza titolo/flutter_inappbrowser/ios/Classes/MyCookieManager.swift" />
<entry file="file://$PROJECT_DIR$/ios/Classes/MyCookieManager.swift">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="168"> <state relative-caret-position="90">
<caret line="95" column="8" lean-forward="true" selection-start-line="95" selection-start-column="8" selection-end-line="97" selection-end-column="10" /> <caret line="6" selection-start-line="6" selection-end-line="6" selection-end-column="38" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/../cartella senza titolo/flutter_inappbrowser/pubspec.yaml" /> <entry file="file://$USER_HOME$/flutter/packages/flutter/lib/src/widgets/framework.dart">
<entry file="file://$PROJECT_DIR$/../cartella senza titolo/flutter_inappbrowser/CHANGELOG.md" />
<entry file="file://$PROJECT_DIR$/ios/Classes/FlutterWebViewController.swift">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="343"> <state relative-caret-position="-654">
<caret line="28" column="8" selection-start-line="28" selection-start-column="8" selection-end-line="28" selection-end-column="8" /> <caret line="936" column="15" selection-start-line="936" selection-start-column="15" selection-end-line="936" selection-end-column="15" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/README.md"> <entry file="file://$PROJECT_DIR$/lib/src/content_blocker.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="517"> <state relative-caret-position="2025">
<caret line="650" column="3" selection-start-line="650" selection-start-column="3" selection-end-line="650" selection-end-column="3" /> <caret line="135" column="1" selection-start-line="135" selection-start-column="1" selection-end-line="135" selection-end-column="1" />
<folding> <folding>
<element signature="e#0#39#0" expanded="true" /> <element signature="e#0#41#0" expanded="true" />
<element signature="e#0#39#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/pubspec.yaml"> <entry file="file://$PROJECT_DIR$/lib/src/cookie_manager.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="285"> <state relative-caret-position="633">
<caret line="19" selection-start-line="19" selection-end-line="19" /> <caret line="71" column="19" selection-start-line="71" selection-start-column="19" selection-end-line="71" selection-end-column="19" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/lib/flutter_inappbrowser.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/util_test.dart">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/types.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state> <state relative-caret-position="383">
<caret line="1585" column="9" selection-start-line="1585" selection-start-column="9" selection-end-line="1585" selection-end-column="9" />
<folding> <folding>
<element signature="e#845#869#0" expanded="true" /> <element signature="e#0#20#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/test_assets/in_app_webview_javascript_handler_test.html"> <entry file="file://$USER_HOME$/flutter/packages/flutter_driver/lib/src/driver/driver.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="255"> <state relative-caret-position="177">
<caret line="17" column="15" lean-forward="true" selection-start-line="11" selection-start-column="12" selection-end-line="17" selection-end-column="15" /> <caret line="637" column="15" selection-start-line="637" selection-start-column="15" selection-end-line="637" selection-end-column="15" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_load_resource_custom_scheme_test.dart"> <entry file="file://$PROJECT_DIR$/lib/src/webview_options.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-388"> <state relative-caret-position="283">
<caret line="322" column="61" selection-start-line="322" selection-start-column="49" selection-end-line="322" selection-end-column="61" />
<folding> <folding>
<element signature="e#0#39#0" expanded="true" /> <element signature="e#0#17#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_console_message_test.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_ajax_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="184"> <state relative-caret-position="180">
<caret line="42" column="22" selection-start-line="42" selection-start-column="22" selection-end-line="42" selection-end-column="22" /> <caret line="23" column="30" selection-start-line="23" selection-start-column="30" selection-end-line="23" selection-end-column="30" />
<folding> <folding>
<element signature="e#0#39#0" expanded="true" /> <element signature="e#0#39#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_initial_file_test.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_initial_url_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="390"> <state relative-caret-position="202">
<caret line="26" column="38" lean-forward="true" selection-start-line="26" selection-start-column="38" selection-end-line="27" selection-end-column="85" /> <caret line="21" column="30" lean-forward="true" selection-start-line="21" selection-start-column="30" selection-end-line="21" selection-end-column="30" />
<folding> <folding>
<element signature="e#0#39#0" expanded="true" /> <element signature="e#0#39#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/test_assets/in_app_webview_initial_file_test.html"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_content_blocker_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="397"> <state relative-caret-position="315">
<caret line="31" column="27" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="27" /> <caret line="21" column="30" selection-start-line="21" selection-start-column="30" selection-end-line="21" selection-end-column="30" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_should_override_url_loading_test.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_cookie_manager_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="303"> <state relative-caret-position="330">
<caret line="48" column="23" selection-start-line="43" selection-start-column="22" selection-end-line="48" selection-end-column="23" /> <caret line="22" column="30" selection-start-line="22" selection-start-column="30" selection-end-line="22" selection-end-column="30" />
<folding> <folding>
<element signature="e#0#39#0" expanded="true" /> <element signature="e#0#39#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_download_start_test.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_fetch_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="255"> <state relative-caret-position="375">
<caret line="43" lean-forward="true" selection-start-line="43" selection-end-line="43" /> <caret line="25" column="30" selection-start-line="25" selection-start-column="30" selection-end-line="25" selection-end-column="30" />
<folding> <folding>
<element signature="e#0#39#0" expanded="true" /> <element signature="e#0#22#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_js_dialog_test.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_initial_data_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="193"> <state relative-caret-position="300">
<caret line="50" column="25" selection-start-line="50" selection-start-column="25" selection-end-line="50" selection-end-column="25" /> <caret line="20" column="30" selection-start-line="20" selection-start-column="30" selection-end-line="20" selection-end-column="30" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/test_assets/in_app_webview_on_js_dialog_test.html"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_initial_file_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="270"> <state relative-caret-position="300">
<caret line="18" column="7" selection-start-line="18" selection-start-column="7" selection-end-line="18" selection-end-column="7" /> <caret line="20" column="30" selection-start-line="20" selection-start-column="30" selection-end-line="20" selection-end-column="30" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/assets/page-1.html"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_javascript_handler_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="104"> <state relative-caret-position="502">
<caret line="15" column="63" selection-start-line="15" selection-start-column="63" selection-end-line="15" selection-end-column="63" /> <caret line="35" column="30" selection-start-line="35" selection-start-column="30" selection-end-line="35" selection-end-column="30" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/assets/index.html"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_download_start_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="15"> <state relative-caret-position="315">
<caret line="33" column="31" lean-forward="true" selection-end-line="146" selection-end-column="7" /> <caret line="21" column="30" selection-start-line="21" selection-start-column="30" selection-end-line="21" selection-end-column="30" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/test_assets/in_app_webview_on_target_blank_test.html"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_js_dialog_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="180"> <state relative-caret-position="420">
<caret line="12" column="60" selection-end-line="15" selection-end-column="7" /> <caret line="28" column="30" selection-start-line="28" selection-start-column="30" selection-end-line="28" selection-end-column="30" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/pubspec.yaml"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_load_resource_custom_scheme_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="690"> <state relative-caret-position="315">
<caret line="46" column="24" selection-start-line="46" selection-start-column="24" selection-end-line="46" selection-end-column="24" /> <caret line="21" column="30" selection-start-line="21" selection-start-column="30" selection-end-line="21" selection-end-column="30" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_target_blank_test.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_load_resource_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="345"> <state relative-caret-position="390">
<caret line="44" column="22" selection-start-line="44" selection-start-column="22" selection-end-line="49" selection-end-column="23" /> <caret line="26" column="30" selection-start-line="26" selection-start-column="30" selection-end-line="26" selection-end-column="30" />
<folding> <folding>
<element signature="e#0#39#0" expanded="true" /> <element signature="e#0#39#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/lib/src/content_blocker.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_navigation_state_change_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="225"> <state relative-caret-position="300">
<caret line="71" column="19" selection-start-line="71" selection-start-column="9" selection-end-line="71" selection-end-column="19" /> <caret line="20" column="30" selection-start-line="20" selection-start-column="30" selection-end-line="20" selection-end-column="30" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/lib/src/http_auth_credentials_database.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_progress_changed_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state> <state relative-caret-position="315">
<caret line="21" column="30" selection-start-line="21" selection-start-column="30" selection-end-line="21" selection-end-column="30" />
<folding> <folding>
<element signature="e#0#20#0" expanded="true" /> <element signature="e#0#39#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_initial_url_test.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_received_http_auth_request_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="147"> <state relative-caret-position="330">
<caret line="16" column="2" selection-start-line="16" selection-start-column="2" selection-end-line="16" selection-end-column="2" /> <caret line="22" column="30" selection-start-line="22" selection-start-column="30" selection-end-line="22" selection-end-column="30" />
<folding> <folding>
<element signature="e#0#39#0" expanded="true" /> <element signature="e#0#39#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_javascript_handler_test.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_safe_browsing_hit_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="400"> <state relative-caret-position="345">
<caret line="58" column="22" selection-start-line="58" selection-start-column="22" selection-end-line="67" selection-end-column="25" /> <caret line="23" column="30" selection-start-line="23" selection-start-column="30" selection-end-line="23" selection-end-column="30" />
<folding>
<element signature="e#0#17#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_scroll_changed_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="330">
<caret line="22" column="30" selection-start-line="22" selection-start-column="30" selection-end-line="22" selection-end-column="30" />
<folding> <folding>
<element signature="e#0#39#0" expanded="true" /> <element signature="e#0#39#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/CHANGELOG.md"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_target_blank_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="214"> <state relative-caret-position="300">
<caret line="15" column="47" lean-forward="true" selection-start-line="15" selection-start-column="47" selection-end-line="15" selection-end-column="47" /> <caret line="20" column="30" selection-start-line="20" selection-start-column="30" selection-end-line="20" selection-end-column="30" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/lib/src/webview_options.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_should_override_url_loading_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="422"> <state relative-caret-position="300">
<caret line="56" column="5" selection-start-line="56" selection-start-column="5" selection-end-line="56" selection-end-column="56" /> <caret line="20" column="30" selection-start-line="20" selection-start-column="30" selection-end-line="20" selection-end-column="30" />
<folding> <folding>
<element signature="e#0#17#0" expanded="true" /> <element signature="e#0#39#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/main_test.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/main_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="284"> <state relative-caret-position="459">
<caret line="37" column="94" selection-start-line="37" selection-start-column="94" selection-end-line="37" selection-end-column="94" /> <caret line="115" column="25" selection-start-line="115" selection-start-column="16" selection-end-line="115" selection-end-column="25" />
<folding> <folding>
<element signature="e#0#20#0" expanded="true" /> <element signature="e#0#20#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/app_test.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/app.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-6"> <state>
<caret line="207" selection-start-line="207" selection-end-line="207" /> <folding>
<element signature="e#0#54#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/index.js"> <entry file="file://$PROJECT_DIR$/.github/ISSUE_TEMPLATE/BUG_REPORT.md">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="423"> <state relative-caret-position="180">
<caret line="91" column="22" selection-start-line="91" selection-start-column="12" selection-end-line="91" selection-end-column="22" /> <caret line="12" lean-forward="true" selection-start-line="12" selection-end-line="12" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_received_http_auth_request_test.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_find_result_received_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="282"> <state relative-caret-position="156">
<caret line="45" column="48" selection-start-line="45" selection-start-column="48" selection-end-line="45" selection-end-column="48" /> <caret line="20" column="30" selection-start-line="20" selection-start-column="30" selection-end-line="20" selection-end-column="30" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/lib/src/in_app_browser.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/custom_widget_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-2"> <state relative-caret-position="360">
<caret line="294" column="31" selection-start-line="294" selection-start-column="31" selection-end-line="294" selection-end-column="31" /> <caret line="24" column="3" selection-start-line="24" selection-start-column="3" selection-end-line="24" selection-end-column="3" />
<folding> <folding>
<element signature="e#0#20#0" expanded="true" /> <element signature="e#0#39#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/lib/src/types.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_ssl_request_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-195"> <state relative-caret-position="275">
<caret line="344" column="6" selection-start-line="344" selection-start-column="6" selection-end-line="344" selection-end-column="6" /> <caret line="49" column="48" lean-forward="true" selection-start-line="49" selection-start-column="48" selection-end-line="49" selection-end-column="48" />
<folding> <folding>
<element signature="e#0#20#0" expanded="true" /> <element signature="e#0#17#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/lib/src/in_app_webview.dart"> <entry file="file://$PROJECT_DIR$/nodejs_server_test_auth_basic_and_ssl/index.js">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="152"> <state relative-caret-position="1414">
<caret line="348" column="14" selection-start-line="348" selection-start-column="7" selection-end-line="348" selection-end-column="14" /> <caret line="100" column="12" selection-start-line="100" selection-start-column="12" selection-end-line="100" selection-end-column="12" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_safe_browsing_hit_test.dart"> <entry file="file://$PROJECT_DIR$/CHANGELOG.md">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/app_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="242"> <state relative-caret-position="127">
<caret line="61" column="22" selection-start-line="61" selection-start-column="22" selection-end-line="61" selection-end-column="22" /> <caret line="503" column="45" selection-start-line="503" selection-start-column="45" selection-end-line="503" selection-end-column="45" />
<folding> <folding>
<element signature="e#0#17#0" expanded="true" /> <element signature="e#35#55#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/util_test.dart"> <entry file="file://$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="225"> <state relative-caret-position="420">
<caret line="15" column="36" selection-start-line="15" selection-start-column="16" selection-end-line="15" selection-end-column="36" /> <caret line="73" column="23" selection-start-line="73" selection-start-column="23" selection-end-line="73" selection-end-column="23" />
<folding> <folding>
<element signature="e#0#20#0" expanded="true" /> <element signature="e#0#20#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/lib/in_app_browser_example.screen.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_http_auth_credential_database_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="267"> <state relative-caret-position="455">
<caret line="147" column="48" selection-start-line="147" selection-start-column="48" selection-end-line="147" selection-end-column="48" /> <caret line="63" column="84" selection-start-line="63" selection-start-column="84" selection-end-line="63" selection-end-column="84" />
<folding> <folding>
<element signature="e#0#20#0" expanded="true" /> <element signature="e#0#39#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_load_error_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="254"> <state relative-caret-position="362">
<caret line="97" column="63" selection-start-line="97" selection-start-column="63" selection-end-line="97" selection-end-column="63" /> <caret line="50" column="21" selection-start-line="46" selection-start-column="20" selection-end-line="50" selection-end-column="21" />
<folding> <folding>
<element signature="e#0#20#0" expanded="true" /> <element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_console_message_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="492">
<caret line="49" column="22" selection-start-line="45" selection-start-column="20" selection-end-line="49" selection-end-column="22" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/lib/chrome_safari_browser_example.screen.dart"> <entry file="file://$PROJECT_DIR$/example/test_driver/in_app_webview_on_load_http_error_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="432"> <state relative-caret-position="94">
<caret line="70" column="48" selection-start-line="70" selection-start-column="48" selection-end-line="70" selection-end-column="48" /> <caret line="29" column="38" selection-start-line="29" selection-start-column="38" selection-end-line="29" selection-end-column="38" />
<folding> <folding>
<element signature="e#0#39#0" expanded="true" /> <element signature="e#0#39#0" expanded="true" />
</folding> </folding>
......
...@@ -66,6 +66,9 @@ public class ContentBlockerHandler { ...@@ -66,6 +66,9 @@ public class ContentBlockerHandler {
for (ContentBlocker contentBlocker : ruleListCopy) { for (ContentBlocker contentBlocker : ruleListCopy) {
ContentBlockerTrigger trigger = contentBlocker.trigger; ContentBlockerTrigger trigger = contentBlocker.trigger;
List<ContentBlockerTriggerResourceType> resourceTypes = trigger.resourceType; List<ContentBlockerTriggerResourceType> resourceTypes = trigger.resourceType;
if (resourceTypes.contains(ContentBlockerTriggerResourceType.IMAGE) && !resourceTypes.contains(ContentBlockerTriggerResourceType.SVG_DOCUMENT)) {
resourceTypes.add(ContentBlockerTriggerResourceType.SVG_DOCUMENT);
}
ContentBlockerAction action = contentBlocker.action; ContentBlockerAction action = contentBlocker.action;
...@@ -173,6 +176,7 @@ public class ContentBlockerHandler { ...@@ -173,6 +176,7 @@ public class ContentBlockerHandler {
? contentTypeSplitted[1].replace("charset=", "").trim() ? contentTypeSplitted[1].replace("charset=", "").trim()
: "utf-8"; : "utf-8";
response.body().close();
response.close(); response.close();
return new WebResourceResponse(contentType, encoding, dataStream); return new WebResourceResponse(contentType, encoding, dataStream);
...@@ -180,6 +184,7 @@ public class ContentBlockerHandler { ...@@ -180,6 +184,7 @@ public class ContentBlockerHandler {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
if (response != null) { if (response != null) {
response.body().close();
response.close(); response.close();
} }
Log.e(LOG_TAG, e.getMessage()); Log.e(LOG_TAG, e.getMessage());
...@@ -220,12 +225,14 @@ public class ContentBlockerHandler { ...@@ -220,12 +225,14 @@ public class ContentBlockerHandler {
? contentTypeSplitted[1].replace("charset=", "").trim() ? contentTypeSplitted[1].replace("charset=", "").trim()
: "utf-8"; : "utf-8";
response.body().close();
response.close(); response.close();
responseResourceType = getResourceTypeFromContentType(contentType); responseResourceType = getResourceTypeFromContentType(contentType);
} }
} catch (Exception e) { } catch (Exception e) {
if (response != null) { if (response != null) {
response.body().close();
response.close(); response.close();
} }
e.printStackTrace(); e.printStackTrace();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# This is a generated file; do not edit or check into version control. # This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/lorenzopichilli/flutter" export "FLUTTER_ROOT=/Users/lorenzopichilli/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/lorenzopichilli/Desktop/flutter_inappbrowser/example" export "FLUTTER_APPLICATION_PATH=/Users/lorenzopichilli/Desktop/flutter_inappbrowser/example"
export "FLUTTER_TARGET=lib/main.dart" export "FLUTTER_TARGET=/Users/lorenzopichilli/Desktop/flutter_inappbrowser/example/test_driver/app.dart"
export "FLUTTER_BUILD_DIR=build" export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios" export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "FLUTTER_FRAMEWORK_DIR=/Users/lorenzopichilli/flutter/bin/cache/artifacts/engine/ios" export "FLUTTER_FRAMEWORK_DIR=/Users/lorenzopichilli/flutter/bin/cache/artifacts/engine/ios"
......
...@@ -31,6 +31,7 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> { ...@@ -31,6 +31,7 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
InAppWebViewController webView; InAppWebViewController webView;
String url = ""; String url = "";
double progress = 0; double progress = 0;
CookieManager cookieManager = CookieManager.instance();
TextEditingController _textFieldController = TextEditingController(); TextEditingController _textFieldController = TextEditingController();
...@@ -124,7 +125,8 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> { ...@@ -124,7 +125,8 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
//initialUrl: "chrome://safe-browsing/match?type=malware", //initialUrl: "chrome://safe-browsing/match?type=malware",
//initialUrl: "http://192.168.1.20:8081/", //initialUrl: "http://192.168.1.20:8081/",
//initialUrl: "https://192.168.1.20:4433/", //initialUrl: "https://192.168.1.20:4433/",
initialFile: "assets/index.html", //initialFile: "assets/index.html",
initialUrl: "https://flutter.dev/",
initialHeaders: {}, initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions( initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions( inAppWebViewOptions: InAppWebViewOptions(
...@@ -134,7 +136,7 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> { ...@@ -134,7 +136,7 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
clearCache: true, clearCache: true,
//useShouldOverrideUrlLoading: true, //useShouldOverrideUrlLoading: true,
useOnTargetBlank: true, useOnTargetBlank: true,
//useOnLoadResource: true, useOnLoadResource: true,
//useOnDownloadStart: true, //useOnDownloadStart: true,
//useShouldInterceptAjaxRequest: true, //useShouldInterceptAjaxRequest: true,
//useShouldInterceptFetchRequest: true, //useShouldInterceptFetchRequest: true,
...@@ -151,7 +153,7 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> { ...@@ -151,7 +153,7 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
ContentBlockerTriggerResourceType.STYLE_SHEET ContentBlockerTriggerResourceType.STYLE_SHEET
], ],
ifTopUrl: [ ifTopUrl: [
"https://getbootstrap.com/" "https://flutter.dev/"
]), ]),
action: ContentBlockerAction( action: ContentBlockerAction(
type: ContentBlockerActionType.BLOCK)) type: ContentBlockerActionType.BLOCK))
...@@ -195,11 +197,13 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> { ...@@ -195,11 +197,13 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
}, },
onLoadStop: (InAppWebViewController controller, String url) async { onLoadStop: (InAppWebViewController controller, String url) async {
print("stopped $url"); print("stopped $url");
if (Platform.isAndroid) { if (Platform.isAndroid) {
controller.clearSslPreferences(); controller.clearSslPreferences();
controller.clearClientCertPreferences(); controller.clearClientCertPreferences();
} }
//controller.findAllAsync("flutter"); //controller.findAllAsync(find: "InAppWebView");
//controller.findAllAsync(find: "InAppWebViewInitialFileTest");
print(await controller.getFavicons()); print(await controller.getFavicons());
print(await CookieManager.instance().getCookies(url: url)); print(await CookieManager.instance().getCookies(url: url));
//await CookieManager.instance().setCookie(url: url, name: "myCookie", value: "myValue"); //await CookieManager.instance().setCookie(url: url, name: "myCookie", value: "myValue");
......
...@@ -53,11 +53,8 @@ flutter: ...@@ -53,11 +53,8 @@ flutter:
- test_assets/in_app_webview_initial_file_test.html - test_assets/in_app_webview_initial_file_test.html
- test_assets/in_app_webview_on_load_resource_test.html - test_assets/in_app_webview_on_load_resource_test.html
- test_assets/in_app_webview_javascript_handler_test.html - test_assets/in_app_webview_javascript_handler_test.html
- test_assets/in_app_webview_ajax_test.html
- test_assets/in_app_webview_fetch_test.html
- test_assets/in_app_webview_on_load_resource_custom_scheme_test.html - test_assets/in_app_webview_on_load_resource_custom_scheme_test.html
- test_assets/in_app_webview_on_console_message_test.html - test_assets/in_app_webview_on_console_message_test.html
- test_assets/in_app_webview_on_download_start_test.html
- test_assets/in_app_webview_on_target_blank_test.html - test_assets/in_app_webview_on_target_blank_test.html
- test_assets/in_app_webview_on_js_dialog_test.html - test_assets/in_app_webview_on_js_dialog_test.html
- test_assets/css/ - test_assets/css/
......
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>InAppWebViewAjaxTest</title>
</head>
<body>
<h1>InAppWebViewAjaxTest</h1>
<script>
window.addEventListener('flutterInAppBrowserPlatformReady', function(event) {
var xhttp = new XMLHttpRequest();
xhttp.open("POST", "http://192.168.1.20:8082/test-ajax-post");
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("firstname=Foo&lastname=Bar");
var xhttp2 = new XMLHttpRequest();
xhttp2.open("GET", "http://192.168.1.20:8082/test-download-file");
xhttp2.send();
});
</script>
</body>
</html>
\ No newline at end of file
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>InAppWebViewFetchTest</title>
</head>
<body>
<h1>InAppWebViewFetchTest</h1>
<script>
window.addEventListener('flutterInAppBrowserPlatformReady', function(event) {
fetch(new Request("http://192.168.1.20:8082/test-download-file")).then(function(response) {
window.flutter_inappbrowser.callHandler('fetchGet', response.status);
}).catch(function(error) {
window.flutter_inappbrowser.callHandler('fetchGet', "ERROR: " + error);
});
fetch("http://192.168.1.20:8082/test-ajax-post", {
method: 'POST',
body: JSON.stringify({
firstname: 'Foo',
lastname: 'Bar'
}),
headers: {
'Content-Type': 'application/json'
}
}).then(function(response) {
response.json().then(function(value) {
window.flutter_inappbrowser.callHandler('fetchPost', value);
}).catch(function(error) {
window.flutter_inappbrowser.callHandler('fetchPost', "ERROR: " + error);
});
}).catch(function(error) {
window.flutter_inappbrowser.callHandler('fetchPost', "ERROR: " + error);
});
});
</script>
</body>
</html>
\ No newline at end of file
...@@ -4,14 +4,22 @@ ...@@ -4,14 +4,22 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>InAppWebViewOnDownloadStartTest</title> <title>InAppWebViewOnNavigationStateChangeTest</title>
<base href="index.html">
</head> </head>
<body> <body>
<h1>InAppWebViewOnDownloadStartTest</h1> <h1>InAppWebViewOnNavigationStateChangeTest</h1>
<a id="download-file" href="http://192.168.1.20:8082/test-download-file">download file</a>
<script> <script>
window.addEventListener("flutterInAppBrowserPlatformReady", function(event) { window.addEventListener("flutterInAppBrowserPlatformReady", function(event) {
document.querySelector("#download-file").click(); var state = {}
var title = ''
var url = 'first-push';
history.pushState(state, title, url);
setTimeout(function() {
var url = 'second-push';
history.pushState(state, title, url);
}, 100);
}); });
</script> </script>
</body> </body>
......
final environment = {"NODE_SERVER_IP":"192.168.1.20"};
\ No newline at end of file
import 'package:flutter_driver/driver_extension.dart'; import 'package:flutter_driver/driver_extension.dart';
import 'app_test.dart';
import 'main_test.dart' as app; import 'main_test.dart' as app;
void main() { void main() {
......
// Imports the Flutter Driver API. // Imports the Flutter Driver API.
import 'dart:async'; import 'dart:async';
import 'dart:io';
import 'package:flutter_driver/flutter_driver.dart'; import 'package:flutter_driver/flutter_driver.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
import '.env.dart';
void main() { void main() {
...@@ -22,38 +24,101 @@ void main() { ...@@ -22,38 +24,101 @@ void main() {
} }
}); });
//
// IMPORTANT NOTE!!!
// These tests need to follow the same order of "var routes" in "buildRoutes()" function
// defined in main_test.dart
//
test('InAppWebViewInitialUrlTest', () async { test('InAppWebViewInitialUrlTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
final appBarTitle = find.byValueKey('AppBarTitle'); final appBarTitle = find.byValueKey('AppBarTitle');
final sideMenuButton = find.byValueKey('SideMenu');
final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewInitialFileTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewInitialUrlTest") { while((await driver.getText(appBarTitle)) == "InAppWebViewInitialUrlTest") {
await Future.delayed(const Duration(milliseconds: 1000)); await Future.delayed(const Duration(milliseconds: 500));
} }
String url = await driver.getText(appBarTitle); String url = await driver.getText(appBarTitle);
expect(url, "https://flutter.dev/"); expect(url, "https://flutter.dev/");
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5))); }, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewInitialFileTest', () async { test('InAppWebViewInitialFileTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
final appBarTitle = find.byValueKey('AppBarTitle'); final appBarTitle = find.byValueKey('AppBarTitle');
final sideMenuButton = find.byValueKey('SideMenu');
final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewInitialDataTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewInitialFileTest") { while((await driver.getText(appBarTitle)) == "InAppWebViewInitialFileTest") {
await Future.delayed(const Duration(milliseconds: 1000)); await Future.delayed(const Duration(milliseconds: 500));
}
String title = await driver.getText(appBarTitle);
expect(title, "true");
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewInitialDataTest', () async {
final appBarTitle = find.byValueKey('AppBarTitle');
final sideMenuButton = find.byValueKey('SideMenu');
final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewOnProgressChangedTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewInitialDataTest") {
await Future.delayed(const Duration(milliseconds: 500));
}
String title = await driver.getText(appBarTitle);
expect(title, "true");
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewOnProgressChangedTest', () async {
final appBarTitle = find.byValueKey('AppBarTitle');
final sideMenuButton = find.byValueKey('SideMenu');
final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewOnScrollChangedTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewOnProgressChangedTest") {
await Future.delayed(const Duration(milliseconds: 500));
}
String title = await driver.getText(appBarTitle);
expect(title, "true");
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewOnScrollChangedTest', () async {
final appBarTitle = find.byValueKey('AppBarTitle');
final sideMenuButton = find.byValueKey('SideMenu');
final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewOnLoadResourceTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewOnScrollChangedTest") {
await Future.delayed(const Duration(milliseconds: 500));
} }
String title = await driver.getText(appBarTitle); String title = await driver.getText(appBarTitle);
expect(title, "true"); expect(title, "true");
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5))); }, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewOnLoadResourceTest', () async { test('InAppWebViewOnLoadResourceTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
List<String> resourceList = [ List<String> resourceList = [
"https://getbootstrap.com/docs/4.3/dist/css/bootstrap.min.css", "https://getbootstrap.com/docs/4.3/dist/css/bootstrap.min.css",
"https://code.jquery.com/jquery-3.3.1.min.js", "https://code.jquery.com/jquery-3.3.1.min.js",
...@@ -61,114 +126,177 @@ void main() { ...@@ -61,114 +126,177 @@ void main() {
]; ];
final appBarTitle = find.byValueKey('AppBarTitle'); final appBarTitle = find.byValueKey('AppBarTitle');
final sideMenuButton = find.byValueKey('SideMenu');
final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewJavaScriptHandlerTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewOnLoadResourceTest") { while((await driver.getText(appBarTitle)) == "InAppWebViewOnLoadResourceTest") {
await Future.delayed(const Duration(milliseconds: 1000)); await Future.delayed(const Duration(milliseconds: 500));
} }
String title = await driver.getText(appBarTitle); String title = await driver.getText(appBarTitle);
for (String resource in resourceList) { for (String resource in resourceList) {
expect(true, title.contains(resource)); expect(true, title.contains(resource));
} }
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5))); }, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewJavaScriptHandlerTest', () async { test('InAppWebViewJavaScriptHandlerTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
final appBarTitle = find.byValueKey('AppBarTitle'); final appBarTitle = find.byValueKey('AppBarTitle');
final sideMenuButton = find.byValueKey('SideMenu');
final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewAjaxTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewJavaScriptHandlerTest") { while((await driver.getText(appBarTitle)) == "InAppWebViewJavaScriptHandlerTest") {
await Future.delayed(const Duration(milliseconds: 1000)); await Future.delayed(const Duration(milliseconds: 500));
} }
String title = await driver.getText(appBarTitle); String title = await driver.getText(appBarTitle);
expect(true, !title.contains("false")); expect(true, !title.contains("false"));
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5))); }, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewAjaxTest', () async { test('InAppWebViewAjaxTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
final appBarTitle = find.byValueKey('AppBarTitle'); final appBarTitle = find.byValueKey('AppBarTitle');
final sideMenuButton = find.byValueKey('SideMenu');
final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewFetchTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewAjaxTest") { while((await driver.getText(appBarTitle)) == "InAppWebViewAjaxTest") {
await Future.delayed(const Duration(milliseconds: 1000)); await Future.delayed(const Duration(milliseconds: 500));
} }
String title = await driver.getText(appBarTitle); String title = await driver.getText(appBarTitle);
expect(title, "Lorenzo Pichilli Lorenzo Pichilli"); expect(title, "Lorenzo Pichilli Lorenzo Pichilli");
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5))); }, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewOnLoadResourceCustomSchemeTest', () async { test('InAppWebViewFetchTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
final appBarTitle = find.byValueKey('AppBarTitle'); final appBarTitle = find.byValueKey('AppBarTitle');
while((await driver.getText(appBarTitle)) == "InAppWebViewOnLoadResourceCustomSchemeTest") { final sideMenuButton = find.byValueKey('SideMenu');
await Future.delayed(const Duration(milliseconds: 1000)); final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewOnLoadResourceCustomSchemeTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewFetchTest") {
await Future.delayed(const Duration(milliseconds: 500));
} }
String title = await driver.getText(appBarTitle); String title = await driver.getText(appBarTitle);
expect(title, "true"); expect(true, title.contains("Lorenzo Pichilli") && title.contains("200"));
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5))); }, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewFetchTest', () async { test('InAppWebViewOnLoadResourceCustomSchemeTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
final appBarTitle = find.byValueKey('AppBarTitle'); final appBarTitle = find.byValueKey('AppBarTitle');
while((await driver.getText(appBarTitle)) == "InAppWebViewFetchTest") { final sideMenuButton = find.byValueKey('SideMenu');
await Future.delayed(const Duration(milliseconds: 1000)); final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewShouldOverrideUrlLoadingTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewOnLoadResourceCustomSchemeTest") {
await Future.delayed(const Duration(milliseconds: 500));
} }
String title = await driver.getText(appBarTitle); String title = await driver.getText(appBarTitle);
expect(true, title.contains("Lorenzo Pichilli") && title.contains("200")); expect(title, "true");
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5))); }, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewShouldOverrideUrlLoadingTest', () async { test('InAppWebViewShouldOverrideUrlLoadingTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
final appBarTitle = find.byValueKey('AppBarTitle'); final appBarTitle = find.byValueKey('AppBarTitle');
final sideMenuButton = find.byValueKey('SideMenu');
final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewOnConsoleMessageTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewShouldOverrideUrlLoadingTest") { while((await driver.getText(appBarTitle)) == "InAppWebViewShouldOverrideUrlLoadingTest") {
await Future.delayed(const Duration(milliseconds: 1000)); await Future.delayed(const Duration(milliseconds: 500));
} }
String url = await driver.getText(appBarTitle); String url = await driver.getText(appBarTitle);
expect(url, "https://flutter.dev/"); expect(url, "https://flutter.dev/");
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5))); }, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewOnConsoleMessageTest', () async { test('InAppWebViewOnConsoleMessageTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
final appBarTitle = find.byValueKey('AppBarTitle'); final appBarTitle = find.byValueKey('AppBarTitle');
final sideMenuButton = find.byValueKey('SideMenu');
final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewOnDownloadStartTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewOnConsoleMessageTest") { while((await driver.getText(appBarTitle)) == "InAppWebViewOnConsoleMessageTest") {
await Future.delayed(const Duration(milliseconds: 1000)); await Future.delayed(const Duration(milliseconds: 500));
} }
String title = await driver.getText(appBarTitle); String title = await driver.getText(appBarTitle);
expect(title, "message LOG"); expect(title, "message LOG");
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5))); }, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewOnDownloadStartTest', () async { test('InAppWebViewOnDownloadStartTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
final appBarTitle = find.byValueKey('AppBarTitle'); final appBarTitle = find.byValueKey('AppBarTitle');
final sideMenuButton = find.byValueKey('SideMenu');
final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewOnTargetBlankTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewOnDownloadStartTest") { while((await driver.getText(appBarTitle)) == "InAppWebViewOnDownloadStartTest") {
await Future.delayed(const Duration(milliseconds: 1000)); await Future.delayed(const Duration(milliseconds: 500));
} }
String url = await driver.getText(appBarTitle); String url = await driver.getText(appBarTitle);
expect(url, "http://192.168.1.20:8082/test-download-file"); expect(url, "http://${environment["NODE_SERVER_IP"]}:8082/test-download-file");
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5))); }, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewOnTargetBlankTest', () async { test('InAppWebViewOnTargetBlankTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
final appBarTitle = find.byValueKey('AppBarTitle'); final appBarTitle = find.byValueKey('AppBarTitle');
final sideMenuButton = find.byValueKey('SideMenu');
final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewOnJsDialogTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewOnTargetBlankTest") { while((await driver.getText(appBarTitle)) == "InAppWebViewOnTargetBlankTest") {
await Future.delayed(const Duration(milliseconds: 1000)); await Future.delayed(const Duration(milliseconds: 500));
} }
String url = await driver.getText(appBarTitle); String url = await driver.getText(appBarTitle);
expect(url, "https://flutter.dev/"); expect(url, "https://flutter.dev/");
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5))); }, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewOnJsDialogTest', () async { test('InAppWebViewOnJsDialogTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
final appBarTitle = find.byValueKey('AppBarTitle'); final appBarTitle = find.byValueKey('AppBarTitle');
final alertButtonOk = find.byValueKey('AlertButtonOk'); final alertButtonOk = find.byValueKey('AlertButtonOk');
final confirmButtonCancel = find.byValueKey('ConfirmButtonCancel'); final confirmButtonCancel = find.byValueKey('ConfirmButtonCancel');
...@@ -177,8 +305,12 @@ void main() { ...@@ -177,8 +305,12 @@ void main() {
final promptButtonCancel = find.byValueKey('PromptButtonCancel'); final promptButtonCancel = find.byValueKey('PromptButtonCancel');
final promptButtonOk = find.byValueKey('PromptButtonOk'); final promptButtonOk = find.byValueKey('PromptButtonOk');
final sideMenuButton = find.byValueKey('SideMenu');
final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewOnSafeBrowsingHitTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewOnJsDialogTest") { while((await driver.getText(appBarTitle)) == "InAppWebViewOnJsDialogTest") {
await Future.delayed(const Duration(milliseconds: 1000)); await Future.delayed(const Duration(milliseconds: 500));
} }
await driver.tap(alertButtonOk); await driver.tap(alertButtonOk);
...@@ -204,30 +336,196 @@ void main() { ...@@ -204,30 +336,196 @@ void main() {
title = await driver.getText(appBarTitle); title = await driver.getText(appBarTitle);
expect(title, "prompt new value"); expect(title, "prompt new value");
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5))); }, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewOnSafeBrowsingHitTest', () async { test('InAppWebViewOnSafeBrowsingHitTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
final appBarTitle = find.byValueKey('AppBarTitle'); final appBarTitle = find.byValueKey('AppBarTitle');
final sideMenuButton = find.byValueKey('SideMenu');
final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewOnReceivedHttpAuthRequestTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewOnSafeBrowsingHitTest") { while((await driver.getText(appBarTitle)) == "InAppWebViewOnSafeBrowsingHitTest") {
await Future.delayed(const Duration(milliseconds: 1000)); await Future.delayed(const Duration(milliseconds: 500));
} }
String url = await driver.getText(appBarTitle); String url = await driver.getText(appBarTitle);
expect(url, "chrome://safe-browsing/match?type=malware"); if (Platform.isAndroid)
expect(url, "chrome://safe-browsing/match?type=malware");
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5))); }, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewOnReceivedHttpAuthRequestTest', () async { test('InAppWebViewOnReceivedHttpAuthRequestTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
final appBarTitle = find.byValueKey('AppBarTitle'); final appBarTitle = find.byValueKey('AppBarTitle');
final sideMenuButton = find.byValueKey('SideMenu');
final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewSslRequestTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewOnReceivedHttpAuthRequestTest") { while((await driver.getText(appBarTitle)) == "InAppWebViewOnReceivedHttpAuthRequestTest") {
await Future.delayed(const Duration(milliseconds: 1000)); await Future.delayed(const Duration(milliseconds: 500));
}
String title = await driver.getText(appBarTitle);
expect(title, "Authorized");
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewSslRequestTest', () async {
final appBarTitle = find.byValueKey('AppBarTitle');
final sideMenuButton = find.byValueKey('SideMenu');
final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewOnFindResultReceivedTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewSslRequestTest") {
await Future.delayed(const Duration(milliseconds: 500));
} }
String title = await driver.getText(appBarTitle); String title = await driver.getText(appBarTitle);
expect(title, "Authorized"); expect(title, "Authorized");
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewOnFindResultReceivedTest', () async {
final appBarTitle = find.byValueKey('AppBarTitle');
final sideMenuButton = find.byValueKey('SideMenu');
final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewOnNavigationStateChangeTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewOnFindResultReceivedTest") {
await Future.delayed(const Duration(milliseconds: 500));
}
String title = await driver.getText(appBarTitle);
expect(title, "2");
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewOnNavigationStateChangeTest', () async {
final appBarTitle = find.byValueKey('AppBarTitle');
final sideMenuButton = find.byValueKey('SideMenu');
final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewOnLoadErrorTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewOnNavigationStateChangeTest") {
await Future.delayed(const Duration(milliseconds: 500));
}
String title = await driver.getText(appBarTitle);
expect(true, title.contains("first-push") && title.contains("second-push"));
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewOnLoadErrorTest', () async {
final appBarTitle = find.byValueKey('AppBarTitle');
final sideMenuButton = find.byValueKey('SideMenu');
final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewOnLoadHttpErrorTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewOnLoadErrorTest") {
await Future.delayed(const Duration(milliseconds: 500));
}
String title = await driver.getText(appBarTitle);
if (Platform.isAndroid) {
expect(title, "-2");
} else if (Platform.isIOS) {
expect(title, "-1022");
}
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewOnLoadHttpErrorTest', () async {
final appBarTitle = find.byValueKey('AppBarTitle');
final sideMenuButton = find.byValueKey('SideMenu');
final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewCookieManagerTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewOnLoadHttpErrorTest") {
await Future.delayed(const Duration(milliseconds: 500));
}
String title = await driver.getText(appBarTitle);
expect(title, "404");
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewCookieManagerTest', () async {
final appBarTitle = find.byValueKey('AppBarTitle');
final sideMenuButton = find.byValueKey('SideMenu');
final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewHttpAuthCredentialDatabaseTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewCookieManagerTest") {
await Future.delayed(const Duration(milliseconds: 500));
}
String title = await driver.getText(appBarTitle);
expect(title, "myValue true true");
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewHttpAuthCredentialDatabaseTest', () async {
final appBarTitle = find.byValueKey('AppBarTitle');
final sideMenuButton = find.byValueKey('SideMenu');
final listTiles = find.byValueKey('ListTiles');
final nextTest = find.byValueKey('InAppWebViewContentBlockerTest');
while((await driver.getText(appBarTitle)) == "InAppWebViewHttpAuthCredentialDatabaseTest") {
await Future.delayed(const Duration(milliseconds: 500));
}
String title = await driver.getText(appBarTitle);
expect(title, "Authorized true true");
await driver.tap(sideMenuButton);
await driver.scrollUntilVisible(listTiles, nextTest, dyScroll: -300.0);
await driver.tap(nextTest);
}, timeout: new Timeout(new Duration(minutes: 5)));
test('InAppWebViewContentBlockerTest', () async {
final appBarTitle = find.byValueKey('AppBarTitle');
while((await driver.getText(appBarTitle)) == "InAppWebViewContentBlockerTest") {
await Future.delayed(const Duration(milliseconds: 500));
}
String title = await driver.getText(appBarTitle);
expect(title, "true");
}, timeout: new Timeout(new Duration(minutes: 5))); }, timeout: new Timeout(new Duration(minutes: 5)));
}); });
......
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart'; import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
...@@ -14,6 +15,7 @@ class WidgetTest extends StatefulWidget { ...@@ -14,6 +15,7 @@ class WidgetTest extends StatefulWidget {
} }
class WidgetTestState extends State<WidgetTest> { class WidgetTestState extends State<WidgetTest> {
final GlobalKey<ScaffoldState> scaffoldKey = new GlobalKey<ScaffoldState>();
InAppWebViewController webView; InAppWebViewController webView;
String appBarTitle; String appBarTitle;
......
...@@ -3,8 +3,8 @@ import 'package:flutter/material.dart'; ...@@ -3,8 +3,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart'; import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart'; import 'main_test.dart';
import 'util_test.dart';
import 'custom_widget_test.dart'; import 'custom_widget_test.dart';
import '.env.dart';
class InAppWebViewAjaxTest extends WidgetTest { class InAppWebViewAjaxTest extends WidgetTest {
final InAppWebViewAjaxTestState state = InAppWebViewAjaxTestState(); final InAppWebViewAjaxTestState state = InAppWebViewAjaxTestState();
...@@ -21,13 +21,40 @@ class InAppWebViewAjaxTestState extends WidgetTestState { ...@@ -21,13 +21,40 @@ class InAppWebViewAjaxTestState extends WidgetTestState {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle), appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container( body: Container(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
child: Container( child: Container(
child: InAppWebView( child: InAppWebView(
initialFile: "test_assets/in_app_webview_ajax_test.html", initialData: InAppWebViewInitialData(data: """
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>InAppWebViewAjaxTest</title>
</head>
<body>
<h1>InAppWebViewAjaxTest</h1>
<script>
window.addEventListener('flutterInAppBrowserPlatformReady', function(event) {
var xhttp = new XMLHttpRequest();
xhttp.open("POST", "http://${environment["NODE_SERVER_IP"]}:8082/test-ajax-post");
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("firstname=Foo&lastname=Bar");
var xhttp2 = new XMLHttpRequest();
xhttp2.open("GET", "http://${environment["NODE_SERVER_IP"]}:8082/test-download-file");
xhttp2.send();
});
</script>
</body>
</html>
"""),
initialHeaders: {}, initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions( initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions( inAppWebViewOptions: InAppWebViewOptions(
...@@ -80,7 +107,6 @@ class InAppWebViewAjaxTestState extends WidgetTestState { ...@@ -80,7 +107,6 @@ class InAppWebViewAjaxTestState extends WidgetTestState {
testsDone++; testsDone++;
if (testsDone == totTests) { if (testsDone == totTests) {
setState(() { }); setState(() { });
nextTest(context: context, state: this);
} }
} }
} }
import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'custom_widget_test.dart';
import 'main_test.dart';
class InAppWebViewContentBlockerTest extends WidgetTest {
final InAppWebViewContentBlockerTestState state = InAppWebViewContentBlockerTestState();
@override
InAppWebViewContentBlockerTestState createState() => state;
}
class InAppWebViewContentBlockerTestState extends WidgetTestState {
String appBarTitle = "InAppWebViewContentBlockerTest";
@override
Widget build(BuildContext context) {
return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container(
child: Column(children: <Widget>[
Expanded(
child: Container(
child: InAppWebView(
initialUrl: "https://flutter.dev/",
initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
clearCache: true,
debuggingEnabled: true,
contentBlockers: [
ContentBlocker(
trigger: ContentBlockerTrigger(
urlFilter: ".*",
resourceType: [
ContentBlockerTriggerResourceType.IMAGE,
ContentBlockerTriggerResourceType.STYLE_SHEET
],
ifTopUrl: [
"https://flutter.dev/"
]),
action: ContentBlockerAction(
type: ContentBlockerActionType.BLOCK))
]
)
),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {
},
onLoadStop: (InAppWebViewController controller, String url) {
setState(() {
appBarTitle = "true";
});
},
),
),
),
])
)
);
}
}
import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'custom_widget_test.dart';
import 'main_test.dart';
class InAppWebViewCookieManagerTest extends WidgetTest {
final InAppWebViewCookieManagerTestState state = InAppWebViewCookieManagerTestState();
@override
InAppWebViewCookieManagerTestState createState() => state;
}
class InAppWebViewCookieManagerTestState extends WidgetTestState {
String appBarTitle = "InAppWebViewCookieManagerTest";
CookieManager cookieManager = CookieManager.instance();
@override
Widget build(BuildContext context) {
return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container(
child: Column(children: <Widget>[
Expanded(
child: Container(
child: InAppWebView(
initialUrl: "https://flutter.dev/",
initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
clearCache: true,
debuggingEnabled: true
)
),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {
},
onLoadStop: (InAppWebViewController controller, String url) async {
var title = "";
await cookieManager.getCookies(url: url);
await cookieManager.setCookie(url: url, name: "myCookie", value: "myValue");
Cookie cookie = await cookieManager.getCookie(url: url, name: "myCookie");
title = cookie.value.toString();
await cookieManager.deleteCookie(url: url, name: "myCookie");
cookie = await cookieManager.getCookie(url: url, name: "myCookie");
title += " " + ((cookie == null) ? "true" : "false");
await cookieManager.deleteCookies(url: url);
List<Cookie> cookies = await cookieManager.getCookies(url: url);
title += " " + ((cookies.length == 0) ? "true" : "false");
setState(() {
appBarTitle = title;
});
},
),
),
),
])
)
);
}
}
...@@ -5,8 +5,8 @@ import 'package:flutter/material.dart'; ...@@ -5,8 +5,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart'; import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart'; import 'main_test.dart';
import 'util_test.dart';
import 'custom_widget_test.dart'; import 'custom_widget_test.dart';
import '.env.dart';
class InAppWebViewFetchTest extends WidgetTest { class InAppWebViewFetchTest extends WidgetTest {
final InAppWebViewFetchTestState state = InAppWebViewFetchTestState(); final InAppWebViewFetchTestState state = InAppWebViewFetchTestState();
...@@ -23,13 +23,56 @@ class InAppWebViewFetchTestState extends WidgetTestState { ...@@ -23,13 +23,56 @@ class InAppWebViewFetchTestState extends WidgetTestState {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle), appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container( body: Container(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
child: Container( child: Container(
child: InAppWebView( child: InAppWebView(
initialFile: "test_assets/in_app_webview_fetch_test.html", initialData: InAppWebViewInitialData(data: """
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>InAppWebViewFetchTest</title>
</head>
<body>
<h1>InAppWebViewFetchTest</h1>
<script>
window.addEventListener('flutterInAppBrowserPlatformReady', function(event) {
fetch(new Request("http://${environment["NODE_SERVER_IP"]}:8082/test-download-file")).then(function(response) {
window.flutter_inappbrowser.callHandler('fetchGet', response.status);
}).catch(function(error) {
window.flutter_inappbrowser.callHandler('fetchGet', "ERROR: " + error);
});
fetch("http://${environment["NODE_SERVER_IP"]}:8082/test-ajax-post", {
method: 'POST',
body: JSON.stringify({
firstname: 'Foo',
lastname: 'Bar'
}),
headers: {
'Content-Type': 'application/json'
}
}).then(function(response) {
response.json().then(function(value) {
window.flutter_inappbrowser.callHandler('fetchPost', value);
}).catch(function(error) {
window.flutter_inappbrowser.callHandler('fetchPost', "ERROR: " + error);
});
}).catch(function(error) {
window.flutter_inappbrowser.callHandler('fetchPost', "ERROR: " + error);
});
});
</script>
</body>
</html>
"""),
initialHeaders: {}, initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions( initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions( inAppWebViewOptions: InAppWebViewOptions(
...@@ -79,7 +122,6 @@ class InAppWebViewFetchTestState extends WidgetTestState { ...@@ -79,7 +122,6 @@ class InAppWebViewFetchTestState extends WidgetTestState {
testsDone++; testsDone++;
if (testsDone == totTests) { if (testsDone == totTests) {
setState(() { }); setState(() { });
nextTest(context: context, state: this);
} }
} }
} }
import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'custom_widget_test.dart';
import 'main_test.dart';
import '.env.dart';
class InAppWebViewHttpAuthCredentialDatabaseTest extends WidgetTest {
final InAppWebViewHttpAuthCredentialDatabaseTestState state = InAppWebViewHttpAuthCredentialDatabaseTestState();
@override
InAppWebViewHttpAuthCredentialDatabaseTestState createState() => state;
}
class InAppWebViewHttpAuthCredentialDatabaseTestState extends WidgetTestState {
String appBarTitle = "InAppWebViewHttpAuthCredentialDatabaseTest";
HttpAuthCredentialDatabase httpAuthCredentialDatabase = HttpAuthCredentialDatabase.instance();
@override
Widget build(BuildContext context) {
httpAuthCredentialDatabase.setHttpAuthCredential(
protectionSpace: ProtectionSpace(host: environment["NODE_SERVER_IP"], protocol: "http", realm: "Node", port: 8081),
credential: HttpAuthCredential(username: "USERNAME", password: "PASSWORD")
);
return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container(
child: Column(children: <Widget>[
Expanded(
child: Container(
child: InAppWebView(
initialUrl: "http://${environment["NODE_SERVER_IP"]}:8081/",
initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
clearCache: true,
debuggingEnabled: true
)
),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {
},
onLoadStop: (InAppWebViewController controller, String url) async {
var title = "";
String h1Content = await controller.evaluateJavascript(source: "document.body.querySelector('h1').textContent");
title = h1Content;
var credentials = await httpAuthCredentialDatabase.getHttpAuthCredentials(protectionSpace:
ProtectionSpace(host: environment["NODE_SERVER_IP"], protocol: "http", realm: "Node", port: 8081)
);
title += " " + ((credentials.length == 1) ? "true" : "false");
await httpAuthCredentialDatabase.clearAllAuthCredentials();
credentials = await httpAuthCredentialDatabase.getHttpAuthCredentials(protectionSpace:
ProtectionSpace(host: environment["NODE_SERVER_IP"], protocol: "http", realm: "Node", port: 8081)
);
title += " " + ((credentials.length == 0) ? "true" : "false");
setState(() {
appBarTitle = title;
});
},
onReceivedHttpAuthRequest: (InAppWebViewController controller, HttpAuthChallenge challenge) async {
return new HttpAuthResponse(action: HttpAuthResponseAction.USE_SAVED_HTTP_AUTH_CREDENTIALS);
},
),
),
),
])
)
);
}
}
import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart';
import 'custom_widget_test.dart';
class InAppWebViewInitialDataTest extends WidgetTest {
final InAppWebViewInitialDataTestState state = InAppWebViewInitialDataTestState();
@override
InAppWebViewInitialDataTestState createState() => state;
}
class InAppWebViewInitialDataTestState extends WidgetTestState {
String appBarTitle = "InAppWebViewInitialDataTest";
@override
Widget build(BuildContext context) {
return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container(
child: Column(children: <Widget>[
Expanded(
child: Container(
child: InAppWebView(
initialData: InAppWebViewInitialData(data: """
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>InAppWebViewInitialDataTest</title>
<link rel="stylesheet" href="https://getbootstrap.com/docs/4.3/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<link rel="shortcut icon" href="favicon.ico">
</head>
<body class="text-center">
<div class="cover-container d-flex w-100 h-100 p-3 mx-auto flex-column">
<header class="masthead mb-auto">
<div class="inner">
<h3 class="masthead-brand">InAppWebViewInitialDataTest</h3>
<nav class="nav nav-masthead justify-content-center">
<a class="nav-link active" href="index.html">Home</a>
<a class="nav-link" href="page-1.html">Page 1</a>
<a class="nav-link" href="page-2.html">Page 2</a>
</nav>
</div>
</header>
<main role="main" class="inner cover">
<h1 class="cover-heading">InAppWebViewInitialFileTest</h1>
<img src="images/flutter-logo.svg" alt="flutter logo">
<p>
<img src="https://via.placeholder.com/100x50" alt="placeholder 100x50">
</p>
<a id="link" href="https://github.com/pichillilorenzo/flutter_inappbrowser">flutter_inappbrowser</a>
</main>
</div>
</body>
</html>
"""),
initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
clearCache: true,
debuggingEnabled: true
)
),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {
},
onLoadStop: (InAppWebViewController controller, String url) {
setState(() {
appBarTitle = "true";
});
},
),
),
),
])
)
);
}
}
...@@ -3,7 +3,6 @@ import 'package:flutter/material.dart'; ...@@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart'; import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart'; import 'main_test.dart';
import 'util_test.dart';
import 'custom_widget_test.dart'; import 'custom_widget_test.dart';
class InAppWebViewInitialFileTest extends WidgetTest { class InAppWebViewInitialFileTest extends WidgetTest {
...@@ -19,7 +18,9 @@ class InAppWebViewInitialFileTestState extends WidgetTestState { ...@@ -19,7 +18,9 @@ class InAppWebViewInitialFileTestState extends WidgetTestState {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle), appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container( body: Container(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
...@@ -43,7 +44,6 @@ class InAppWebViewInitialFileTestState extends WidgetTestState { ...@@ -43,7 +44,6 @@ class InAppWebViewInitialFileTestState extends WidgetTestState {
setState(() { setState(() {
appBarTitle = "true"; appBarTitle = "true";
}); });
nextTest(context: context, state: this);
}, },
), ),
), ),
......
...@@ -4,7 +4,6 @@ import 'package:flutter_inappbrowser/flutter_inappbrowser.dart'; ...@@ -4,7 +4,6 @@ import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'custom_widget_test.dart'; import 'custom_widget_test.dart';
import 'main_test.dart'; import 'main_test.dart';
import 'util_test.dart';
class InAppWebViewInitialUrlTest extends WidgetTest { class InAppWebViewInitialUrlTest extends WidgetTest {
final InAppWebViewInitialUrlTestState state = InAppWebViewInitialUrlTestState(); final InAppWebViewInitialUrlTestState state = InAppWebViewInitialUrlTestState();
...@@ -20,7 +19,9 @@ class InAppWebViewInitialUrlTestState extends WidgetTestState { ...@@ -20,7 +19,9 @@ class InAppWebViewInitialUrlTestState extends WidgetTestState {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle), appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container( body: Container(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
...@@ -44,7 +45,6 @@ class InAppWebViewInitialUrlTestState extends WidgetTestState { ...@@ -44,7 +45,6 @@ class InAppWebViewInitialUrlTestState extends WidgetTestState {
setState(() { setState(() {
appBarTitle = url; appBarTitle = url;
}); });
nextTest(context: context, state: this);
}, },
), ),
), ),
......
...@@ -3,7 +3,6 @@ import 'package:flutter/material.dart'; ...@@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart'; import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart'; import 'main_test.dart';
import 'util_test.dart';
import 'custom_widget_test.dart'; import 'custom_widget_test.dart';
class Foo { class Foo {
...@@ -34,7 +33,9 @@ class InAppWebViewJavaScriptHandlerTestState extends WidgetTestState { ...@@ -34,7 +33,9 @@ class InAppWebViewJavaScriptHandlerTestState extends WidgetTestState {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle), appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container( body: Container(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
...@@ -64,7 +65,6 @@ class InAppWebViewJavaScriptHandlerTestState extends WidgetTestState { ...@@ -64,7 +65,6 @@ class InAppWebViewJavaScriptHandlerTestState extends WidgetTestState {
appBarTitle += " " + (args[3] is Map).toString(); appBarTitle += " " + (args[3] is Map).toString();
appBarTitle += " " + (args[4] is Map).toString(); appBarTitle += " " + (args[4] is Map).toString();
setState(() { }); setState(() { });
nextTest(context: context, state: this);
}); });
}, },
......
...@@ -3,7 +3,6 @@ import 'package:flutter/material.dart'; ...@@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart'; import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart'; import 'main_test.dart';
import 'util_test.dart';
import 'custom_widget_test.dart'; import 'custom_widget_test.dart';
class InAppWebViewOnConsoleMessageTest extends WidgetTest { class InAppWebViewOnConsoleMessageTest extends WidgetTest {
...@@ -19,7 +18,9 @@ class InAppWebViewOnConsoleMessageTestState extends WidgetTestState { ...@@ -19,7 +18,9 @@ class InAppWebViewOnConsoleMessageTestState extends WidgetTestState {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle), appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container( body: Container(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
...@@ -46,7 +47,6 @@ class InAppWebViewOnConsoleMessageTestState extends WidgetTestState { ...@@ -46,7 +47,6 @@ class InAppWebViewOnConsoleMessageTestState extends WidgetTestState {
setState(() { setState(() {
appBarTitle = consoleMessage.message + " " + consoleMessage.messageLevel.toString(); appBarTitle = consoleMessage.message + " " + consoleMessage.messageLevel.toString();
}); });
nextTest(context: context, state: this);
}, },
), ),
), ),
......
...@@ -3,8 +3,8 @@ import 'package:flutter/material.dart'; ...@@ -3,8 +3,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart'; import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart'; import 'main_test.dart';
import 'util_test.dart';
import 'custom_widget_test.dart'; import 'custom_widget_test.dart';
import '.env.dart';
class InAppWebViewOnDownloadStartTest extends WidgetTest { class InAppWebViewOnDownloadStartTest extends WidgetTest {
final InAppWebViewOnDownloadStartTestState state = InAppWebViewOnDownloadStartTestState(); final InAppWebViewOnDownloadStartTestState state = InAppWebViewOnDownloadStartTestState();
...@@ -19,13 +19,34 @@ class InAppWebViewOnDownloadStartTestState extends WidgetTestState { ...@@ -19,13 +19,34 @@ class InAppWebViewOnDownloadStartTestState extends WidgetTestState {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle), appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container( body: Container(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
child: Container( child: Container(
child: InAppWebView( child: InAppWebView(
initialFile: "test_assets/in_app_webview_on_download_start_test.html", initialData: InAppWebViewInitialData(data: """
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>InAppWebViewOnDownloadStartTest</title>
</head>
<body>
<h1>InAppWebViewOnDownloadStartTest</h1>
<a id="download-file" href="http://${environment["NODE_SERVER_IP"]}:8082/test-download-file">download file</a>
<script>
window.addEventListener("flutterInAppBrowserPlatformReady", function(event) {
document.querySelector("#download-file").click();
});
</script>
</body>
</html>
"""),
initialHeaders: {}, initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions( initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions( inAppWebViewOptions: InAppWebViewOptions(
...@@ -47,7 +68,6 @@ class InAppWebViewOnDownloadStartTestState extends WidgetTestState { ...@@ -47,7 +68,6 @@ class InAppWebViewOnDownloadStartTestState extends WidgetTestState {
setState(() { setState(() {
appBarTitle = url; appBarTitle = url;
}); });
nextTest(context: context, state: this);
}, },
), ),
), ),
......
import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart';
import 'custom_widget_test.dart';
class InAppWebViewOnFindResultReceivedTest extends WidgetTest {
final InAppWebViewOnFindResultReceivedTestState state = InAppWebViewOnFindResultReceivedTestState();
@override
InAppWebViewOnFindResultReceivedTestState createState() => state;
}
class InAppWebViewOnFindResultReceivedTestState extends WidgetTestState {
String appBarTitle = "InAppWebViewOnFindResultReceivedTest";
@override
Widget build(BuildContext context) {
return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container(
child: Column(children: <Widget>[
Expanded(
child: Container(
child: InAppWebView(
initialFile: "test_assets/in_app_webview_initial_file_test.html",
initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
clearCache: true,
debuggingEnabled: true
)
),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {
},
onLoadStop: (InAppWebViewController controller, String url) {
controller.findAllAsync(find: "InAppWebViewInitialFileTest");
},
onFindResultReceived: (InAppWebViewController controller, int activeMatchOrdinal, int numberOfMatches, bool isDoneCounting) async {
if (isDoneCounting) {
setState(() {
appBarTitle = numberOfMatches.toString();
});
}
},
),
),
),
])
)
);
}
}
...@@ -3,7 +3,6 @@ import 'package:flutter/material.dart'; ...@@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart'; import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart'; import 'main_test.dart';
import 'util_test.dart';
import 'custom_widget_test.dart'; import 'custom_widget_test.dart';
class InAppWebViewOnJsDialogTest extends WidgetTest { class InAppWebViewOnJsDialogTest extends WidgetTest {
...@@ -27,7 +26,9 @@ class InAppWebViewOnJsDialogTestState extends WidgetTestState { ...@@ -27,7 +26,9 @@ class InAppWebViewOnJsDialogTestState extends WidgetTestState {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle), appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container( body: Container(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
...@@ -54,7 +55,6 @@ class InAppWebViewOnJsDialogTestState extends WidgetTestState { ...@@ -54,7 +55,6 @@ class InAppWebViewOnJsDialogTestState extends WidgetTestState {
setState(() { setState(() {
appBarTitle = "prompt " + args[0]; appBarTitle = "prompt " + args[0];
}); });
nextTest(context: context, state: this);
}); });
}, },
onLoadStart: (InAppWebViewController controller, String url) { onLoadStart: (InAppWebViewController controller, String url) {
......
import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'custom_widget_test.dart';
import 'main_test.dart';
class InAppWebViewOnLoadErrorTest extends WidgetTest {
final InAppWebViewOnLoadErrorTestState state = InAppWebViewOnLoadErrorTestState();
@override
InAppWebViewOnLoadErrorTestState createState() => state;
}
class InAppWebViewOnLoadErrorTestState extends WidgetTestState {
String appBarTitle = "InAppWebViewOnLoadErrorTest";
@override
Widget build(BuildContext context) {
return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container(
child: Column(children: <Widget>[
Expanded(
child: Container(
child: InAppWebView(
initialUrl: "http://not-existing-domain.org/",
initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
clearCache: true,
debuggingEnabled: true
)
),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {
},
onLoadStop: (InAppWebViewController controller, String url) {
},
onLoadError: (InAppWebViewController controller, String url, int code, String message) async {
setState(() {
appBarTitle = code.toString();
});
}
),
),
),
])
)
);
}
}
import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'custom_widget_test.dart';
import 'main_test.dart';
class InAppWebViewOnLoadHttpErrorTest extends WidgetTest {
final InAppWebViewOnLoadHttpErrorTestState state = InAppWebViewOnLoadHttpErrorTestState();
@override
InAppWebViewOnLoadHttpErrorTestState createState() => state;
}
class InAppWebViewOnLoadHttpErrorTestState extends WidgetTestState {
String appBarTitle = "InAppWebViewOnLoadHttpErrorTest";
@override
Widget build(BuildContext context) {
return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container(
child: Column(children: <Widget>[
Expanded(
child: Container(
child: InAppWebView(
initialUrl: "https://google.com/404",
initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
clearCache: true,
debuggingEnabled: true
)
),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {
},
onLoadStop: (InAppWebViewController controller, String url) {
},
onLoadHttpError: (InAppWebViewController controller, String url, int statusCode, String description) async {
setState(() {
appBarTitle = statusCode.toString();
});
},
),
),
),
])
)
);
}
}
...@@ -4,7 +4,6 @@ import 'package:flutter/services.dart'; ...@@ -4,7 +4,6 @@ import 'package:flutter/services.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart'; import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart'; import 'main_test.dart';
import 'util_test.dart';
import 'custom_widget_test.dart'; import 'custom_widget_test.dart';
class InAppWebViewOnLoadResourceCustomSchemeTest extends WidgetTest { class InAppWebViewOnLoadResourceCustomSchemeTest extends WidgetTest {
...@@ -20,7 +19,9 @@ class InAppWebViewOnLoadResourceCustomSchemeTestState extends WidgetTestState { ...@@ -20,7 +19,9 @@ class InAppWebViewOnLoadResourceCustomSchemeTestState extends WidgetTestState {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle), appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container( body: Container(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
...@@ -42,7 +43,6 @@ class InAppWebViewOnLoadResourceCustomSchemeTestState extends WidgetTestState { ...@@ -42,7 +43,6 @@ class InAppWebViewOnLoadResourceCustomSchemeTestState extends WidgetTestState {
setState(() { setState(() {
appBarTitle = "true"; appBarTitle = "true";
}); });
nextTest(context: context, state: this);
}); });
}, },
onLoadStart: (InAppWebViewController controller, String url) { onLoadStart: (InAppWebViewController controller, String url) {
......
...@@ -3,7 +3,6 @@ import 'package:flutter/material.dart'; ...@@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart'; import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart'; import 'main_test.dart';
import 'util_test.dart';
import 'custom_widget_test.dart'; import 'custom_widget_test.dart';
class InAppWebViewOnLoadResourceTest extends WidgetTest { class InAppWebViewOnLoadResourceTest extends WidgetTest {
...@@ -25,7 +24,9 @@ class InAppWebViewOnLoadResourceTestState extends WidgetTestState { ...@@ -25,7 +24,9 @@ class InAppWebViewOnLoadResourceTestState extends WidgetTestState {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle), appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container( body: Container(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
...@@ -54,7 +55,6 @@ class InAppWebViewOnLoadResourceTestState extends WidgetTestState { ...@@ -54,7 +55,6 @@ class InAppWebViewOnLoadResourceTestState extends WidgetTestState {
countResources++; countResources++;
if (countResources == resourceList.length) { if (countResources == resourceList.length) {
setState(() { }); setState(() { });
nextTest(context: context, state: this);
} }
} }
), ),
......
import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart';
import 'custom_widget_test.dart';
class InAppWebViewOnNavigationStateChangeTest extends WidgetTest {
final InAppWebViewOnNavigationStateChangeTestState state = InAppWebViewOnNavigationStateChangeTestState();
@override
InAppWebViewOnNavigationStateChangeTestState createState() => state;
}
class InAppWebViewOnNavigationStateChangeTestState extends WidgetTestState {
String appBarTitle = "InAppWebViewOnNavigationStateChangeTest";
@override
Widget build(BuildContext context) {
return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container(
child: Column(children: <Widget>[
Expanded(
child: Container(
child: InAppWebView(
initialUrl: "https://flutter.dev/",
initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
clearCache: true,
debuggingEnabled: true
)
),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {
},
onLoadStop: (InAppWebViewController controller, String url) {
controller.evaluateJavascript(source: """
var state = {}
var title = ''
var url = 'first-push';
history.pushState(state, title, url);
setTimeout(function() {
var url = 'second-push';
history.pushState(state, title, url);
}, 100);
""");
},
onNavigationStateChange: (InAppWebViewController controller, String url) async {
if (url.endsWith("second-push")) {
setState(() {
appBarTitle += " " + url;
});
} else {
appBarTitle = url;
}
},
),
),
),
])
)
);
}
}
import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'custom_widget_test.dart';
import 'main_test.dart';
class InAppWebViewOnProgressChangedTest extends WidgetTest {
final InAppWebViewOnProgressChangedTestState state = InAppWebViewOnProgressChangedTestState();
@override
InAppWebViewOnProgressChangedTestState createState() => state;
}
class InAppWebViewOnProgressChangedTestState extends WidgetTestState {
String appBarTitle = "InAppWebViewOnProgressChangedTest";
@override
Widget build(BuildContext context) {
return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container(
child: Column(children: <Widget>[
Expanded(
child: Container(
child: InAppWebView(
initialUrl: "https://flutter.dev/",
initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
clearCache: true,
debuggingEnabled: true
)
),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {
},
onLoadStop: (InAppWebViewController controller, String url) {
},
onProgressChanged: (InAppWebViewController controller, int progress) {
if (progress == 100) {
setState(() {
appBarTitle = "true";
});
}
},
),
),
),
])
)
);
}
}
...@@ -4,7 +4,7 @@ import 'package:flutter_inappbrowser/flutter_inappbrowser.dart'; ...@@ -4,7 +4,7 @@ import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'custom_widget_test.dart'; import 'custom_widget_test.dart';
import 'main_test.dart'; import 'main_test.dart';
import 'util_test.dart'; import '.env.dart';
class InAppWebViewOnReceivedHttpAuthRequestTest extends WidgetTest { class InAppWebViewOnReceivedHttpAuthRequestTest extends WidgetTest {
final InAppWebViewOnReceivedHttpAuthRequestTestState state = InAppWebViewOnReceivedHttpAuthRequestTestState(); final InAppWebViewOnReceivedHttpAuthRequestTestState state = InAppWebViewOnReceivedHttpAuthRequestTestState();
...@@ -20,13 +20,15 @@ class InAppWebViewOnReceivedHttpAuthRequestTestState extends WidgetTestState { ...@@ -20,13 +20,15 @@ class InAppWebViewOnReceivedHttpAuthRequestTestState extends WidgetTestState {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle), appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container( body: Container(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
child: Container( child: Container(
child: InAppWebView( child: InAppWebView(
initialUrl: "http://192.168.1.20:8081/", initialUrl: "http://${environment["NODE_SERVER_IP"]}:8081/",
initialHeaders: {}, initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions( initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions( inAppWebViewOptions: InAppWebViewOptions(
...@@ -45,7 +47,6 @@ class InAppWebViewOnReceivedHttpAuthRequestTestState extends WidgetTestState { ...@@ -45,7 +47,6 @@ class InAppWebViewOnReceivedHttpAuthRequestTestState extends WidgetTestState {
setState(() { setState(() {
appBarTitle = h1Content; appBarTitle = h1Content;
}); });
nextTest(context: context, state: this);
}, },
onReceivedHttpAuthRequest: (InAppWebViewController controller, HttpAuthChallenge challenge) async { onReceivedHttpAuthRequest: (InAppWebViewController controller, HttpAuthChallenge challenge) async {
return new HttpAuthResponse( return new HttpAuthResponse(
......
...@@ -6,7 +6,6 @@ import 'package:flutter_inappbrowser/flutter_inappbrowser.dart'; ...@@ -6,7 +6,6 @@ import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'custom_widget_test.dart'; import 'custom_widget_test.dart';
import 'main_test.dart'; import 'main_test.dart';
import 'util_test.dart';
class InAppWebViewOnSafeBrowsingHitTest extends WidgetTest { class InAppWebViewOnSafeBrowsingHitTest extends WidgetTest {
final InAppWebViewOnSafeBrowsingHitTestState state = InAppWebViewOnSafeBrowsingHitTestState(); final InAppWebViewOnSafeBrowsingHitTestState state = InAppWebViewOnSafeBrowsingHitTestState();
...@@ -22,13 +21,15 @@ class InAppWebViewOnSafeBrowsingHitTestState extends WidgetTestState { ...@@ -22,13 +21,15 @@ class InAppWebViewOnSafeBrowsingHitTestState extends WidgetTestState {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle), appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container( body: Container(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
child: Container( child: Container(
child: InAppWebView( child: InAppWebView(
initialUrl: "chrome://safe-browsing/match?type=malware", initialUrl: (Platform.isAndroid) ? "chrome://safe-browsing/match?type=malware" : "https://flutter.dev/",
initialHeaders: {}, initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions( initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions( inAppWebViewOptions: InAppWebViewOptions(
...@@ -38,8 +39,6 @@ class InAppWebViewOnSafeBrowsingHitTestState extends WidgetTestState { ...@@ -38,8 +39,6 @@ class InAppWebViewOnSafeBrowsingHitTestState extends WidgetTestState {
debuggingEnabled: true debuggingEnabled: true
), ),
androidInAppWebViewOptions: AndroidInAppWebViewOptions( androidInAppWebViewOptions: AndroidInAppWebViewOptions(
databaseEnabled: true,
domStorageEnabled: true,
safeBrowsingEnabled: true, safeBrowsingEnabled: true,
), ),
), ),
...@@ -55,7 +54,6 @@ class InAppWebViewOnSafeBrowsingHitTestState extends WidgetTestState { ...@@ -55,7 +54,6 @@ class InAppWebViewOnSafeBrowsingHitTestState extends WidgetTestState {
setState(() { setState(() {
appBarTitle = url; appBarTitle = url;
}); });
nextTest(context: context, state: this);
}, },
onSafeBrowsingHit: (InAppWebViewController controller, String url, SafeBrowsingThreat threatType) async { onSafeBrowsingHit: (InAppWebViewController controller, String url, SafeBrowsingThreat threatType) async {
return SafeBrowsingResponse(report: true, action: SafeBrowsingResponseAction.PROCEED); return SafeBrowsingResponse(report: true, action: SafeBrowsingResponseAction.PROCEED);
......
import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'custom_widget_test.dart';
import 'main_test.dart';
class InAppWebViewOnScrollChangedTest extends WidgetTest {
final InAppWebViewOnScrollChangedTestState state = InAppWebViewOnScrollChangedTestState();
@override
InAppWebViewOnScrollChangedTestState createState() => state;
}
class InAppWebViewOnScrollChangedTestState extends WidgetTestState {
String appBarTitle = "InAppWebViewOnScrollChangedTest";
bool scrolled = false;
@override
Widget build(BuildContext context) {
return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container(
child: Column(children: <Widget>[
Expanded(
child: Container(
child: InAppWebView(
initialUrl: "https://flutter.dev/",
initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
clearCache: true,
debuggingEnabled: true
)
),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {
},
onLoadStop: (InAppWebViewController controller, String url) {
controller.scrollTo(x: 0, y: 500);
},
onScrollChanged: (InAppWebViewController controller, int x, int y) {
if (!scrolled) {
scrolled = true;
setState(() {
appBarTitle = "true";
});
}
},
),
),
),
])
)
);
}
}
...@@ -3,7 +3,6 @@ import 'package:flutter/material.dart'; ...@@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart'; import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart'; import 'main_test.dart';
import 'util_test.dart';
import 'custom_widget_test.dart'; import 'custom_widget_test.dart';
class InAppWebViewOnTargetBlankTest extends WidgetTest { class InAppWebViewOnTargetBlankTest extends WidgetTest {
...@@ -19,7 +18,9 @@ class InAppWebViewOnTargetBlankTestState extends WidgetTestState { ...@@ -19,7 +18,9 @@ class InAppWebViewOnTargetBlankTestState extends WidgetTestState {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle), appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container( body: Container(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
...@@ -46,7 +47,6 @@ class InAppWebViewOnTargetBlankTestState extends WidgetTestState { ...@@ -46,7 +47,6 @@ class InAppWebViewOnTargetBlankTestState extends WidgetTestState {
setState(() { setState(() {
appBarTitle = url; appBarTitle = url;
}); });
nextTest(context: context, state: this);
} }
}, },
onTargetBlank: (InAppWebViewController controller, String url) { onTargetBlank: (InAppWebViewController controller, String url) {
......
...@@ -4,7 +4,6 @@ import 'package:flutter_inappbrowser/flutter_inappbrowser.dart'; ...@@ -4,7 +4,6 @@ import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'custom_widget_test.dart'; import 'custom_widget_test.dart';
import 'main_test.dart'; import 'main_test.dart';
import 'util_test.dart';
class InAppWebViewShouldOverrideUrlLoadingTest extends WidgetTest { class InAppWebViewShouldOverrideUrlLoadingTest extends WidgetTest {
final InAppWebViewShouldOverrideUrlLoadingTestState state = InAppWebViewShouldOverrideUrlLoadingTestState(); final InAppWebViewShouldOverrideUrlLoadingTestState state = InAppWebViewShouldOverrideUrlLoadingTestState();
...@@ -19,7 +18,9 @@ class InAppWebViewShouldOverrideUrlLoadingTestState extends WidgetTestState { ...@@ -19,7 +18,9 @@ class InAppWebViewShouldOverrideUrlLoadingTestState extends WidgetTestState {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle), appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container( body: Container(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Expanded( Expanded(
...@@ -45,7 +46,6 @@ class InAppWebViewShouldOverrideUrlLoadingTestState extends WidgetTestState { ...@@ -45,7 +46,6 @@ class InAppWebViewShouldOverrideUrlLoadingTestState extends WidgetTestState {
setState(() { setState(() {
appBarTitle = url; appBarTitle = url;
}); });
nextTest(context: context, state: this);
} else { } else {
controller.evaluateJavascript(source: "document.querySelector('#link').click();"); controller.evaluateJavascript(source: "document.querySelector('#link').click();");
} }
......
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'custom_widget_test.dart';
import 'main_test.dart';
import '.env.dart';
class InAppWebViewSslRequestTest extends WidgetTest {
final InAppWebViewSslRequestTestState state = InAppWebViewSslRequestTestState();
@override
InAppWebViewSslRequestTestState createState() => state;
}
class InAppWebViewSslRequestTestState extends WidgetTestState {
String appBarTitle = "InAppWebViewSslRequestTest";
@override
Widget build(BuildContext context) {
return Scaffold(
key: this.scaffoldKey,
appBar: myAppBar(state: this, title: appBarTitle),
drawer: myDrawer(context: context),
body: Container(
child: Column(children: <Widget>[
Expanded(
child: Container(
child: InAppWebView(
initialUrl: "https://${environment["NODE_SERVER_IP"]}:4433/",
initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
clearCache: true,
debuggingEnabled: true
)
),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {
},
onLoadStop: (InAppWebViewController controller, String url) async {
String h1Content = await controller.evaluateJavascript(source: "document.body.querySelector('h1').textContent");
setState(() {
appBarTitle = h1Content;
});
},
onReceivedServerTrustAuthRequest: (InAppWebViewController controller, ServerTrustChallenge challenge) async {
return new ServerTrustAuthResponse(action: ServerTrustAuthResponseAction.PROCEED);
},
onReceivedClientCertRequest: (InAppWebViewController controller, ClientCertChallenge challenge) async {
return new ClientCertResponse(
certificatePath: "test_assets/certificate.pfx",
certificatePassword: "",
androidKeyStoreType: "PKCS12",
action: ClientCertResponseAction.PROCEED);
},
),
),
),
])
)
);
}
}
...@@ -4,31 +4,43 @@ import 'package:flutter/material.dart'; ...@@ -4,31 +4,43 @@ import 'package:flutter/material.dart';
import 'custom_widget_test.dart'; import 'custom_widget_test.dart';
import 'in_app_webview_ajax_test.dart'; import 'in_app_webview_ajax_test.dart';
import 'in_app_webview_content_blocker_test.dart';
import 'in_app_webview_cookie_manager_test.dart';
import 'in_app_webview_fetch_test.dart'; import 'in_app_webview_fetch_test.dart';
import 'in_app_webview_http_auth_credential_database_test.dart';
import 'in_app_webview_initial_data_test.dart';
import 'in_app_webview_initial_file_test.dart'; import 'in_app_webview_initial_file_test.dart';
import 'in_app_webview_initial_url_test.dart'; import 'in_app_webview_initial_url_test.dart';
import 'in_app_webview_javascript_handler_test.dart'; import 'in_app_webview_javascript_handler_test.dart';
import 'in_app_webview_on_console_message_test.dart'; import 'in_app_webview_on_console_message_test.dart';
import 'in_app_webview_on_download_start_test.dart'; import 'in_app_webview_on_download_start_test.dart';
import 'in_app_webview_on_find_result_received_test.dart';
import 'in_app_webview_on_js_dialog_test.dart'; import 'in_app_webview_on_js_dialog_test.dart';
import 'in_app_webview_on_load_error_test.dart';
import 'in_app_webview_on_load_http_error_test.dart';
import 'in_app_webview_on_load_resource_custom_scheme_test.dart'; import 'in_app_webview_on_load_resource_custom_scheme_test.dart';
import 'in_app_webview_on_load_resource_test.dart'; import 'in_app_webview_on_load_resource_test.dart';
import 'in_app_webview_on_navigation_state_change_test.dart';
import 'in_app_webview_on_progress_changed_test.dart';
import 'in_app_webview_on_received_http_auth_request_test.dart'; import 'in_app_webview_on_received_http_auth_request_test.dart';
import 'in_app_webview_on_safe_browsing_hit_test.dart'; import 'in_app_webview_on_safe_browsing_hit_test.dart';
import 'in_app_webview_on_scroll_changed_test.dart';
import 'in_app_webview_on_target_blank_test.dart'; import 'in_app_webview_on_target_blank_test.dart';
import 'in_app_webview_should_override_url_loading_test.dart'; import 'in_app_webview_should_override_url_loading_test.dart';
import 'in_app_webview_ssl_request_test.dart';
List<String> testRoutes = []; Map<String, WidgetBuilder> getTestRoutes({@required BuildContext context}) {
Map<String, WidgetBuilder> buildRoutes({@required BuildContext context}) {
var routes = { var routes = {
'/': (context) => InAppWebViewInitialUrlTest(), '/': (context) => InAppWebViewInitialUrlTest(),
'/InAppWebViewInitialFileTest': (context) => InAppWebViewInitialFileTest(), '/InAppWebViewInitialFileTest': (context) => InAppWebViewInitialFileTest(),
'/InAppWebViewInitialDataTest': (context) => InAppWebViewInitialDataTest(),
'/InAppWebViewOnProgressChangedTest': (context) => InAppWebViewOnProgressChangedTest(),
'/InAppWebViewOnScrollChangedTest': (context) => InAppWebViewOnScrollChangedTest(),
'/InAppWebViewOnLoadResourceTest': (context) => InAppWebViewOnLoadResourceTest(), '/InAppWebViewOnLoadResourceTest': (context) => InAppWebViewOnLoadResourceTest(),
'/InAppWebViewJavaScriptHandlerTest': (context) => InAppWebViewJavaScriptHandlerTest(), '/InAppWebViewJavaScriptHandlerTest': (context) => InAppWebViewJavaScriptHandlerTest(),
'/InAppWebViewAjaxTest': (context) => InAppWebViewAjaxTest(), '/InAppWebViewAjaxTest': (context) => InAppWebViewAjaxTest(),
'/InAppWebViewOnLoadResourceCustomSchemeTest': (context) => InAppWebViewOnLoadResourceCustomSchemeTest(),
'/InAppWebViewFetchTest': (context) => InAppWebViewFetchTest(),
'/InAppWebViewFetchTest': (context) => InAppWebViewFetchTest(), '/InAppWebViewFetchTest': (context) => InAppWebViewFetchTest(),
'/InAppWebViewOnLoadResourceCustomSchemeTest': (context) => InAppWebViewOnLoadResourceCustomSchemeTest(),
'/InAppWebViewShouldOverrideUrlLoadingTest': (context) => InAppWebViewShouldOverrideUrlLoadingTest(), '/InAppWebViewShouldOverrideUrlLoadingTest': (context) => InAppWebViewShouldOverrideUrlLoadingTest(),
'/InAppWebViewOnConsoleMessageTest': (context) => InAppWebViewOnConsoleMessageTest(), '/InAppWebViewOnConsoleMessageTest': (context) => InAppWebViewOnConsoleMessageTest(),
'/InAppWebViewOnDownloadStartTest': (context) => InAppWebViewOnDownloadStartTest(), '/InAppWebViewOnDownloadStartTest': (context) => InAppWebViewOnDownloadStartTest(),
...@@ -36,18 +48,33 @@ Map<String, WidgetBuilder> buildRoutes({@required BuildContext context}) { ...@@ -36,18 +48,33 @@ Map<String, WidgetBuilder> buildRoutes({@required BuildContext context}) {
'/InAppWebViewOnJsDialogTest': (context) => InAppWebViewOnJsDialogTest(), '/InAppWebViewOnJsDialogTest': (context) => InAppWebViewOnJsDialogTest(),
'/InAppWebViewOnSafeBrowsingHitTest': (context) => InAppWebViewOnSafeBrowsingHitTest(), '/InAppWebViewOnSafeBrowsingHitTest': (context) => InAppWebViewOnSafeBrowsingHitTest(),
'/InAppWebViewOnReceivedHttpAuthRequestTest': (context) => InAppWebViewOnReceivedHttpAuthRequestTest(), '/InAppWebViewOnReceivedHttpAuthRequestTest': (context) => InAppWebViewOnReceivedHttpAuthRequestTest(),
'/InAppWebViewSslRequestTest': (context) => InAppWebViewSslRequestTest(),
'/InAppWebViewOnFindResultReceivedTest': (context) => InAppWebViewOnFindResultReceivedTest(),
'/InAppWebViewOnNavigationStateChangeTest': (context) => InAppWebViewOnNavigationStateChangeTest(),
'/InAppWebViewOnLoadErrorTest': (context) => InAppWebViewOnLoadErrorTest(),
'/InAppWebViewOnLoadHttpErrorTest': (context) => InAppWebViewOnLoadHttpErrorTest(),
'/InAppWebViewCookieManagerTest': (context) => InAppWebViewCookieManagerTest(),
'/InAppWebViewHttpAuthCredentialDatabaseTest': (context) => InAppWebViewHttpAuthCredentialDatabaseTest(),
'/InAppWebViewContentBlockerTest': (context) => InAppWebViewContentBlockerTest(),
}; };
routes.forEach((k, v) => testRoutes.add(k));
return routes; return routes;
} }
AppBar myAppBar({@required WidgetTestState state, @required String title}) { AppBar myAppBar({@required WidgetTestState state, @required String title}) {
return AppBar( return AppBar(
title: Text( title: Text(
title, title,
key: Key("AppBarTitle") key: Key("AppBarTitle")
), ),
actions: <Widget>[ actions: <Widget>[
IconButton(
icon: Icon(Icons.menu),
key: Key("SideMenu"),
onPressed: () {
state.scaffoldKey.currentState.openDrawer();
},
),
IconButton( IconButton(
icon: Icon(Icons.refresh), icon: Icon(Icons.refresh),
onPressed: () { onPressed: () {
...@@ -59,6 +86,40 @@ AppBar myAppBar({@required WidgetTestState state, @required String title}) { ...@@ -59,6 +86,40 @@ AppBar myAppBar({@required WidgetTestState state, @required String title}) {
); );
} }
Drawer myDrawer({@required context}) {
var routes = getTestRoutes(context: context);
List<Widget> listTiles = [
DrawerHeader(
child: Text('Tests'),
decoration: BoxDecoration(
color: Colors.blue,
),
)
];
for (String k in routes.keys) {
var title = "";
if (k == "/") {
title = "InAppWebViewInitialUrlTest";
} else {
title = k.substring(1);
}
listTiles.add(ListTile(
title: Text(title),
key: Key(title),
onTap: () {
Navigator.pushReplacementNamed(context, k);
},
));
}
return Drawer(
child: ListView(
key: Key("ListTiles"),
padding: EdgeInsets.zero,
children: listTiles,
),
);
}
Future main() async { Future main() async {
runApp(new MyApp()); runApp(new MyApp());
} }
...@@ -85,7 +146,7 @@ class _MyAppState extends State<MyApp> { ...@@ -85,7 +146,7 @@ class _MyAppState extends State<MyApp> {
return MaterialApp( return MaterialApp(
title: 'flutter_inappbrowser tests', title: 'flutter_inappbrowser tests',
initialRoute: '/', initialRoute: '/',
routes: buildRoutes(context: context) routes: getTestRoutes(context: context)
); );
} }
} }
\ No newline at end of file
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'custom_widget_test.dart';
import 'main_test.dart';
int currentTest = 0;
void nextTest({@required BuildContext context, @required WidgetTestState state}) {
if (currentTest + 1 < testRoutes.length) {
currentTest++;
String nextRoute = testRoutes[currentTest];
Future.delayed(const Duration(milliseconds: 2000)).then((value) {
Navigator.pushReplacementNamed(context, nextRoute);
});
}
}
\ No newline at end of file
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'types.dart';
///ContentBlocker class represents a set of rules to use block content in the browser window. ///ContentBlocker class represents a set of rules to use block content in the browser window.
/// ///
...@@ -34,56 +35,6 @@ class ContentBlocker { ...@@ -34,56 +35,6 @@ class ContentBlocker {
} }
} }
///ContentBlockerTriggerResourceType class represents the possible resource type defined for a [ContentBlockerTrigger].
class ContentBlockerTriggerResourceType {
final String _value;
const ContentBlockerTriggerResourceType._internal(this._value);
static ContentBlockerTriggerResourceType fromValue(String value) {
return (["document", "image", "style-sheet", "script", "font",
"media", "svg-document", "raw"].contains(value)) ? ContentBlockerTriggerResourceType._internal(value) : null;
}
String toValue() => _value;
@override
String toString() => _value;
static const DOCUMENT = const ContentBlockerTriggerResourceType._internal('document');
static const IMAGE = const ContentBlockerTriggerResourceType._internal('image');
static const STYLE_SHEET = const ContentBlockerTriggerResourceType._internal('style-sheet');
static const SCRIPT = const ContentBlockerTriggerResourceType._internal('script');
static const FONT = const ContentBlockerTriggerResourceType._internal('font');
static const MEDIA = const ContentBlockerTriggerResourceType._internal('media');
static const SVG_DOCUMENT = const ContentBlockerTriggerResourceType._internal('svg-document');
///Any untyped load
static const RAW = const ContentBlockerTriggerResourceType._internal('raw');
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
}
///ContentBlockerTriggerLoadType class represents the possible load type for a [ContentBlockerTrigger].
class ContentBlockerTriggerLoadType {
final String _value;
const ContentBlockerTriggerLoadType._internal(this._value);
static ContentBlockerTriggerLoadType fromValue(String value) {
return (["first-party", "third-party"].contains(value)) ? ContentBlockerTriggerLoadType._internal(value) : null;
}
String toValue() => _value;
@override
String toString() => _value;
///FIRST_PARTY is triggered only if the resource has the same scheme, domain, and port as the main page resource.
static const FIRST_PARTY = const ContentBlockerTriggerLoadType._internal('first-party');
///THIRD_PARTY is triggered if the resource is not from the same domain as the main page resource.
static const THIRD_PARTY = const ContentBlockerTriggerLoadType._internal('third-party');
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
}
///Trigger of the content blocker. The trigger tells to the WebView when to perform the corresponding action. ///Trigger of the content blocker. The trigger tells to the WebView when to perform the corresponding action.
///A trigger dictionary must include an [ContentBlockerTrigger.urlFilter], which specifies a pattern to match the URL against. ///A trigger dictionary must include an [ContentBlockerTrigger.urlFilter], which specifies a pattern to match the URL against.
///The remaining properties are optional and modify the behavior of the trigger. ///The remaining properties are optional and modify the behavior of the trigger.
...@@ -184,32 +135,6 @@ class ContentBlockerTrigger { ...@@ -184,32 +135,6 @@ class ContentBlockerTrigger {
} }
} }
///ContentBlockerActionType class represents the kind of action that can be used with a [ContentBlockerTrigger].
class ContentBlockerActionType {
final String _value;
const ContentBlockerActionType._internal(this._value);
static ContentBlockerActionType fromValue(String value) {
return (["block", "css-display-none", "make-https"].contains(value)) ? ContentBlockerActionType._internal(value) : null;
}
String toValue() => _value;
@override
String toString() => _value;
///Stops loading of the resource. If the resource was cached, the cache is ignored.
static const BLOCK = const ContentBlockerActionType._internal('block');
///Hides elements of the page based on a CSS selector. A selector field contains the selector list. Any matching element has its display property set to none, which hides it.
///
///**NOTE**: on Android, JavaScript must be enabled.
static const CSS_DISPLAY_NONE = const ContentBlockerActionType._internal('css-display-none');
///Changes a URL from http to https. URLs with a specified (nondefault) port and links using other protocols are unaffected.
static const MAKE_HTTPS = const ContentBlockerActionType._internal('make-https');
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
}
///Action associated to the trigger. The action tells to the WebView what to do when the trigger is matched. ///Action associated to the trigger. The action tells to the WebView what to do when the trigger is matched.
///When a trigger matches a resource, the browser queues the associated action for execution. ///When a trigger matches a resource, the browser queues the associated action for execution.
///The WebView evaluates all the triggers, it executes the actions in order. ///The WebView evaluates all the triggers, it executes the actions in order.
......
...@@ -3,6 +3,8 @@ import 'dart:async'; ...@@ -3,6 +3,8 @@ import 'dart:async';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'types.dart';
///Manages the cookies used by WebView instances. ///Manages the cookies used by WebView instances.
/// ///
///**NOTE for iOS**: available from iOS 11.0+. ///**NOTE for iOS**: available from iOS 11.0+.
...@@ -56,22 +58,22 @@ class CookieManager { ...@@ -56,22 +58,22 @@ class CookieManager {
} }
///Gets all the cookies for the given [url]. ///Gets all the cookies for the given [url].
Future<List<Map<String, dynamic>>> getCookies({@required String url}) async { Future<List<Cookie>> getCookies({@required String url}) async {
assert(url != null && url.isNotEmpty); assert(url != null && url.isNotEmpty);
Map<String, dynamic> args = <String, dynamic>{}; Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent('url', () => url); args.putIfAbsent('url', () => url);
List<dynamic> cookies = await _channel.invokeMethod('getCookies', args); List<dynamic> cookieListMap = await _channel.invokeMethod('getCookies', args);
cookies = cookies.cast<Map<dynamic, dynamic>>(); cookieListMap = cookieListMap.cast<Map<dynamic, dynamic>>();
for(var i = 0; i < cookies.length; i++) { List<Cookie> cookies = [];
cookies[i] = cookies[i].cast<String, dynamic>(); for(var i = 0; i < cookieListMap.length; i++) {
cookies.add(Cookie(name: cookieListMap[i]["name"], value: cookieListMap[i]["value"]));
} }
cookies = cookies.cast<Map<String, dynamic>>();
return cookies; return cookies;
} }
///Gets a cookie by its [name] for the given [url]. ///Gets a cookie by its [name] for the given [url].
Future<Map<String, dynamic>> getCookie({@required String url, @required String name}) async { Future<Cookie> getCookie({@required String url, @required String name}) async {
assert(url != null && url.isNotEmpty); assert(url != null && url.isNotEmpty);
assert(name != null && name.isNotEmpty); assert(name != null && name.isNotEmpty);
...@@ -82,7 +84,7 @@ class CookieManager { ...@@ -82,7 +84,7 @@ class CookieManager {
for(var i = 0; i < cookies.length; i++) { for(var i = 0; i < cookies.length; i++) {
cookies[i] = cookies[i].cast<String, dynamic>(); cookies[i] = cookies[i].cast<String, dynamic>();
if (cookies[i]["name"] == name) if (cookies[i]["name"] == name)
return cookies[i]; return Cookie(name: cookies[i]["name"], value: cookies[i]["value"]);
} }
return null; return null;
} }
......
...@@ -1499,4 +1499,91 @@ class FetchRequest { ...@@ -1499,4 +1499,91 @@ class FetchRequest {
} }
return null; return null;
} }
}
///ContentBlockerTriggerResourceType class represents the possible resource type defined for a [ContentBlockerTrigger].
class ContentBlockerTriggerResourceType {
final String _value;
const ContentBlockerTriggerResourceType._internal(this._value);
static ContentBlockerTriggerResourceType fromValue(String value) {
return (["document", "image", "style-sheet", "script", "font",
"media", "svg-document", "raw"].contains(value)) ? ContentBlockerTriggerResourceType._internal(value) : null;
}
String toValue() => _value;
@override
String toString() => _value;
static const DOCUMENT = const ContentBlockerTriggerResourceType._internal('document');
static const IMAGE = const ContentBlockerTriggerResourceType._internal('image');
static const STYLE_SHEET = const ContentBlockerTriggerResourceType._internal('style-sheet');
static const SCRIPT = const ContentBlockerTriggerResourceType._internal('script');
static const FONT = const ContentBlockerTriggerResourceType._internal('font');
static const MEDIA = const ContentBlockerTriggerResourceType._internal('media');
static const SVG_DOCUMENT = const ContentBlockerTriggerResourceType._internal('svg-document');
///Any untyped load
static const RAW = const ContentBlockerTriggerResourceType._internal('raw');
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
}
///ContentBlockerTriggerLoadType class represents the possible load type for a [ContentBlockerTrigger].
class ContentBlockerTriggerLoadType {
final String _value;
const ContentBlockerTriggerLoadType._internal(this._value);
static ContentBlockerTriggerLoadType fromValue(String value) {
return (["first-party", "third-party"].contains(value)) ? ContentBlockerTriggerLoadType._internal(value) : null;
}
String toValue() => _value;
@override
String toString() => _value;
///FIRST_PARTY is triggered only if the resource has the same scheme, domain, and port as the main page resource.
static const FIRST_PARTY = const ContentBlockerTriggerLoadType._internal('first-party');
///THIRD_PARTY is triggered if the resource is not from the same domain as the main page resource.
static const THIRD_PARTY = const ContentBlockerTriggerLoadType._internal('third-party');
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
}
///ContentBlockerActionType class represents the kind of action that can be used with a [ContentBlockerTrigger].
class ContentBlockerActionType {
final String _value;
const ContentBlockerActionType._internal(this._value);
static ContentBlockerActionType fromValue(String value) {
return (["block", "css-display-none", "make-https"].contains(value)) ? ContentBlockerActionType._internal(value) : null;
}
String toValue() => _value;
@override
String toString() => _value;
///Stops loading of the resource. If the resource was cached, the cache is ignored.
static const BLOCK = const ContentBlockerActionType._internal('block');
///Hides elements of the page based on a CSS selector. A selector field contains the selector list. Any matching element has its display property set to none, which hides it.
///
///**NOTE**: on Android, JavaScript must be enabled.
static const CSS_DISPLAY_NONE = const ContentBlockerActionType._internal('css-display-none');
///Changes a URL from http to https. URLs with a specified (nondefault) port and links using other protocols are unaffected.
static const MAKE_HTTPS = const ContentBlockerActionType._internal('make-https');
bool operator ==(value) => value == _value;
@override
int get hashCode => _value.hashCode;
}
///Cookie class represents a cookie returned by the [CookieManager].
class Cookie {
///The name;
String name;
///The value;
dynamic value;
Cookie({@required this.name, @required this.value});
} }
\ No newline at end of file
...@@ -22,44 +22,56 @@ appHttps.get('/', (req, res) => { ...@@ -22,44 +22,56 @@ appHttps.get('/', (req, res) => {
console.log(JSON.stringify(req.headers)) console.log(JSON.stringify(req.headers))
const cert = req.connection.getPeerCertificate() const cert = req.connection.getPeerCertificate()
// The `req.client.authorized` flag will be true if the certificate is valid and was issued by a CA we white-listed // The `req.client.authorized` flag will be true if the certificate is valid and was issued by a CA we white-listed
// earlier in `opts.ca`. We display the name of our user (CN = Common Name) and the name of the issuer, which is // earlier in `opts.ca`. We display the name of our user (CN = Common Name) and the name of the issuer, which is
// `localhost`. // `localhost`.
if (req.client.authorized) { if (req.client.authorized) {
res.send(` res.send(`
<html> <html>
<head> <head>
<script src="/fakeResource" type="text/javascript"></script> </head>
</head> <body>
<body> <h1>Authorized</h1>
<p>Hello ${cert.subject.CN}, your certificate was issued by ${cert.issuer.CN}!</p> </body>
</body> </html>
</html> `);
`) // They can still provide a certificate which is not accepted by us. Unfortunately, the `cert` object will be an empty
// They can still provide a certificate which is not accepted by us. Unfortunately, the `cert` object will be an empty // object instead of `null` if there is no certificate at all, so we have to check for a known field rather than
// object instead of `null` if there is no certificate at all, so we have to check for a known field rather than // truthiness.
// truthiness.
} else if (cert.subject) { } else if (cert.subject) {
res.status(403).send(`Sorry ${cert.subject.CN}, certificates from ${cert.issuer.CN} are not welcome here.`) console.log(`Sorry ${cert.subject.CN}, certificates from ${cert.issuer.CN} are not welcome here.`);
// And last, they can come to us with no certificate at all: res.status(403).send(`
<html>
<head>
</head>
<body>
<h1>Forbidden</h1>
</body>
</html>
`);
// And last, they can come to us with no certificate at all:
} else { } else {
res.status(401).send(`Sorry, but you need to provide a client certificate to continue.`) console.log(`Sorry, but you need to provide a client certificate to continue.`)
res.status(401).send(`
<html>
<head>
</head>
<body>
<h1>Unauthorized</h1>
</body>
</html>
`);
} }
res.end() res.end()
}) })
appHttps.get('/fakeResource', (req, res) => {
console.log(JSON.stringify(req.headers))
res.set("Content-Type", "text/javascript")
res.send(`alert("HI");`)
res.end()
})
// Let's create our HTTPS server and we're ready to go. // Let's create our HTTPS server and we're ready to go.
https.createServer(options, appHttps).listen(4433) https.createServer(options, appHttps).listen(4433)
// Ensure this is before any other middleware or routes // Ensure this is before any other middleware or routes
appAuthBasic.use((req, res, next) => { appAuthBasic.use((req, res, next) => {
let user = auth(req) let user = auth(req)
...@@ -98,6 +110,8 @@ appAuthBasic.get("/", (req, res) => { ...@@ -98,6 +110,8 @@ appAuthBasic.get("/", (req, res) => {
appAuthBasic.listen(8081) appAuthBasic.listen(8081)
// Parse URL-encoded bodies (as sent by HTML forms) // Parse URL-encoded bodies (as sent by HTML forms)
app.use(express.urlencoded()); app.use(express.urlencoded());
......
#!/bin/bash
export NODE_SERVER_IP=$1
dart tool/env.dart
cd nodejs_server_test_auth_basic_and_ssl
node index.js &
cd ../example
flutter driver -t test_driver/app.dart
kill $(jobs -p)
\ No newline at end of file
import 'dart:async';
import 'dart:convert';
import 'dart:io';
Future<void> main() async {
final config = {
'NODE_SERVER_IP': Platform.environment['NODE_SERVER_IP'],
};
final filename = 'example/test_driver/.env.dart';
File(filename).writeAsString('final environment = ${json.encode(config)};');
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment