| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <title>Plupload: Test</title>
- <script src="../loader.js"></script>
- <script type="text/javascript">
- QUnit.config.reorder = false;
- o.Env.swf_url = "../../js/flash/Moxie.swf";
- o.Env.xap_url = "../../js/silverlight/Moxie.xap";
- module("Plupload", {
- setup: function() {
- },
- teardown: function() {
- }
- });
- test("xmlEncode()", function() {
- expect(1);
- equal(plupload.xmlEncode("<tag>'string1'" + '&"string2"'), '<tag>'string1'&"string2"', "<>&'\" symbols encode properly");
- });
- test("predictRuntime()", function() {
- var config = {
- runtimes : 'html4,silverlight,flash,html5',
- browse_button : 'pickfiles', // you can pass in id...
- container: $('container'), // ... or DOM Element itself
- multi_selection: true,
- max_file_size : '10mb',
- required_features: true,
- url : 'upload.php',
- flash_swf_url : '../js/Moxie.swf',
- silverlight_xap_url : '../js/Moxie.xap',
- filters : [
- {title : "Image files", extensions : "jpg,gif,png"},
- {title : "Zip files", extensions : "zip"}
- ]
- };
- equal(plupload.predictRuntime(config), 'silverlight', "Successfully handled typical Plupload config.");
- config.runtimes = 'html4,flash,silverlight,html5';
- equal(plupload.predictRuntime(config), 'flash', "Flash can access binary too.");
- config.drop_element = 'container';
- delete config.required_features;
- equal(plupload.predictRuntime(config), 'html4', "Without options considered as required, html4 should be ok.");
- });
- </script>
- </head>
- <body>
- <div id="qunit"></div>
- <div id="qunit-fixture" style="position: relative; top: 0 !important; left: 0 !important; width: 100%; height: 9px;"></div>
- </body>
- </html>
|