Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / chrome / third_party / mock4js / examples / PublisherTest.html
blobf307172c134097bba6dc5951e0c46aba434b6f08
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
4 <html>
5 <head>
6 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7 <title>Tests</title>
8 <link rel="stylesheet" type="text/css" href="jsunit/css/jsUnitStyle.css">
9 <script language="JavaScript" type="text/javascript" src="../../jsunit/app/jsUnitCore.js"></script>
10 <script language="JavaScript" type="text/javascript" src="..//mock4js.js"></script>
11 <script language="JavaScript" type="text/javascript" src="Publisher.js"></script>
12 <script language="JavaScript" type="text/javascript">
14 Mock4JS.addMockSupport(this);
16 function setUp() {
17 Mock4JS.clearMocksToVerify();
20 function tearDown() {
21 Mock4JS.verifyAllMocks();
24 function testOneSubscriberReceivesAMessage() {
25 // setup
26 var mockSubscriber = mock(Subscriber);
27 var publisher = new Publisher();
28 publisher.add(mockSubscriber.proxy());
30 var message = "message";
32 // expectations
33 mockSubscriber.expects(once()).receive(message);
35 // execute
36 publisher.publish(message);
38 </script>
39 </head>
41 <body>
42 <h1>JsUnit Tests</h1>
44 <p>This page contains some JsUnit tests. To see them, take a look at the source.</p>
45 </body>
46 </html>