diff options
Diffstat (limited to 'contexts/data/lib/closure-library/closure/goog/messaging/portnetwork_test.html')
-rw-r--r-- | contexts/data/lib/closure-library/closure/goog/messaging/portnetwork_test.html | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/contexts/data/lib/closure-library/closure/goog/messaging/portnetwork_test.html b/contexts/data/lib/closure-library/closure/goog/messaging/portnetwork_test.html deleted file mode 100644 index 5945259..0000000 --- a/contexts/data/lib/closure-library/closure/goog/messaging/portnetwork_test.html +++ /dev/null @@ -1,74 +0,0 @@ -<!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 -</title> -<script src="../base.js"></script> -<script> -goog.require('goog.events.EventTarget'); -goog.require('goog.messaging.PortChannel'); -goog.require('goog.messaging.PortOperator'); -goog.require('goog.testing.AsyncTestCase'); -goog.require('goog.testing.MockControl'); -goog.require('goog.testing.async.MockControl'); -goog.require('goog.testing.messaging.MockMessageEvent'); -goog.require('goog.testing.jsunit'); -</script> -</head> -<body> -<iframe style="display: none;" name="inner" id="inner" - src="testdata/portnetwork_inner.html"></iframe> -<script> - -var asyncTestCase = goog.testing.AsyncTestCase.createAndInstall(); - -// Use a relatively long timeout because workers can take a while to start up. -asyncTestCase.stepTimeout = 5 * 1000; - -var timer; - -function setUp() { - timer = new goog.Timer(50); -} - -function tearDown() { - goog.dispose(timer); -} - -function testRouteMessageThroughWorkers() { - if (!('MessageChannel' in goog.global)) { - return; - } - - var master = new goog.messaging.PortOperator('main'); - master.addPort('worker1', new goog.messaging.PortChannel( - new Worker('testdata/portnetwork_worker1.js'))); - master.addPort('worker2', new goog.messaging.PortChannel( - new Worker('testdata/portnetwork_worker2.js'))); - master.addPort( - 'frame', goog.messaging.PortChannel.forEmbeddedWindow( - window.frames['inner'], '*', timer)); - - master.dial('worker1').registerService('result', function(msg) { - assertArrayEquals(['main', 'worker2', 'frame', 'worker1'], msg); - master.dispose(); - asyncTestCase.continueTesting(); - }, true); - - master.dial('worker2').send('sendToFrame', ['main']); - - asyncTestCase.waitForAsync('routing messages'); -} - -</script> -</body> -</html> |