Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
entire test suite, still several bugs
- Loading branch information
David Clarke
committed
Feb 25, 2012
1 parent
55873df
commit 411ac21
Showing
25 changed files
with
3,182 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
var SERVERS = {"_primary":"http://127.0.0.1:8088", | ||
"basic_app":"http://www.example.com:80/tests/dom/tests/mochitest/webapps/servers/basic_app/", | ||
"app_with_simple_service":"http://127.0.0.1:57043", | ||
"bad_content_type":"http://127.0.0.1:57044"}; | ||
|
||
|
||
//"basic_app":"http://127.0.0.1:57045","json_syntax_error":"http://127.0.0.1:57046","manifest_with_bom":"http://127.0.0.1:57047","missing_required_field":"http://127.0.0.1:57048","no_delegated_install":"http://127.0.0.1:57049","no_mgmt_api_off_repo_origin":"http://127.0.0.1:57050","demo":"http://127.0.0.1:57051","demopaid":"http://127.0.0.1:57052","mozillaball":"http://127.0.0.1:57053","mozillahead":"http://127.0.0.1:57054","tasktracker":"http://127.0.0.1:57055","app1":"http://127.0.0.1:57056","app2":"http://127.0.0.1:57057"}; | ||
|
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,19 @@ | ||
const CC = Components.Constructor; | ||
const BinaryInputStream = CC("@mozilla.org/binaryinputstream;1", | ||
"nsIBinaryInputStream", | ||
"setInputStream"); | ||
|
||
function handleRequest(request, response) { | ||
var host = request.host; | ||
var port = request.port; | ||
var path = request.path; | ||
var file; | ||
|
||
getObjectState("SERVER_ROOT", function(serverRoot) | ||
{ | ||
file = serverRoot.getFile("tests/dom/tests/mochitest/webapps/servers/basic_app/" + path); | ||
}); | ||
response.write(file); | ||
} | ||
|
||
|
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,2 @@ | ||
Each directory here will be run in its own webserver | ||
running on localhost by the test harness at ../run.js |
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 @@ | ||
<html> | ||
<body> | ||
This page contains javascript that can be included in an iframe and | ||
upon recieving commands over jschannel will serve up gunk from local storage. | ||
</body> | ||
<script src="/servers.js"></script> | ||
<!-- jschannel, that's how our parent will control us --> | ||
<script src="/jschannel.js"></script> | ||
<!-- finally, define our handlers that'll be invoked over jschannel by the parent --> | ||
<script> | ||
|
||
function myonload() { | ||
// update repo origin for the test environment | ||
if (navigator.mozApps.setRepoOrigin) { | ||
navigator.mozApps.setRepoOrigin(SERVERS['_primary']); | ||
} | ||
|
||
var chan = Channel.build({ | ||
window: window.parent, | ||
origin: "*", | ||
scope: "test" | ||
}); | ||
|
||
chan.bind("getLastImage", function(trans) { | ||
return window.localStorage.getItem("lastImage"); | ||
}); | ||
} | ||
</script> | ||
<!-- a tricky bit here, we need to include the repo API js. Well wait | ||
-- to bind our JSChannel until the browser decides to load it. --> | ||
<script> | ||
var includeJsURL = SERVERS['_primary'] + "/jsapi/include.js"; | ||
var scriptTag = document.createElement("script"); | ||
scriptTag.src = includeJsURL; | ||
scriptTag.onreadystatechange = function () { | ||
if (this.readyState == 'complete') myonload(); | ||
}; | ||
scriptTag.onload = myonload; | ||
document.getElementsByTagName('head')[0].appendChild(scriptTag); | ||
</script> | ||
|
||
</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,17 @@ | ||
<!DOCTYPE html> | ||
|
||
<script src="/servers.js"></script> | ||
<script src="jschannel.js"></script> | ||
<script> | ||
|
||
var chan = Channel.build({window: window.parent, origin: "*", scope: "openwebapps_conduit"}); | ||
chan.bind("image.send", function(trans, s) { | ||
window.localStorage.setItem("lastImage", s.data); | ||
return null; | ||
}); | ||
|
||
</script> | ||
</head> | ||
</html> | ||
|
||
</script> |
Oops, something went wrong.