Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(493)

Side by Side Diff: client/fling/src/java/test/com/google/dart/fling/MessageLoopTest.java

Issue 9314025: Remove fling, deftserver (used only by fling), and commons-codec (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « client/fling/src/java/core/com/google/dart/fling/RhinoUtil.java ('k') | dart.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 package com.google.dart.fling;
6
7 import com.google.dart.fling.MessageLoop;
8
9 import junit.framework.Assert;
10
11 import org.junit.Test;
12
13 import java.io.IOException;
14
15
16 public class MessageLoopTest {
17 private static void stopIn(final MessageLoop loop, int millis) {
18 loop.postTask(new Runnable() {
19 @Override public void run() {
20 loop.stop();
21 }
22 }, millis);
23 }
24
25 private static class TestTask implements Runnable {
26 private int runCount;
27
28 @Override public void run() {
29 runCount++;
30 }
31
32 public boolean didRun() {
33 return runCount > 0;
34 }
35 }
36
37 @Test public void willItRunImmediateTasks() throws IOException {
38 final TestTask a = new TestTask();
39 final TestTask b = new TestTask();
40
41 final MessageLoop loop = MessageLoop.create();
42 loop.postTask(a);
43 loop.postTask(b);
44 stopIn(loop, 0);
45 loop.run();
46 Assert.assertTrue(a.didRun());
47 Assert.assertTrue(b.didRun());
48 }
49 }
OLDNEW
« no previous file with comments | « client/fling/src/java/core/com/google/dart/fling/RhinoUtil.java ('k') | dart.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698