Skip to content

Commit

Permalink
Blank framework for porting old scope tests out of "obsolete".
Browse files Browse the repository at this point in the history
(Note that adding a new test now requies matching changes both to
build.xml and specs/frame/index.html.)
  • Loading branch information
gleneivey committed Apr 17, 2010
1 parent c9823c3 commit 479f621
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 3 deletions.
27 changes: 25 additions & 2 deletions build.xml
Expand Up @@ -641,7 +641,11 @@
<echo message=""/>
</target>

<!-- TEST FRAME SPECIFICATION -->
<!-- INTEGRATION TESTS
The following test targets do not have corresponding source modules,
and are concerned with over-all behavior of the library. They use
the concatenated-into-a-single-file version of env.js.
-->
<target name='frame-spec'
depends='local-settings'
description='Test Frame Specs'>
Expand All @@ -659,6 +663,25 @@
<echo message=""/>
</target>

<target name='scope-spec'
depends='local-settings'
description='Test Scope Specs'>
<echo message=""/>
<echo message="Executing Scope Spec"/>
<java fork="true"
jar="${RHINO_JAR}"
failonerror="true">
<arg value="-opt"/>
<arg value="-1"/>
<arg value="${TEST_DIR}/scope/boot.js"/>
<jvmarg value="-Dfile.encoding=utf-8"/>
<jvmarg value="-Xmx256m"/>
</java>
<echo message=""/>
</target>



<target description="jslint quick build - no parser!"
name="jslint"
depends="dom, event, timer, html, xhr, css, window">
Expand Down Expand Up @@ -704,7 +727,7 @@
name="concat"
depends="dom-spec, event-spec, timer-spec,
html-spec, parser-spec, xhr-spec,
css-spec, window-spec, frame-spec">
css-spec, window-spec, scope-spec, frame-spec">
<!-- CORE -->
<echo message="Building ${ENV_DIST}" />
<concat destfile="${ENV_DIST}">
Expand Down
2 changes: 1 addition & 1 deletion specs/frame/index.html
Expand Up @@ -23,7 +23,7 @@
<script type="text/javascript">
listOfTests = [
'console', 'dom', 'event', 'timer', 'html', 'parser',
'xhr', 'css', 'window' ];
'xhr', 'css', 'window', 'scope' ];
window.allTestsAreBeingRunWithinAnExtraIFrame = true;
</script>
<script src="spec.js"
Expand Down
15 changes: 15 additions & 0 deletions specs/scope/boot.js
@@ -0,0 +1,15 @@

/**
* @author thatcher
*/
load('dist/env.rhino.js');

load('specs/qunit.js');
load('specs/env.qunit.js');
load('specs/helpers.js');

load('local_settings.js');
// "load('specs/scope/spec.js');" is in the "index.html" file


location = 'specs/scope/index.html';
43 changes: 43 additions & 0 deletions specs/scope/index.html
@@ -0,0 +1,43 @@
<?xml encoding='utf-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="eng" dir="ltr">
<head profile="http://a9.com/-/spec/opensearch/1.1/">
<title>Envjs Scope Spec</title>

<link rel="stylesheet"
media="screen"
href="../qunit.css"/>

<script src="../qunit.js"
type="text/javascript" ></script>
<script src="../../local_settings.js"
type="text/javascript" ></script>

<script type="text/envjs">
// Running under Envjs, the above are loaded in 'boot.js' and
// executing them from here would be redundant/problematic. Now
// that we're past, though, make sure the rest execute under
// both Envjs and browsers:
Envjs.scriptTypes['text/javascript'] = true;
</script>
<script src="spec.js"
type="text/javascript" ></script>

</head>
<body id="body">
<h1 id="qunit-header">
<img src="../fixtures/images/icon-green.png"/>
<span>Envjs Scope Spec</span>
</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<div id='qunit-testrunner-toolbar'></div>
<div id='qunit-test-summary'>
<ol id='qunit-tests'></ol>
</div>

<div id="qunit-main" style="text-align: center;">

</div>
</body>
</html>
7 changes: 7 additions & 0 deletions specs/scope/spec.js
@@ -0,0 +1,7 @@

QUnit.module('scope');

test("Initial place-holding do-nothing test", function(){
ok( true, 'True is true' );
});

0 comments on commit 479f621

Please sign in to comment.