Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add formcontrol and manual test page

Issue #391

Reviewed By: Jeffrey Heifetz <jheifetz@rim.com>
Tested By: Tracy Li <tli@rim.com>
  • Loading branch information...
commit 1a0c866674ef509578dbd8e7a01af4a3f21d8abd 1 parent 236d31f
@bryanhiggins bryanhiggins authored Nukul Bhasin committed
View
8 dependencies/bootstrap/ui.html
@@ -61,5 +61,13 @@
<div id="childwebviewcontrols"></div>
+ <div id="formcontrolPanel">
+ <div id="formcontrol">
+ <button id="formcontrol_previous"/>
+ <button id="formcontrol_next"/>
+ <button id="formcontrol_submit"/>
+ </div>
+ </div>
+
</body>
</html>
View
1  lib/config/default.js
@@ -69,5 +69,6 @@ module.exports = {
backgroundSource: "",
foregroundSource: "index.html",
debugEnabled: false,
+ enableFormControl: true,
enableChildWebView: true
};
View
3  lib/framework.js
@@ -97,6 +97,9 @@ var _self = {
window.qnx.webplatform.getApplication().invocation.invoke(request);
};
}
+ if (config.enableFormControl) {
+ overlayWebView.getWebViewObj().formcontrol.subscribeTo(webview);
+ }
});
},
{
View
24 test/test-app/manual/formcontrol/main.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+</head>
+<body>
+<form>
+ <h3>HTML Form Control Test</h3>
+ <ui>
+ <li>Previous should be disabled initially</li>
+ <li>Use next and previous buttons to navigate</li>
+ <li>Use submit button to submit the form</li>
+ <li>Next button should be disabled while on the last field</li>
+ </ui>
+ <p>
+ Text Value: <input type="text" name="textValue" /><br />
+ Text Value 2: <input type="text" name="textValue2" /><br />
+ Password: <input type="password" name="passwordValue" /><br />
+ <input type="submit" value="Submit" />
+ </p>
+ <a href="../index.htm">Back</a>
+</form>
+</body>
+</html>
View
4 test/test-app/manual/index.htm
@@ -6,9 +6,9 @@
<button onclick="document.location.href='local:///index.htm'">Back</button><br />
<h2>Manual Tests</h2>
<a href="local:///manual/framework/SpecRunner.htm">Framework</a><br />
-
<a href="local:///manual/framework-split/main.htm">Framework SPLIT</a><br />
<a href="local:///manual/html5/main.htm">HTML5</a><br />
<a href="local:///manual/childWebView/main.html">Child Web Views</a><br />
- <a href="local:///manual/ContextMenu/index.htm">Context Menu</a>
+ <a href="local:///manual/ContextMenu/index.htm">Context Menu</a><br />
+ <a href="local:///manual/formcontrol/main.html">Form Control</a></br />
</body>
View
22 test/unit/lib/framework.js
@@ -19,6 +19,7 @@ var srcPath = __dirname + '/../../../lib/',
framework,
webview,
overlayWebView,
+ overlayWebViewObj,
controllerWebView,
Whitelist = require(srcPath + 'policy/whitelist').Whitelist,
mockedWebview,
@@ -98,6 +99,10 @@ describe("framework", function () {
});
spyOn(overlayWebView, "create").andCallFake(function (done) {
+ overlayWebViewObj = overlayWebView.getWebViewObj();
+ overlayWebViewObj.formcontrol = {
+ subscribeTo: jasmine.createSpy()
+ };
done();
});
@@ -311,5 +316,22 @@ describe("framework", function () {
expect(overlayWebView.showDialog).toHaveBeenCalledWith(messageObj);
});
});
+
});
+
+ describe('enabling form control', function () {
+
+ it('subscribes webview to formcontrol', function () {
+ config.enableFormControl = true;
+ framework.start();
+ expect(overlayWebViewObj.formcontrol.subscribeTo).toHaveBeenCalledWith(webview);
+ });
+
+ it('does not subscribe webview to formcontrol is enableFormControl is false', function () {
+ config.enableFormControl = false;
+ framework.start();
+ expect(overlayWebViewObj.formcontrol.subscribeTo).not.toHaveBeenCalled();
+ });
+ });
+
});
Please sign in to comment.
Something went wrong with that request. Please try again.