Skip to content

Commit

Permalink
updated location of mozTCPSocket
Browse files Browse the repository at this point in the history
  • Loading branch information
lightsofapollo committed Aug 18, 2012
1 parent 4ed156d commit 8c6ca12
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/loader.js
Expand Up @@ -42,10 +42,18 @@ function importLib(file) {
}
}());

var navigator = {
get mozTCPSocket() {
delete navigator.mozTCPSocket;
return navigator.mozTCPSocket = window.TCPSocket;
}
};

var window = this.window = {
xpcDump: dump,
xpcComponents: Components,
xpcArgv: args,
navigator: navigator,

get XMLHttpRequest() {
var comp = Components.Constructor(
Expand Down
2 changes: 2 additions & 0 deletions test/tcp-socket-test.js
Expand Up @@ -7,6 +7,8 @@ describe('tcp socket', function() {
it('should work under xpcom', function(done) {
this.timeout(5000);

expect(window.navigator.mozTCPSocket).to.be.ok();

subject = window.TCPSocket.open('localhost', 80, {
verifyCert: false
});
Expand Down

0 comments on commit 8c6ca12

Please sign in to comment.