Sha256: 9e35694fe72321c0d6fa3173f8238117aad6f3fc831c4808433682c688e903a6

Contents?: true

Size: 1.61 KB

Versions: 6

Compression:

Stored size: 1.61 KB

Contents

module("window");

test("Window Global Scope Equivalence", function() {
	expect(7);
	
	window.foo = "abc";
	ok( window.foo == foo, "Property created on the window is available in global scope." );
	delete window.foo;
	
	try{
        $$$$$;    
	}catch(e){
	    ok( true, "Property is not in global scope." );
    }
	ok( window.$$$$$ === undefined, "Property is not in window scope." );
	load("test/unit/fixtures/external_script.js");
	ok( $$$$$ === "12345", "Property is in global scope." );
	ok( window.$$$$$ === "12345", "Property is in window scope." );
    
    try{ ok(window.Math === Math,
        "'window' object provides common global object facilities");
    }catch(e){print(e);}
    try{ ok(Math.sqrt(4) == 2,
        "'window' provides Math.* when referenced implicitly/global");
    }catch(e){print(e);}
});


test("References to the window object", function() {
    expect(3);

    try{ ok(window == window.window,
        "'window' is property of the window object");
    }catch(e){print(e);}
    try{ ok(window == self,
        "'self' refers to the current window");
    }catch(e){print(e);}
    try{ ok(window == window.top,
        "for top-level document 'window.top' refers to itself");
    }catch(e){print(e);}
});

test("Allows to change the window.location.hash parameter w/o hash", function() {
  expect(1);
  try {
    window.location.hash = 'test';
    ok(window.location.hash === '#test');
  }catch(e){print(e);}
});

test("Allows to change the window.location.hash parameter w/hash", function() {
  expect(1);
  try {
    window.location.hash = '#test';
    ok(window.location.hash === '#test');
  }catch(e){print(e);}
});

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
envjs19-0.3.8.20101029121421 test/unit/window.js
envjs-0.3.8 test/unit/window.js
envjs-0.3.7 test/unit/window.js
envjs-0.3.6 test/unit/window.js
envjs-0.3.5 test/unit/window.js
envjs-0.3.4 test/unit/window.js