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
**App version:** <!-- Add branch if necessary -->
**Android version:** <!-- If customize ROM, write which -->
**Device information:** <!-- Manufacturer and model -->
**Flutter version:** <!-- Flutter version used -->
## Description
......
......@@ -15,23 +15,50 @@
</component>
<component name="ChangeListManager">
<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_driver/in_app_webview_on_safe_browsing_hit_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_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$/CHANGELOG.md" beforeDir="false" afterPath="$PROJECT_DIR$/CHANGELOG.md" 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$/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$/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$/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$/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/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_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$/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/in_app_browser.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/in_app_browser.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/cookie_manager.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/cookie_manager.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" />
</list>
......@@ -56,8 +83,8 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/types.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-195">
<caret line="344" column="6" selection-start-line="344" selection-start-column="6" selection-end-line="344" selection-end-column="6" />
<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>
<element signature="e#0#20#0" expanded="true" />
</folding>
......@@ -66,19 +93,10 @@
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/test_driver/app_test.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">
<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="284">
<caret line="37" column="94" selection-start-line="37" selection-start-column="94" selection-end-line="37" selection-end-column="94" />
<state relative-caret-position="420">
<caret line="73" column="23" selection-start-line="73" selection-start-column="23" selection-end-line="73" selection-end-column="23" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
......@@ -86,23 +104,23 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/lib/in_app_webiew_example.screen.dart">
<file pinned="false" current-in-tab="true">
<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">
<state relative-caret-position="254">
<caret line="97" column="63" selection-start-line="97" selection-start-column="63" selection-end-line="97" selection-end-column="63" />
<state relative-caret-position="94">
<caret line="29" column="38" selection-start-line="29" selection-start-column="38" selection-end-line="29" selection-end-column="38" />
<folding>
<element signature="e#0#20#0" expanded="true" />
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/example/lib/chrome_safari_browser_example.screen.dart">
<file pinned="false" current-in-tab="false">
<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="432">
<caret line="70" column="48" selection-start-line="70" selection-start-column="48" selection-end-line="70" selection-end-column="48" />
<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>
......@@ -111,43 +129,48 @@
</entry>
</file>
<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">
<state relative-caret-position="152">
<caret line="348" column="14" selection-start-line="348" selection-start-column="7" selection-end-line="348" selection-end-column="14" />
<state relative-caret-position="362">
<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>
</provider>
</entry>
</file>
<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">
<state relative-caret-position="242">
<caret line="61" column="22" selection-start-line="61" selection-start-column="22" selection-end-line="61" selection-end-column="22" />
<state relative-caret-position="459">
<caret line="115" column="25" selection-start-line="115" selection-start-column="16" selection-end-line="115" selection-end-column="25" />
<folding>
<element signature="e#0#17#0" expanded="true" />
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<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">
<state relative-caret-position="225">
<caret line="15" column="36" selection-start-line="15" selection-start-column="16" selection-end-line="15" selection-end-column="36" />
<state>
<folding>
<element signature="e#0#20#0" expanded="true" />
<element signature="e#0#54#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<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">
<state relative-caret-position="423">
<caret line="91" column="22" selection-start-line="91" selection-start-column="12" selection-end-line="91" selection-end-column="22" />
<state relative-caret-position="127">
<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>
</provider>
</entry>
......@@ -158,34 +181,12 @@
<option name="RECENT_TEMPLATES">
<list>
<option value="Class" />
<option value="Dart File" />
</list>
</option>
</component>
<component name="FindInProjectRecents">
<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>onLoadHtt</find>
<find>onLoadError</find>
......@@ -193,6 +194,29 @@
<find>onSafeBrowsingHit</find>
<find>dispose</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>
<replaceStrings>
<replace>activity.getPreferences(0)</replace>
......@@ -210,61 +234,61 @@
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<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_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_driver/in_app_webview_on_target_blank_test.dart" />
<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$/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$/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/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>
</option>
</component>
<component name="ProjectFrameBounds" extendedState="6">
<component name="ProjectFrameBounds">
<option name="y" value="23" />
<option name="width" value="1920" />
<option name="height" value="1057" />
......@@ -275,6 +299,17 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<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">
<subPane>
<expand>
......@@ -320,7 +355,7 @@
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
<item name="flutter_inappbrowser" type="462c0819:PsiDirectoryNode" />
<item name="example" type="462c0819:PsiDirectoryNode" />
<item name="lib" type="462c0819:PsiDirectoryNode" />
<item name="test_assets" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
......@@ -341,18 +376,12 @@
</path>
<path>
<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>
</expand>
<select />
</subPane>
</pane>
<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" />
<item name="flutter_inappbrowser" type="b2602c69:ProjectViewProjectNode" />
<item name="External Libraries" type="cb654da1:ExternalLibrariesNode" />
</path>
</expand>
<select />
......@@ -378,10 +407,6 @@
<property name="show.migrate.to.gradle.popup" value="false" />
</component>
<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">
<recent name="$PROJECT_DIR$/example/test_driver" />
<recent name="$PROJECT_DIR$/example/test_assets" />
......@@ -389,6 +414,10 @@
<recent name="$PROJECT_DIR$/example/assets/images" />
<recent name="$PROJECT_DIR$/android/libs" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/example/assets/images" />
<recent name="$PROJECT_DIR$/android/src/main/java" />
</key>
</component>
<component name="RunDashboard">
<option name="ruleStates">
......@@ -509,7 +538,7 @@
<frame x="0" y="23" width="1920" height="1057" extended-state="6" />
<editor active="true" />
<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="Designer" order="2" />
<window_info id="Build Variants" order="3" side_tool="true" />
......@@ -528,7 +557,7 @@
<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="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="Messages" order="12" sideWeight="0.4968051" weight="0.33782384" />
<window_info anchor="bottom" id="Dependency Viewer" order="13" weight="0.32800853" />
......@@ -548,7 +577,9 @@
</layout>
</component>
<component name="UnknownFeatures">
<option featureType="com.intellij.fileTypeFactory" implementationName="*.sh" />
<option featureType="com.intellij.fileTypeFactory" implementationName="*.css" />
<option featureType="com.intellij.fileTypeFactory" implementationName="*.js" />
</component>
<component name="VcsManagerConfiguration">
<ignored-roots>
......@@ -556,382 +587,439 @@
</ignored-roots>
</component>
<component name="editorHistoryManager">
<entry file="file://$USER_HOME$/flutter/bin/cache/pkg/sky_engine/lib/convert/json.dart" />
<entry file="file://$PROJECT_DIR$/example/lib/test.dart">
<entry file="file://$PROJECT_DIR$/example/test_assets/in_app_webview_on_target_blank_test.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="450">
<caret line="230" column="13" selection-start-line="223" selection-start-column="6" selection-end-line="230" selection-end-column="13" />
<state relative-caret-position="180">
<caret line="12" column="60" selection-end-line="15" selection-end-column="7" />
</state>
</provider>
</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">
<state relative-caret-position="162">
<caret line="15" column="63" selection-start-line="15" selection-start-column="63" selection-end-line="15" selection-end-column="63" />
<state relative-caret-position="270">
<caret line="18" column="7" selection-start-line="18" selection-start-column="7" selection-end-line="18" selection-end-column="7" />
</state>
</provider>
</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">
<state relative-caret-position="256">
<caret line="25" column="1" lean-forward="true" selection-start-line="25" selection-start-column="1" selection-end-line="25" selection-end-column="1" />
<state>
<caret selection-end-line="17" selection-end-column="7" />
</state>
</provider>
</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">
<state relative-caret-position="-182">
<caret line="62" column="8" selection-start-line="62" selection-start-column="8" selection-end-line="62" selection-end-column="8" />
<state>
<caret column="54" lean-forward="true" selection-start-column="54" selection-end-column="54" />
</state>
</provider>
</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">
<state relative-caret-position="125">
<caret line="779" column="15" selection-start-line="779" selection-start-column="15" selection-end-line="779" selection-end-column="15" />
<state relative-caret-position="90">
<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>
</provider>
</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">
<state relative-caret-position="-382">
<caret line="253" column="2" selection-start-line="253" selection-start-column="2" selection-end-line="253" selection-end-column="2" />
<state relative-caret-position="385">
<caret line="26" column="69" selection-start-line="26" selection-start-column="42" selection-end-line="26" selection-end-column="69" />
</state>
</provider>
</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">
<state relative-caret-position="495">
<caret line="38" column="18" selection-start-line="38" selection-start-column="18" selection-end-line="38" selection-end-column="18" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
<state relative-caret-position="315">
<caret line="21" column="24" lean-forward="true" selection-start-line="13" selection-start-column="16" selection-end-line="21" selection-end-column="24" />
</state>
</provider>
</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">
<state relative-caret-position="435">
<caret line="29" column="24" selection-start-line="29" selection-start-column="20" selection-end-line="29" selection-end-column="24" />
<state relative-caret-position="380">
<caret line="58" column="55" selection-start-line="58" selection-start-column="55" selection-end-line="58" selection-end-column="55" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/lib/inline_example.screen.dart" />
<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">
<entry file="file://$PROJECT_DIR$/test.sh">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="168">
<caret line="95" column="8" lean-forward="true" selection-start-line="95" selection-start-column="8" selection-end-line="97" selection-end-column="10" />
<state relative-caret-position="90">
<caret line="6" selection-start-line="6" selection-end-line="6" selection-end-column="38" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/../cartella senza titolo/flutter_inappbrowser/pubspec.yaml" />
<entry file="file://$PROJECT_DIR$/../cartella senza titolo/flutter_inappbrowser/CHANGELOG.md" />
<entry file="file://$PROJECT_DIR$/ios/Classes/FlutterWebViewController.swift">
<entry file="file://$USER_HOME$/flutter/packages/flutter/lib/src/widgets/framework.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="343">
<caret line="28" column="8" selection-start-line="28" selection-start-column="8" selection-end-line="28" selection-end-column="8" />
<state relative-caret-position="-654">
<caret line="936" column="15" selection-start-line="936" selection-start-column="15" selection-end-line="936" selection-end-column="15" />
</state>
</provider>
</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">
<state relative-caret-position="517">
<caret line="650" column="3" selection-start-line="650" selection-start-column="3" selection-end-line="650" selection-end-column="3" />
<state relative-caret-position="2025">
<caret line="135" column="1" selection-start-line="135" selection-start-column="1" selection-end-line="135" selection-end-column="1" />
<folding>
<element signature="e#0#39#0" expanded="true" />
<element signature="e#0#39#0" expanded="true" />
<element signature="e#0#41#0" expanded="true" />
</folding>
</state>
</provider>
</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">
<state relative-caret-position="285">
<caret line="19" selection-start-line="19" selection-end-line="19" />
<state relative-caret-position="633">
<caret line="71" column="19" selection-start-line="71" selection-start-column="19" selection-end-line="71" selection-end-column="19" />
</state>
</provider>
</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">
<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>
<element signature="e#845#869#0" expanded="true" />
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</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">
<state relative-caret-position="255">
<caret line="17" column="15" lean-forward="true" selection-start-line="11" selection-start-column="12" selection-end-line="17" selection-end-column="15" />
<state relative-caret-position="177">
<caret line="637" column="15" selection-start-line="637" selection-start-column="15" selection-end-line="637" selection-end-column="15" />
</state>
</provider>
</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">
<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>
<element signature="e#0#39#0" expanded="true" />
<element signature="e#0#17#0" expanded="true" />
</folding>
</state>
</provider>
</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">
<state relative-caret-position="184">
<caret line="42" column="22" selection-start-line="42" selection-start-column="22" selection-end-line="42" selection-end-column="22" />
<state relative-caret-position="180">
<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#39#0" expanded="true" />
</folding>
</state>
</provider>
</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">
<state relative-caret-position="390">
<caret line="26" column="38" lean-forward="true" selection-start-line="26" selection-start-column="38" selection-end-line="27" selection-end-column="85" />
<state relative-caret-position="202">
<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>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</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">
<state relative-caret-position="397">
<caret line="31" column="27" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="27" />
<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>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</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">
<state relative-caret-position="303">
<caret line="48" column="23" selection-start-line="43" selection-start-column="22" selection-end-line="48" selection-end-column="23" />
<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>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</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">
<state relative-caret-position="255">
<caret line="43" lean-forward="true" selection-start-line="43" selection-end-line="43" />
<state relative-caret-position="375">
<caret line="25" column="30" selection-start-line="25" selection-start-column="30" selection-end-line="25" selection-end-column="30" />
<folding>
<element signature="e#0#39#0" expanded="true" />
<element signature="e#0#22#0" expanded="true" />
</folding>
</state>
</provider>
</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">
<state relative-caret-position="193">
<caret line="50" column="25" selection-start-line="50" selection-start-column="25" selection-end-line="50" selection-end-column="25" />
<state relative-caret-position="300">
<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>
</provider>
</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">
<state relative-caret-position="270">
<caret line="18" column="7" selection-start-line="18" selection-start-column="7" selection-end-line="18" selection-end-column="7" />
<state relative-caret-position="300">
<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>
</provider>
</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">
<state relative-caret-position="104">
<caret line="15" column="63" selection-start-line="15" selection-start-column="63" selection-end-line="15" selection-end-column="63" />
<state relative-caret-position="502">
<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>
</provider>
</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">
<state relative-caret-position="15">
<caret line="33" column="31" lean-forward="true" selection-end-line="146" selection-end-column="7" />
<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>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</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">
<state relative-caret-position="180">
<caret line="12" column="60" selection-end-line="15" selection-end-column="7" />
<state relative-caret-position="420">
<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>
</provider>
</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">
<state relative-caret-position="690">
<caret line="46" column="24" selection-start-line="46" selection-start-column="24" selection-end-line="46" selection-end-column="24" />
<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>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</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">
<state relative-caret-position="345">
<caret line="44" column="22" selection-start-line="44" selection-start-column="22" selection-end-line="49" selection-end-column="23" />
<state relative-caret-position="390">
<caret line="26" column="30" selection-start-line="26" selection-start-column="30" selection-end-line="26" selection-end-column="30" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</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">
<state relative-caret-position="225">
<caret line="71" column="19" selection-start-line="71" selection-start-column="9" selection-end-line="71" selection-end-column="19" />
<state relative-caret-position="300">
<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>
</provider>
</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">
<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>
<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_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">
<state relative-caret-position="147">
<caret line="16" column="2" selection-start-line="16" selection-start-column="2" selection-end-line="16" selection-end-column="2" />
<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>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</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">
<state relative-caret-position="400">
<caret line="58" column="22" selection-start-line="58" selection-start-column="22" selection-end-line="67" selection-end-column="25" />
<state relative-caret-position="345">
<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>
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</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">
<state relative-caret-position="214">
<caret line="15" column="47" lean-forward="true" selection-start-line="15" selection-start-column="47" selection-end-line="15" selection-end-column="47" />
<state relative-caret-position="300">
<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>
</provider>
</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">
<state relative-caret-position="422">
<caret line="56" column="5" selection-start-line="56" selection-start-column="5" selection-end-line="56" selection-end-column="56" />
<state relative-caret-position="300">
<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#17#0" expanded="true" />
<element signature="e#0#39#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/test_driver/main_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="284">
<caret line="37" column="94" selection-start-line="37" selection-start-column="94" selection-end-line="37" selection-end-column="94" />
<state relative-caret-position="459">
<caret line="115" column="25" selection-start-line="115" selection-start-column="16" selection-end-line="115" selection-end-column="25" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</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">
<state relative-caret-position="-6">
<caret line="207" selection-start-line="207" selection-end-line="207" />
<state>
<folding>
<element signature="e#0#54#0" expanded="true" />
</folding>
</state>
</provider>
</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">
<state relative-caret-position="423">
<caret line="91" column="22" selection-start-line="91" selection-start-column="12" selection-end-line="91" selection-end-column="22" />
<state relative-caret-position="180">
<caret line="12" lean-forward="true" selection-start-line="12" selection-end-line="12" />
</state>
</provider>
</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">
<state relative-caret-position="282">
<caret line="45" column="48" selection-start-line="45" selection-start-column="48" selection-end-line="45" selection-end-column="48" />
<state relative-caret-position="156">
<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>
</provider>
</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">
<state relative-caret-position="-2">
<caret line="294" column="31" selection-start-line="294" selection-start-column="31" selection-end-line="294" selection-end-column="31" />
<state relative-caret-position="360">
<caret line="24" column="3" selection-start-line="24" selection-start-column="3" selection-end-line="24" selection-end-column="3" />
<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$/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">
<state relative-caret-position="-195">
<caret line="344" column="6" selection-start-line="344" selection-start-column="6" selection-end-line="344" selection-end-column="6" />
<state relative-caret-position="275">
<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>
<element signature="e#0#20#0" expanded="true" />
<element signature="e#0#17#0" expanded="true" />
</folding>
</state>
</provider>
</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">
<state relative-caret-position="152">
<caret line="348" column="14" selection-start-line="348" selection-start-column="7" selection-end-line="348" selection-end-column="14" />
<state relative-caret-position="1414">
<caret line="100" column="12" selection-start-line="100" selection-start-column="12" selection-end-line="100" selection-end-column="12" />
</state>
</provider>
</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">
<state relative-caret-position="242">
<caret line="61" column="22" selection-start-line="61" selection-start-column="22" selection-end-line="61" selection-end-column="22" />
<state relative-caret-position="127">
<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#0#17#0" expanded="true" />
<element signature="e#35#55#0" expanded="true" />
</folding>
</state>
</provider>
</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">
<state relative-caret-position="225">
<caret line="15" column="36" selection-start-line="15" selection-start-column="16" selection-end-line="15" selection-end-column="36" />
<state relative-caret-position="420">
<caret line="73" column="23" selection-start-line="73" selection-start-column="23" selection-end-line="73" selection-end-column="23" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</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">
<state relative-caret-position="267">
<caret line="147" column="48" selection-start-line="147" selection-start-column="48" selection-end-line="147" selection-end-column="48" />
<state relative-caret-position="455">
<caret line="63" column="84" selection-start-line="63" selection-start-column="84" selection-end-line="63" selection-end-column="84" />
<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/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">
<state relative-caret-position="254">
<caret line="97" column="63" selection-start-line="97" selection-start-column="63" selection-end-line="97" selection-end-column="63" />
<state relative-caret-position="362">
<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#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>
</state>
</provider>
</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">
<state relative-caret-position="432">
<caret line="70" column="48" selection-start-line="70" selection-start-column="48" selection-end-line="70" selection-end-column="48" />
<state relative-caret-position="94">
<caret line="29" column="38" selection-start-line="29" selection-start-column="38" selection-end-line="29" selection-end-column="38" />
<folding>
<element signature="e#0#39#0" expanded="true" />
</folding>
......
......@@ -66,6 +66,9 @@ public class ContentBlockerHandler {
for (ContentBlocker contentBlocker : ruleListCopy) {
ContentBlockerTrigger trigger = contentBlocker.trigger;
List<ContentBlockerTriggerResourceType> resourceTypes = trigger.resourceType;
if (resourceTypes.contains(ContentBlockerTriggerResourceType.IMAGE) && !resourceTypes.contains(ContentBlockerTriggerResourceType.SVG_DOCUMENT)) {
resourceTypes.add(ContentBlockerTriggerResourceType.SVG_DOCUMENT);
}
ContentBlockerAction action = contentBlocker.action;
......@@ -173,6 +176,7 @@ public class ContentBlockerHandler {
? contentTypeSplitted[1].replace("charset=", "").trim()
: "utf-8";
response.body().close();
response.close();
return new WebResourceResponse(contentType, encoding, dataStream);
......@@ -180,6 +184,7 @@ public class ContentBlockerHandler {
} catch (Exception e) {
e.printStackTrace();
if (response != null) {
response.body().close();
response.close();
}
Log.e(LOG_TAG, e.getMessage());
......@@ -220,12 +225,14 @@ public class ContentBlockerHandler {
? contentTypeSplitted[1].replace("charset=", "").trim()
: "utf-8";
response.body().close();
response.close();
responseResourceType = getResourceTypeFromContentType(contentType);
}
} catch (Exception e) {
if (response != null) {
response.body().close();
response.close();
}
e.printStackTrace();
......
......@@ -2,7 +2,7 @@
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/lorenzopichilli/flutter"
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 "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "FLUTTER_FRAMEWORK_DIR=/Users/lorenzopichilli/flutter/bin/cache/artifacts/engine/ios"
......
......@@ -31,6 +31,7 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
InAppWebViewController webView;
String url = "";
double progress = 0;
CookieManager cookieManager = CookieManager.instance();
TextEditingController _textFieldController = TextEditingController();
......@@ -124,7 +125,8 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
//initialUrl: "chrome://safe-browsing/match?type=malware",
//initialUrl: "http://192.168.1.20:8081/",
//initialUrl: "https://192.168.1.20:4433/",
initialFile: "assets/index.html",
//initialFile: "assets/index.html",
initialUrl: "https://flutter.dev/",
initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
......@@ -134,7 +136,7 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
clearCache: true,
//useShouldOverrideUrlLoading: true,
useOnTargetBlank: true,
//useOnLoadResource: true,
useOnLoadResource: true,
//useOnDownloadStart: true,
//useShouldInterceptAjaxRequest: true,
//useShouldInterceptFetchRequest: true,
......@@ -151,7 +153,7 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
ContentBlockerTriggerResourceType.STYLE_SHEET
],
ifTopUrl: [
"https://getbootstrap.com/"
"https://flutter.dev/"
]),
action: ContentBlockerAction(
type: ContentBlockerActionType.BLOCK))
......@@ -195,11 +197,13 @@ class _InAppWebViewExampleScreenState extends State<InAppWebViewExampleScreen> {
},
onLoadStop: (InAppWebViewController controller, String url) async {
print("stopped $url");
if (Platform.isAndroid) {
controller.clearSslPreferences();
controller.clearClientCertPreferences();
}
//controller.findAllAsync("flutter");
//controller.findAllAsync(find: "InAppWebView");
//controller.findAllAsync(find: "InAppWebViewInitialFileTest");
print(await controller.getFavicons());
print(await CookieManager.instance().getCookies(url: url));
//await CookieManager.instance().setCookie(url: url, name: "myCookie", value: "myValue");
......
......@@ -53,11 +53,8 @@ flutter:
- test_assets/in_app_webview_initial_file_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_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_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_js_dialog_test.html
- 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 @@
<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>
<title>InAppWebViewOnNavigationStateChangeTest</title>
<base href="index.html">
</head>
<body>
<h1>InAppWebViewOnDownloadStartTest</h1>
<a id="download-file" href="http://192.168.1.20:8082/test-download-file">download file</a>
<h1>InAppWebViewOnNavigationStateChangeTest</h1>
<script>
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>
</body>
......
final environment = {"NODE_SERVER_IP":"192.168.1.20"};
\ No newline at end of file
import 'package:flutter_driver/driver_extension.dart';
import 'app_test.dart';
import 'main_test.dart' as app;
void main() {
......
// Imports the Flutter Driver API.
import 'dart:async';
import 'dart:io';
import 'package:flutter_driver/flutter_driver.dart';
import 'package:test/test.dart';
import '.env.dart';
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 {
await Future.delayed(const Duration(milliseconds: 2000));
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") {
await Future.delayed(const Duration(milliseconds: 1000));
await Future.delayed(const Duration(milliseconds: 500));
}
String url = await driver.getText(appBarTitle);
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)));
test('InAppWebViewInitialFileTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
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") {
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);
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('InAppWebViewOnLoadResourceTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
List<String> resourceList = [
"https://getbootstrap.com/docs/4.3/dist/css/bootstrap.min.css",
"https://code.jquery.com/jquery-3.3.1.min.js",
......@@ -61,114 +126,177 @@ void main() {
];
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") {
await Future.delayed(const Duration(milliseconds: 1000));
await Future.delayed(const Duration(milliseconds: 500));
}
String title = await driver.getText(appBarTitle);
for (String resource in resourceList) {
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)));
test('InAppWebViewJavaScriptHandlerTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
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") {
await Future.delayed(const Duration(milliseconds: 1000));
await Future.delayed(const Duration(milliseconds: 500));
}
String title = await driver.getText(appBarTitle);
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)));
test('InAppWebViewAjaxTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
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") {
await Future.delayed(const Duration(milliseconds: 1000));
await Future.delayed(const Duration(milliseconds: 500));
}
String title = await driver.getText(appBarTitle);
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)));
test('InAppWebViewOnLoadResourceCustomSchemeTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
test('InAppWebViewFetchTest', () async {
final appBarTitle = find.byValueKey('AppBarTitle');
while((await driver.getText(appBarTitle)) == "InAppWebViewOnLoadResourceCustomSchemeTest") {
await Future.delayed(const Duration(milliseconds: 1000));
final sideMenuButton = find.byValueKey('SideMenu');
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);
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)));
test('InAppWebViewFetchTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
test('InAppWebViewOnLoadResourceCustomSchemeTest', () async {
final appBarTitle = find.byValueKey('AppBarTitle');
while((await driver.getText(appBarTitle)) == "InAppWebViewFetchTest") {
await Future.delayed(const Duration(milliseconds: 1000));
final sideMenuButton = find.byValueKey('SideMenu');
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);
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)));
test('InAppWebViewShouldOverrideUrlLoadingTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
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") {
await Future.delayed(const Duration(milliseconds: 1000));
await Future.delayed(const Duration(milliseconds: 500));
}
String url = await driver.getText(appBarTitle);
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)));
test('InAppWebViewOnConsoleMessageTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
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") {
await Future.delayed(const Duration(milliseconds: 1000));
await Future.delayed(const Duration(milliseconds: 500));
}
String title = await driver.getText(appBarTitle);
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)));
test('InAppWebViewOnDownloadStartTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
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") {
await Future.delayed(const Duration(milliseconds: 1000));
await Future.delayed(const Duration(milliseconds: 500));
}
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)));
test('InAppWebViewOnTargetBlankTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
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") {
await Future.delayed(const Duration(milliseconds: 1000));
await Future.delayed(const Duration(milliseconds: 500));
}
String url = await driver.getText(appBarTitle);
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)));
test('InAppWebViewOnJsDialogTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
final appBarTitle = find.byValueKey('AppBarTitle');
final alertButtonOk = find.byValueKey('AlertButtonOk');
final confirmButtonCancel = find.byValueKey('ConfirmButtonCancel');
......@@ -177,8 +305,12 @@ void main() {
final promptButtonCancel = find.byValueKey('PromptButtonCancel');
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") {
await Future.delayed(const Duration(milliseconds: 1000));
await Future.delayed(const Duration(milliseconds: 500));
}
await driver.tap(alertButtonOk);
......@@ -204,30 +336,196 @@ void main() {
title = await driver.getText(appBarTitle);
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)));
test('InAppWebViewOnSafeBrowsingHitTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
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") {
await Future.delayed(const Duration(milliseconds: 1000));
await Future.delayed(const Duration(milliseconds: 500));
}
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)));
test('InAppWebViewOnReceivedHttpAuthRequestTest', () async {
await Future.delayed(const Duration(milliseconds: 2000));
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") {
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);
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)));
});
......
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
......@@ -14,6 +15,7 @@ class WidgetTest extends StatefulWidget {
}
class WidgetTestState extends State<WidgetTest> {
final GlobalKey<ScaffoldState> scaffoldKey = new GlobalKey<ScaffoldState>();
InAppWebViewController webView;
String appBarTitle;
......
......@@ -3,8 +3,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart';
import 'util_test.dart';
import 'custom_widget_test.dart';
import '.env.dart';
class InAppWebViewAjaxTest extends WidgetTest {
final InAppWebViewAjaxTestState state = InAppWebViewAjaxTestState();
......@@ -21,13 +21,40 @@ class InAppWebViewAjaxTestState extends WidgetTestState {
@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_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: {},
initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
......@@ -80,7 +107,6 @@ class InAppWebViewAjaxTestState extends WidgetTestState {
testsDone++;
if (testsDone == totTests) {
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';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart';
import 'util_test.dart';
import 'custom_widget_test.dart';
import '.env.dart';
class InAppWebViewFetchTest extends WidgetTest {
final InAppWebViewFetchTestState state = InAppWebViewFetchTestState();
......@@ -23,13 +23,56 @@ class InAppWebViewFetchTestState extends WidgetTestState {
@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_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: {},
initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
......@@ -79,7 +122,6 @@ class InAppWebViewFetchTestState extends WidgetTestState {
testsDone++;
if (testsDone == totTests) {
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';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart';
import 'util_test.dart';
import 'custom_widget_test.dart';
class InAppWebViewInitialFileTest extends WidgetTest {
......@@ -19,7 +18,9 @@ class InAppWebViewInitialFileTestState extends WidgetTestState {
@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(
......@@ -43,7 +44,6 @@ class InAppWebViewInitialFileTestState extends WidgetTestState {
setState(() {
appBarTitle = "true";
});
nextTest(context: context, state: this);
},
),
),
......
......@@ -4,7 +4,6 @@ import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'custom_widget_test.dart';
import 'main_test.dart';
import 'util_test.dart';
class InAppWebViewInitialUrlTest extends WidgetTest {
final InAppWebViewInitialUrlTestState state = InAppWebViewInitialUrlTestState();
......@@ -20,7 +19,9 @@ class InAppWebViewInitialUrlTestState extends WidgetTestState {
@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(
......@@ -44,7 +45,6 @@ class InAppWebViewInitialUrlTestState extends WidgetTestState {
setState(() {
appBarTitle = url;
});
nextTest(context: context, state: this);
},
),
),
......
......@@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart';
import 'util_test.dart';
import 'custom_widget_test.dart';
class Foo {
......@@ -34,7 +33,9 @@ class InAppWebViewJavaScriptHandlerTestState extends WidgetTestState {
@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(
......@@ -64,7 +65,6 @@ class InAppWebViewJavaScriptHandlerTestState extends WidgetTestState {
appBarTitle += " " + (args[3] is Map).toString();
appBarTitle += " " + (args[4] is Map).toString();
setState(() { });
nextTest(context: context, state: this);
});
},
......
......@@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart';
import 'util_test.dart';
import 'custom_widget_test.dart';
class InAppWebViewOnConsoleMessageTest extends WidgetTest {
......@@ -19,7 +18,9 @@ class InAppWebViewOnConsoleMessageTestState extends WidgetTestState {
@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(
......@@ -46,7 +47,6 @@ class InAppWebViewOnConsoleMessageTestState extends WidgetTestState {
setState(() {
appBarTitle = consoleMessage.message + " " + consoleMessage.messageLevel.toString();
});
nextTest(context: context, state: this);
},
),
),
......
......@@ -3,8 +3,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart';
import 'util_test.dart';
import 'custom_widget_test.dart';
import '.env.dart';
class InAppWebViewOnDownloadStartTest extends WidgetTest {
final InAppWebViewOnDownloadStartTestState state = InAppWebViewOnDownloadStartTestState();
......@@ -19,13 +19,34 @@ class InAppWebViewOnDownloadStartTestState extends WidgetTestState {
@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_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: {},
initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
......@@ -47,7 +68,6 @@ class InAppWebViewOnDownloadStartTestState extends WidgetTestState {
setState(() {
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';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart';
import 'util_test.dart';
import 'custom_widget_test.dart';
class InAppWebViewOnJsDialogTest extends WidgetTest {
......@@ -27,7 +26,9 @@ class InAppWebViewOnJsDialogTestState extends WidgetTestState {
@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(
......@@ -54,7 +55,6 @@ class InAppWebViewOnJsDialogTestState extends WidgetTestState {
setState(() {
appBarTitle = "prompt " + args[0];
});
nextTest(context: context, state: this);
});
},
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';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart';
import 'util_test.dart';
import 'custom_widget_test.dart';
class InAppWebViewOnLoadResourceCustomSchemeTest extends WidgetTest {
......@@ -20,7 +19,9 @@ class InAppWebViewOnLoadResourceCustomSchemeTestState extends WidgetTestState {
@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(
......@@ -42,7 +43,6 @@ class InAppWebViewOnLoadResourceCustomSchemeTestState extends WidgetTestState {
setState(() {
appBarTitle = "true";
});
nextTest(context: context, state: this);
});
},
onLoadStart: (InAppWebViewController controller, String url) {
......
......@@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart';
import 'util_test.dart';
import 'custom_widget_test.dart';
class InAppWebViewOnLoadResourceTest extends WidgetTest {
......@@ -25,7 +24,9 @@ class InAppWebViewOnLoadResourceTestState extends WidgetTestState {
@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(
......@@ -54,7 +55,6 @@ class InAppWebViewOnLoadResourceTestState extends WidgetTestState {
countResources++;
if (countResources == resourceList.length) {
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';
import 'custom_widget_test.dart';
import 'main_test.dart';
import 'util_test.dart';
import '.env.dart';
class InAppWebViewOnReceivedHttpAuthRequestTest extends WidgetTest {
final InAppWebViewOnReceivedHttpAuthRequestTestState state = InAppWebViewOnReceivedHttpAuthRequestTestState();
......@@ -20,13 +20,15 @@ class InAppWebViewOnReceivedHttpAuthRequestTestState extends WidgetTestState {
@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://192.168.1.20:8081/",
initialUrl: "http://${environment["NODE_SERVER_IP"]}:8081/",
initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
......@@ -45,7 +47,6 @@ class InAppWebViewOnReceivedHttpAuthRequestTestState extends WidgetTestState {
setState(() {
appBarTitle = h1Content;
});
nextTest(context: context, state: this);
},
onReceivedHttpAuthRequest: (InAppWebViewController controller, HttpAuthChallenge challenge) async {
return new HttpAuthResponse(
......
......@@ -6,7 +6,6 @@ import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'custom_widget_test.dart';
import 'main_test.dart';
import 'util_test.dart';
class InAppWebViewOnSafeBrowsingHitTest extends WidgetTest {
final InAppWebViewOnSafeBrowsingHitTestState state = InAppWebViewOnSafeBrowsingHitTestState();
......@@ -22,13 +21,15 @@ class InAppWebViewOnSafeBrowsingHitTestState extends WidgetTestState {
@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: "chrome://safe-browsing/match?type=malware",
initialUrl: (Platform.isAndroid) ? "chrome://safe-browsing/match?type=malware" : "https://flutter.dev/",
initialHeaders: {},
initialOptions: InAppWebViewWidgetOptions(
inAppWebViewOptions: InAppWebViewOptions(
......@@ -38,8 +39,6 @@ class InAppWebViewOnSafeBrowsingHitTestState extends WidgetTestState {
debuggingEnabled: true
),
androidInAppWebViewOptions: AndroidInAppWebViewOptions(
databaseEnabled: true,
domStorageEnabled: true,
safeBrowsingEnabled: true,
),
),
......@@ -55,7 +54,6 @@ class InAppWebViewOnSafeBrowsingHitTestState extends WidgetTestState {
setState(() {
appBarTitle = url;
});
nextTest(context: context, state: this);
},
onSafeBrowsingHit: (InAppWebViewController controller, String url, SafeBrowsingThreat threatType) async {
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';
import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'main_test.dart';
import 'util_test.dart';
import 'custom_widget_test.dart';
class InAppWebViewOnTargetBlankTest extends WidgetTest {
......@@ -19,7 +18,9 @@ class InAppWebViewOnTargetBlankTestState extends WidgetTestState {
@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(
......@@ -46,7 +47,6 @@ class InAppWebViewOnTargetBlankTestState extends WidgetTestState {
setState(() {
appBarTitle = url;
});
nextTest(context: context, state: this);
}
},
onTargetBlank: (InAppWebViewController controller, String url) {
......
......@@ -4,7 +4,6 @@ import 'package:flutter_inappbrowser/flutter_inappbrowser.dart';
import 'custom_widget_test.dart';
import 'main_test.dart';
import 'util_test.dart';
class InAppWebViewShouldOverrideUrlLoadingTest extends WidgetTest {
final InAppWebViewShouldOverrideUrlLoadingTestState state = InAppWebViewShouldOverrideUrlLoadingTestState();
......@@ -19,7 +18,9 @@ class InAppWebViewShouldOverrideUrlLoadingTestState extends WidgetTestState {
@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(
......@@ -45,7 +46,6 @@ class InAppWebViewShouldOverrideUrlLoadingTestState extends WidgetTestState {
setState(() {
appBarTitle = url;
});
nextTest(context: context, state: this);
} else {
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';
import 'custom_widget_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_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_url_test.dart';
import 'in_app_webview_javascript_handler_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_find_result_received_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_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_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_should_override_url_loading_test.dart';
import 'in_app_webview_ssl_request_test.dart';
List<String> testRoutes = [];
Map<String, WidgetBuilder> buildRoutes({@required BuildContext context}) {
Map<String, WidgetBuilder> getTestRoutes({@required BuildContext context}) {
var routes = {
'/': (context) => InAppWebViewInitialUrlTest(),
'/InAppWebViewInitialFileTest': (context) => InAppWebViewInitialFileTest(),
'/InAppWebViewInitialDataTest': (context) => InAppWebViewInitialDataTest(),
'/InAppWebViewOnProgressChangedTest': (context) => InAppWebViewOnProgressChangedTest(),
'/InAppWebViewOnScrollChangedTest': (context) => InAppWebViewOnScrollChangedTest(),
'/InAppWebViewOnLoadResourceTest': (context) => InAppWebViewOnLoadResourceTest(),
'/InAppWebViewJavaScriptHandlerTest': (context) => InAppWebViewJavaScriptHandlerTest(),
'/InAppWebViewAjaxTest': (context) => InAppWebViewAjaxTest(),
'/InAppWebViewOnLoadResourceCustomSchemeTest': (context) => InAppWebViewOnLoadResourceCustomSchemeTest(),
'/InAppWebViewFetchTest': (context) => InAppWebViewFetchTest(),
'/InAppWebViewFetchTest': (context) => InAppWebViewFetchTest(),
'/InAppWebViewOnLoadResourceCustomSchemeTest': (context) => InAppWebViewOnLoadResourceCustomSchemeTest(),
'/InAppWebViewShouldOverrideUrlLoadingTest': (context) => InAppWebViewShouldOverrideUrlLoadingTest(),
'/InAppWebViewOnConsoleMessageTest': (context) => InAppWebViewOnConsoleMessageTest(),
'/InAppWebViewOnDownloadStartTest': (context) => InAppWebViewOnDownloadStartTest(),
......@@ -36,18 +48,33 @@ Map<String, WidgetBuilder> buildRoutes({@required BuildContext context}) {
'/InAppWebViewOnJsDialogTest': (context) => InAppWebViewOnJsDialogTest(),
'/InAppWebViewOnSafeBrowsingHitTest': (context) => InAppWebViewOnSafeBrowsingHitTest(),
'/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;
}
AppBar myAppBar({@required WidgetTestState state, @required String title}) {
return AppBar(
title: Text(
title,
key: Key("AppBarTitle")
),
actions: <Widget>[
IconButton(
icon: Icon(Icons.menu),
key: Key("SideMenu"),
onPressed: () {
state.scaffoldKey.currentState.openDrawer();
},
),
IconButton(
icon: Icon(Icons.refresh),
onPressed: () {
......@@ -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 {
runApp(new MyApp());
}
......@@ -85,7 +146,7 @@ class _MyAppState extends State<MyApp> {
return MaterialApp(
title: 'flutter_inappbrowser tests',
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 'types.dart';
///ContentBlocker class represents a set of rules to use block content in the browser window.
///
......@@ -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.
///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.
......@@ -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.
///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.
......
......@@ -3,6 +3,8 @@ import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'types.dart';
///Manages the cookies used by WebView instances.
///
///**NOTE for iOS**: available from iOS 11.0+.
......@@ -56,22 +58,22 @@ class CookieManager {
}
///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);
Map<String, dynamic> args = <String, dynamic>{};
args.putIfAbsent('url', () => url);
List<dynamic> cookies = await _channel.invokeMethod('getCookies', args);
cookies = cookies.cast<Map<dynamic, dynamic>>();
for(var i = 0; i < cookies.length; i++) {
cookies[i] = cookies[i].cast<String, dynamic>();
List<dynamic> cookieListMap = await _channel.invokeMethod('getCookies', args);
cookieListMap = cookieListMap.cast<Map<dynamic, dynamic>>();
List<Cookie> cookies = [];
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;
}
///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(name != null && name.isNotEmpty);
......@@ -82,7 +84,7 @@ class CookieManager {
for(var i = 0; i < cookies.length; i++) {
cookies[i] = cookies[i].cast<String, dynamic>();
if (cookies[i]["name"] == name)
return cookies[i];
return Cookie(name: cookies[i]["name"], value: cookies[i]["value"]);
}
return null;
}
......
......@@ -1499,4 +1499,91 @@ class FetchRequest {
}
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) => {
console.log(JSON.stringify(req.headers))
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
// earlier in `opts.ca`. We display the name of our user (CN = Common Name) and the name of the issuer, which is
// `localhost`.
// 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
// `localhost`.
if (req.client.authorized) {
res.send(`
<html>
<head>
<script src="/fakeResource" type="text/javascript"></script>
</head>
<body>
<p>Hello ${cert.subject.CN}, your certificate was issued by ${cert.issuer.CN}!</p>
</body>
</html>
`)
// 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
// truthiness.
<html>
<head>
</head>
<body>
<h1>Authorized</h1>
</body>
</html>
`);
// 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
// truthiness.
} else if (cert.subject) {
res.status(403).send(`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:
console.log(`Sorry ${cert.subject.CN}, certificates from ${cert.issuer.CN} are not welcome here.`);
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 {
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()
})
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.
https.createServer(options, appHttps).listen(4433)
// Ensure this is before any other middleware or routes
appAuthBasic.use((req, res, next) => {
let user = auth(req)
......@@ -98,6 +110,8 @@ appAuthBasic.get("/", (req, res) => {
appAuthBasic.listen(8081)
// Parse URL-encoded bodies (as sent by HTML forms)
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