diff options
Diffstat (limited to 'o3d/tests/selenium/tests/version-check-test.html')
-rw-r--r-- | o3d/tests/selenium/tests/version-check-test.html | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/o3d/tests/selenium/tests/version-check-test.html b/o3d/tests/selenium/tests/version-check-test.html new file mode 100644 index 0000000..b16d878 --- /dev/null +++ b/o3d/tests/selenium/tests/version-check-test.html @@ -0,0 +1,90 @@ +<!-- +Copyright 2009, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--> + +<!-- +Test we can check for the version. +--> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<meta http-equiv="content-type" content="text/html; charset=UTF-8"> +<title> +Version Check +</title> +<!-- Include sample javascript library functions--> +<script + type="text/javascript" + src="../../../samples/o3djs/base.js"></script> + +<!-- Our javascript code --> +<script type="text/javascript"> +o3djs.require('o3djs.util'); + +// Events +// init() once the page has finished loading. +window.onload = init; + +// global variables +var g_testResult; + +/** + * Request version 999999 which should always fail. + */ +function init() { + o3djs.util.makeClients(haveVersion, '', '999999', dontHaveVersion); +} + +function dontHaveVersion() { + document.getElementById('result').innerHTML = + 'success: version 999999 not available'; + g_testResult = true; +} + +/** + * + */ +function haveVersion() { + document.getElementById('result').innerHTML = + 'failure: version 999999 is supposedly available!'; + g_testResult = false; +} +</script> +</head> +<body> +<h1>Version Check</h1> +Check that asking for a non-existent version fails<br/> +<!-- Start of O3D plugin --> +<div id="o3d" style="width: 200px; height: 200px;"></div> +<!-- End of O3D plugin --> +<div>Result: <span id="result"></span><div> +</body> +</html> |