cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject cordova-plugin-screen-orientation git commit: CB-12588: add manual tests in cordova-plugin-test-framework style
Date Tue, 21 Mar 2017 00:37:00 GMT
Repository: cordova-plugin-screen-orientation
Updated Branches:
  refs/heads/master 5a7370a16 -> f12721b35


CB-12588: add manual tests in cordova-plugin-test-framework style


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/commit/f12721b3
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/tree/f12721b3
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/diff/f12721b3

Branch: refs/heads/master
Commit: f12721b35e8f48599d1698ead85eaf707b8532fa
Parents: 5a7370a
Author: filmaj <maj.fil@gmail.com>
Authored: Mon Mar 20 12:36:50 2017 -0700
Committer: filmaj <maj.fil@gmail.com>
Committed: Mon Mar 20 12:36:50 2017 -0700

----------------------------------------------------------------------
 tests/tests.js | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-screen-orientation/blob/f12721b3/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index b91f81a..42b5aff 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -139,3 +139,23 @@ exports.defineAutoTests = function() {
         });
     });
 };
+exports.defineManualTests = function(contentEl, createActionButton) {
+
+    createActionButton('Listen to orientationchange events', function() {
+        window.addEventListener("orientationchange", function(){
+            contentEl.innerHTML += '<p>Orientation changed! ' + screen.orientation.type
+ '</p>';
+        });
+    });
+    createActionButton('Unlock orientation', function() {
+        screen.orientation.unlock();
+        contentEl.innerHTML += '<p>Orientation unlocked.</p>';
+    });
+    createActionButton('Lock to portrait', function() {
+        screen.orientation.lock('portrait');
+        contentEl.innerHTML += '<p>Orientation locked to portrait.</p>';
+    });
+    createActionButton('Lock to landscape', function() {
+        screen.orientation.lock('landscape');
+        contentEl.innerHTML += '<p>Orientation locked to landscape.</p>';
+    });
+};


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message