From ef012acfe1ab1dc311bd1677262ffffe361f8163 Mon Sep 17 00:00:00 2001 From: Hao Li Date: Wed, 27 Jul 2016 14:11:09 +0800 Subject: [PATCH] [usecase-embeddingapi] Add tests for setJavaScript related APIs (#3731) Impacted tests(approved): new 4, update 0, delete 0 Unit test platform: Crosswalk for Android 21.51.546.0 Unit test result summary: pass 4, fail 0, block 0 BUG=https://crosswalk-project.org/jira/browse/CTS-1818 --- .../embeddingapi-async/AndroidManifest.xml | 18 ++++ .../assets/javascript_enabled.html | 8 ++ .../assets/window_open_automatically.html | 12 +++ .../window_open_automatically_enabled.html | 5 + ..._view_setting_dom_storage_enable_async.xml | 2 +- ..._view_setting_javascript_enabled_async.xml | 36 +++++++ ...cript_open_windows_automatically_async.xml | 36 +++++++ .../embeddingapi-async/res/values/strings.xml | 2 + .../xwalk/embedded/api/asyncsample/README.md | 20 ++++ ...WalkViewSettingDomStorageEnabledAsync.java | 2 +- ...criptCanOpenWindowsAutomaticallyAsync.java | 95 +++++++++++++++++++ ...WalkViewSettingJavaScriptEnabledAsync.java | 95 +++++++++++++++++++ .../embeddingapi/AndroidManifest.xml | 18 ++++ .../assets/javascript_enabled.html | 8 ++ .../assets/window_open_automatically.html | 12 +++ .../window_open_automatically_enabled.html | 5 + ..._xwalk_view_setting_dom_storage_enable.xml | 2 +- ..._xwalk_view_setting_javascript_enabled.xml | 36 +++++++ ..._javascript_open_windows_automatically.xml | 36 +++++++ .../embeddingapi/res/values/strings.xml | 2 + .../org/xwalk/embedded/api/sample/README.md | 20 ++++ ...JavaScriptCanOpenWindowsAutomatically.java | 73 ++++++++++++++ .../XWalkViewSettingJavaScriptEnabled.java | 73 ++++++++++++++ .../tests.android.xml | 8 ++ .../tests.full.xml | 8 ++ 25 files changed, 629 insertions(+), 3 deletions(-) create mode 100644 usecase/usecase-embedding-android-tests/embeddingapi-async/assets/javascript_enabled.html create mode 100644 usecase/usecase-embedding-android-tests/embeddingapi-async/assets/window_open_automatically.html create mode 100644 usecase/usecase-embedding-android-tests/embeddingapi-async/assets/window_open_automatically_enabled.html create mode 100644 usecase/usecase-embedding-android-tests/embeddingapi-async/res/layout/activity_xwalk_view_setting_javascript_enabled_async.xml create mode 100644 usecase/usecase-embedding-android-tests/embeddingapi-async/res/layout/activity_xwalk_view_setting_javascript_open_windows_automatically_async.xml create mode 100644 usecase/usecase-embedding-android-tests/embeddingapi-async/src/org/xwalk/embedded/api/asyncsample/setting/XWalkViewSettingJavaScriptCanOpenWindowsAutomaticallyAsync.java create mode 100644 usecase/usecase-embedding-android-tests/embeddingapi-async/src/org/xwalk/embedded/api/asyncsample/setting/XWalkViewSettingJavaScriptEnabledAsync.java create mode 100644 usecase/usecase-embedding-android-tests/embeddingapi/assets/javascript_enabled.html create mode 100644 usecase/usecase-embedding-android-tests/embeddingapi/assets/window_open_automatically.html create mode 100644 usecase/usecase-embedding-android-tests/embeddingapi/assets/window_open_automatically_enabled.html create mode 100644 usecase/usecase-embedding-android-tests/embeddingapi/res/layout/activity_xwalk_view_setting_javascript_enabled.xml create mode 100644 usecase/usecase-embedding-android-tests/embeddingapi/res/layout/activity_xwalk_view_setting_javascript_open_windows_automatically.xml create mode 100644 usecase/usecase-embedding-android-tests/embeddingapi/src/org/xwalk/embedded/api/sample/setting/XWalkViewSettingJavaScriptCanOpenWindowsAutomatically.java create mode 100644 usecase/usecase-embedding-android-tests/embeddingapi/src/org/xwalk/embedded/api/sample/setting/XWalkViewSettingJavaScriptEnabled.java diff --git a/usecase/usecase-embedding-android-tests/embeddingapi-async/AndroidManifest.xml b/usecase/usecase-embedding-android-tests/embeddingapi-async/AndroidManifest.xml index 732f0361b..e390f2fd6 100644 --- a/usecase/usecase-embedding-android-tests/embeddingapi-async/AndroidManifest.xml +++ b/usecase/usecase-embedding-android-tests/embeddingapi-async/AndroidManifest.xml @@ -754,6 +754,24 @@ + + + + + + + + + + + + + + JavaScript Enabled: False + + + diff --git a/usecase/usecase-embedding-android-tests/embeddingapi-async/assets/window_open_automatically.html b/usecase/usecase-embedding-android-tests/embeddingapi-async/assets/window_open_automatically.html new file mode 100644 index 000000000..362b7e950 --- /dev/null +++ b/usecase/usecase-embedding-android-tests/embeddingapi-async/assets/window_open_automatically.html @@ -0,0 +1,12 @@ + + + Windows Open Automatically: Disabled + + + \ No newline at end of file diff --git a/usecase/usecase-embedding-android-tests/embeddingapi-async/assets/window_open_automatically_enabled.html b/usecase/usecase-embedding-android-tests/embeddingapi-async/assets/window_open_automatically_enabled.html new file mode 100644 index 000000000..18a668244 --- /dev/null +++ b/usecase/usecase-embedding-android-tests/embeddingapi-async/assets/window_open_automatically_enabled.html @@ -0,0 +1,5 @@ + + + Windows Open Automatically: Enabled + + \ No newline at end of file diff --git a/usecase/usecase-embedding-android-tests/embeddingapi-async/res/layout/activity_xwalk_view_setting_dom_storage_enable_async.xml b/usecase/usecase-embedding-android-tests/embeddingapi-async/res/layout/activity_xwalk_view_setting_dom_storage_enable_async.xml index 9b37f4062..30b35cc0c 100644 --- a/usecase/usecase-embedding-android-tests/embeddingapi-async/res/layout/activity_xwalk_view_setting_dom_storage_enable_async.xml +++ b/usecase/usecase-embedding-android-tests/embeddingapi-async/res/layout/activity_xwalk_view_setting_dom_storage_enable_async.xml @@ -9,7 +9,7 @@ + + + + + + +