From f12721b35e8f48599d1698ead85eaf707b8532fa Mon Sep 17 00:00:00 2001 From: filmaj Date: Mon, 20 Mar 2017 12:36:50 -0700 Subject: [PATCH] CB-12588: add manual tests in cordova-plugin-test-framework style --- tests/tests.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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 += '

Orientation changed! ' + screen.orientation.type + '

'; + }); + }); + createActionButton('Unlock orientation', function() { + screen.orientation.unlock(); + contentEl.innerHTML += '

Orientation unlocked.

'; + }); + createActionButton('Lock to portrait', function() { + screen.orientation.lock('portrait'); + contentEl.innerHTML += '

Orientation locked to portrait.

'; + }); + createActionButton('Lock to landscape', function() { + screen.orientation.lock('landscape'); + contentEl.innerHTML += '

Orientation locked to landscape.

'; + }); +};