Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'acheetham/FLUID-4572-template-path-for-…
…tests' * acheetham/FLUID-4572-template-path-for-tests: FLUID-4572: Cleaning up tests (doctype, namespace, remove simulate, add qunit license). FLUID-4572: Cleaning up tests: back to simple override of template path. FLUID-4572: Clean up unit test lib code; tidy the 'buildResourceSpec' function. FLUID-4572: Refactor valid template path to be default for all tests. FLUID-4572: Tests for a configurable template path (first tests).
- Loading branch information
Showing
12 changed files
with
2,121 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<title>Video Player Test Suite</title> | ||
|
||
<link rel="stylesheet" type="text/css" media="screen" href="../lib/qunit/css/qunit.css" /> | ||
|
||
<script type="text/javascript" src="../../lib/infusion/MyInfusion.js"></script> | ||
<script type="text/javascript" src="../../lib/jquery-ui/js/jquery.ui.button.js"></script> | ||
<script type="text/javascript" src="../../js/VideoPlayer.js"></script> | ||
<script type="text/javascript" src="../../js/VideoPlayer_captionner.js"></script> | ||
<script type="text/javascript" src="../../js/VideoPlayer_captionLoader.js"></script> | ||
<script type="text/javascript" src="../../js/VideoPlayer_controllers.js"></script> | ||
<script type="text/javascript" src="../../js/VideoPlayer_media.js"></script> | ||
|
||
<!-- jqUnit test framework js files --> | ||
<script type="text/javascript" src="../lib/qunit/js/qunit.js"></script> | ||
<script type="text/javascript" src="../lib/jqUnit/js/jqUnit.js"></script> | ||
<script type="text/javascript" src="../lib/jquery-ui/js/jquery.simulate.js"></script> | ||
|
||
<!-- These are tests that have been written using this page as data and test supports --> | ||
<script type="text/javascript" src="../js/VideoPlayerTests.js"></script> | ||
|
||
</head> | ||
<body id="body"> | ||
<!-- This is the markup that jqUnit will look for when running tests and displaying the results --> | ||
<h1 id="qunit-header">Video Player Test Suite</h1> | ||
<h2 id="qunit-banner"></h2> | ||
<div id="qunit-testrunner-toolbar"></div> | ||
<h2 id="qunit-userAgent"></h2> | ||
<ol id="qunit-tests"></ol> | ||
<div id="main"> | ||
|
||
<div class="videoPlayer fl-videoPlayer"> | ||
|
||
</div> | ||
|
||
</div> <!-- /main --> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
Copyright 2012 OCAD University | ||
Licensed under the Educational Community License (ECL), Version 2.0 or the New | ||
BSD license. You may not use this file except in compliance with one these | ||
Licenses. | ||
You may obtain a copy of the ECL 2.0 License and BSD License at | ||
https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt | ||
*/ | ||
|
||
// Declare dependencies | ||
/*global fluid, jqUnit, expect, jQuery, start*/ | ||
|
||
// JSLint options | ||
/*jslint white: true, funcinvoke: true, undef: true, newcap: true, nomen: true, regexp: true, bitwise: true, browser: true, forin: true, maxerr: 100, indent: 4 */ | ||
|
||
(function ($) { | ||
$(document).ready(function () { | ||
|
||
var videoPlayerTests = new jqUnit.TestCase("Video Player Tests"); | ||
|
||
var initVideoPlayer = function (testOptions) { | ||
var opts = { | ||
model: { | ||
video: { | ||
sources: [ | ||
{ | ||
src: "http://royalgiz.fr/videoplayer/video/Richard.Stallman.mp4", | ||
type: "video/mp4" | ||
} | ||
] | ||
} | ||
}, | ||
templates: { | ||
videoPlayer: { | ||
// override the default template path | ||
// TODO: We need to refactor the VideoPlayer to better support | ||
// overriding the path without needing to know file names | ||
href: "../../html/videoPlayer_template.html" | ||
} | ||
} | ||
}; | ||
$.extend(true, opts, testOptions); | ||
return fluid.videoPlayer(".videoPlayer", opts); | ||
}; | ||
|
||
videoPlayerTests.asyncTest("Configurable template path (FLUID-4572): valid path", function () { | ||
expect(1); | ||
var vidPlayer = initVideoPlayer({ | ||
listeners: { | ||
onTemplateReady: function () { | ||
jqUnit.assertTrue("The template should load", true); | ||
start(); | ||
}, | ||
onTemplateLoadError: function (href) { | ||
jqUnit.assertTrue("Template Load Error should not fire", false); | ||
start(); | ||
} | ||
} | ||
}); | ||
}); | ||
|
||
videoPlayerTests.asyncTest("Configurable template path (FLUID-4572): invalid path", function () { | ||
expect(1); | ||
var vidPlayer = initVideoPlayer({ | ||
templates: { | ||
videoPlayer: { | ||
href: "bad/test/path.html" | ||
} | ||
}, | ||
listeners: { | ||
onTemplateReady: function () { | ||
jqUnit.assertTrue("The template should not load", false); | ||
start(); | ||
}, | ||
onTemplateLoadError: function (href) { | ||
jqUnit.assertTrue("Event 'onTemplateLoadError' should fire", true); | ||
start(); | ||
} | ||
} | ||
}); | ||
}); | ||
}); | ||
})(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Attribution: | ||
* This is the unit testing suite from jQuery dual-licensed under the GPL and | ||
MIT licenses. This code is redistributed in Infusion under the MIT license. | ||
* The original is available at http://docs.jquery.com/Qunit | ||
|
||
Instructions: | ||
* To run the unit test suite, simply open any of the *-test.html pages in | ||
your web browser. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr" id="html"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<title>Test Title Goes Here</title> | ||
|
||
<!-- This is the jqUnit test css file --> | ||
<link rel="stylesheet" media="screen" href="../../../lib/qunit/css/qunit.css" /> | ||
|
||
<!-- These are the required javascript modules --> | ||
<script type="text/javascript" src="../../../../lib/jquery/core/js/jquery.js"></script> | ||
|
||
<!-- These are the jqUnit test js files --> | ||
<script type="text/javascript" src="../../../lib/qunit/js/qunit.js"></script> | ||
<script type="text/javascript" src="../../../test-core/jqUnit/js/jqUnit.js"></script> | ||
|
||
<!-- Include the javascript files you are testing here --> | ||
|
||
<!-- Include the javascript tests here --> | ||
|
||
|
||
</head> | ||
|
||
<body id="body"> | ||
<h1 id="qunit-header">Test Title Goes Here</h1> | ||
<h2 id="qunit-banner"></h2> | ||
<div id="qunit-testrunner-toolbar"></div> | ||
<h2 id="qunit-userAgent"></h2> | ||
<ol id="qunit-tests"></ol> | ||
|
||
<!-- Test HTML --> | ||
<div id="main" style="display: none;"> | ||
|
||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.