Skip to content

Commit

Permalink
Merge branch 'master' into frame-scope
Browse files Browse the repository at this point in the history
  • Loading branch information
gleneivey committed Apr 18, 2010
2 parents 17391d7 + c17a348 commit 59e7015
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
3 changes: 2 additions & 1 deletion specs/helpers.js
@@ -1,5 +1,6 @@
// helpers available to all tests

function runningUnderEnvjs(){
return navigator.userAgent.search( /Envjs/ ) > -1;
return (typeof navigator === 'object') &&
navigator.userAgent.search( /Envjs/ ) > -1;
}
14 changes: 8 additions & 6 deletions specs/html/boot.js
Expand Up @@ -14,14 +14,16 @@ load('dist/console.js');
load('dist/dom.js');
load('dist/event.js');
load('dist/html.js');
load('dist/timer.js');
load('dist/parser.js');
load('dist/xhr.js');
load('dist/window.js');

load('local_settings.js');
load('specs/html/spec.js');
// if the html code has forward references, then
// we have a different problem.

//load('dist/timer.js');
//load('dist/parser.js');
//load('dist/xhr.js');
//load('dist/window.js');

load('specs/html/spec.js');

location = 'specs/html/index.html';
start();
11 changes: 7 additions & 4 deletions specs/html/spec.js
Expand Up @@ -2,10 +2,11 @@ QUnit.module('html');

test('HTML Interfaces Available', function(){

if (runningUnderEnvjs())
if (runningUnderEnvjs()) {
expect(53);
else
} else {
expect(51);
}

ok(HTMLDocument, 'HTMLDocument defined');
ok(HTMLElement, 'HTMLElement defined');
Expand Down Expand Up @@ -349,8 +350,10 @@ test('HTMLDocument.createElement(script)', function(){

element.textContent = 'document.ASDFASDF = "QWERQWER";';
// TODO: document.ASDFASDF should still be undefined
document.getElementsByTagName('head')[0].appendChild(element);
equals(document.ASDFASDF, 'QWERQWER', 'script appended to head executes');
//
// this document does not have a head which is a problem in an of itself
//document.getElementsByTagName('head')[0].appendChild(element);
//equals(document.ASDFASDF, 'QWERQWER', 'script appended to head executes');

// create setting and getting 'text' property
element = document.createElement('script');
Expand Down

0 comments on commit 59e7015

Please sign in to comment.