Adding mapbox-gl branch
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!--
|
||||
Copyright 2010 The Closure Library Authors. All Rights Reserved.
|
||||
|
||||
Use of this source code is governed by the Apache License, Version 2.0.
|
||||
See the COPYING file for details.
|
||||
-->
|
||||
<!--
|
||||
-->
|
||||
<head>
|
||||
<title>PortChannel test inner document</title>
|
||||
<script src="../../base.js"></script>
|
||||
<script>
|
||||
goog.require('goog.messaging.PortChannel');
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
var channel = goog.messaging.PortChannel.forGlobalWindow('*');
|
||||
channel.registerService('ping', function(msg) {
|
||||
channel.send('pong', msg);
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
// Copyright 2010 The Closure Library Authors. All Rights Reserved.
|
||||
|
||||
// Use of this source code is governed by the Apache License, Version 2.0.
|
||||
// See the COPYING file for details.
|
||||
|
||||
/**
|
||||
* @fileoverview A web worker for integration testing the PortChannel class.
|
||||
*
|
||||
* @nocompile
|
||||
*/
|
||||
|
||||
self.CLOSURE_BASE_PATH = '../../';
|
||||
importScripts('../../bootstrap/webworkers.js');
|
||||
importScripts('../../base.js');
|
||||
|
||||
// The provide is necessary to stop the jscompiler from thinking this is an
|
||||
// entry point and adding it into the manifest incorrectly.
|
||||
goog.provide('goog.messaging.testdata.portchannel_worker');
|
||||
goog.require('goog.messaging.PortChannel');
|
||||
|
||||
function registerPing(channel) {
|
||||
channel.registerService('ping', function(msg) {
|
||||
channel.send('pong', msg);
|
||||
}, true);
|
||||
}
|
||||
|
||||
function startListening() {
|
||||
var channel = new goog.messaging.PortChannel(self);
|
||||
registerPing(channel);
|
||||
|
||||
channel.registerService('addPort', function(port) {
|
||||
port.start();
|
||||
registerPing(new goog.messaging.PortChannel(port));
|
||||
}, true);
|
||||
}
|
||||
|
||||
startListening();
|
||||
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!--
|
||||
Copyright 2010 The Closure Library Authors. All Rights Reserved.
|
||||
|
||||
Use of this source code is governed by the Apache License, Version 2.0.
|
||||
See the COPYING file for details.
|
||||
-->
|
||||
<!--
|
||||
-->
|
||||
<head>
|
||||
<title>PortChannel test inner document</title>
|
||||
<script src="../../base.js"></script>
|
||||
<script>
|
||||
goog.require('goog.messaging.PortChannel');
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
var channel = goog.messaging.PortChannel.forGlobalWindow(
|
||||
'http://somewhere-else.com');
|
||||
channel.registerService('ping', function(msg) {
|
||||
channel.send('pong', msg);
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!--
|
||||
Copyright 2011 The Closure Library Authors. All Rights Reserved.
|
||||
|
||||
Use of this source code is governed by the Apache License, Version 2.0.
|
||||
See the COPYING file for details.
|
||||
-->
|
||||
<!--
|
||||
-->
|
||||
<head>
|
||||
<title>
|
||||
Closure Unit Tests - goog.messaging.PortNetwork iframe page
|
||||
</title>
|
||||
<script src="../../base.js"></script>
|
||||
<script>
|
||||
goog.require('goog.messaging.PortCaller');
|
||||
goog.require('goog.messaging.PortChannel');
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
var caller = new goog.messaging.PortCaller(
|
||||
goog.messaging.PortChannel.forGlobalWindow('*'));
|
||||
|
||||
caller.dial('worker2').registerService('sendToWorker1', function(msg) {
|
||||
msg.push('frame');
|
||||
caller.dial('worker1').send('sendToMain', msg);
|
||||
}, true);
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
// Copyright 2011 The Closure Library Authors. All Rights Reserved.
|
||||
|
||||
// Use of this source code is governed by the Apache License, Version 2.0.
|
||||
// See the COPYING file for details.
|
||||
|
||||
/**
|
||||
* @fileoverview A web worker for integration testing the PortPool class.
|
||||
*
|
||||
* @nocompile
|
||||
*/
|
||||
|
||||
self.CLOSURE_BASE_PATH = '../../';
|
||||
importScripts('../../bootstrap/webworkers.js');
|
||||
importScripts('../../base.js');
|
||||
|
||||
// The provide is necessary to stop the jscompiler from thinking this is an
|
||||
// entry point and adding it into the manifest incorrectly.
|
||||
goog.provide('goog.messaging.testdata.portnetwork_worker1');
|
||||
goog.require('goog.messaging.PortCaller');
|
||||
goog.require('goog.messaging.PortChannel');
|
||||
|
||||
function startListening() {
|
||||
var caller = new goog.messaging.PortCaller(
|
||||
new goog.messaging.PortChannel(self));
|
||||
|
||||
caller.dial('frame').registerService('sendToMain', function(msg) {
|
||||
msg.push('worker1');
|
||||
caller.dial('main').send('result', msg);
|
||||
}, true);
|
||||
}
|
||||
|
||||
startListening();
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
// Copyright 2011 The Closure Library Authors. All Rights Reserved.
|
||||
|
||||
// Use of this source code is governed by the Apache License, Version 2.0.
|
||||
// See the COPYING file for details.
|
||||
|
||||
/**
|
||||
* @fileoverview A web worker for integration testing the PortPool class.
|
||||
*
|
||||
* @nocompile
|
||||
*/
|
||||
|
||||
self.CLOSURE_BASE_PATH = '../../';
|
||||
importScripts('../../bootstrap/webworkers.js');
|
||||
importScripts('../../base.js');
|
||||
|
||||
// The provide is necessary to stop the jscompiler from thinking this is an
|
||||
// entry point and adding it into the manifest incorrectly.
|
||||
goog.provide('goog.messaging.testdata.portnetwork_worker2');
|
||||
goog.require('goog.messaging.PortCaller');
|
||||
goog.require('goog.messaging.PortChannel');
|
||||
|
||||
function startListening() {
|
||||
var caller = new goog.messaging.PortCaller(
|
||||
new goog.messaging.PortChannel(self));
|
||||
|
||||
caller.dial('main').registerService('sendToFrame', function(msg) {
|
||||
msg.push('worker2');
|
||||
caller.dial('frame').send('sendToWorker1', msg);
|
||||
}, true);
|
||||
}
|
||||
|
||||
startListening();
|
||||
Reference in New Issue
Block a user