| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 } | 252 } |
| 253 | 253 |
| 254 @Override | 254 @Override |
| 255 public synchronized void onMessage(DataChannel.Buffer buffer) { | 255 public synchronized void onMessage(DataChannel.Buffer buffer) { |
| 256 DataChannel.Buffer expected = expectedBuffers.removeFirst(); | 256 DataChannel.Buffer expected = expectedBuffers.removeFirst(); |
| 257 assertEquals(expected.binary, buffer.binary); | 257 assertEquals(expected.binary, buffer.binary); |
| 258 assertTrue(expected.data.equals(buffer.data)); | 258 assertTrue(expected.data.equals(buffer.data)); |
| 259 } | 259 } |
| 260 | 260 |
| 261 @Override | 261 @Override |
| 262 public synchronized void onBufferedAmountChange(long previousAmount) { |
| 263 assertFalse(previousAmount == dataChannel.bufferedAmount()); |
| 264 } |
| 265 |
| 266 @Override |
| 262 public synchronized void onStateChange() { | 267 public synchronized void onStateChange() { |
| 263 assertEquals(expectedStateChanges.removeFirst(), dataChannel.state()); | 268 assertEquals(expectedStateChanges.removeFirst(), dataChannel.state()); |
| 264 } | 269 } |
| 265 | 270 |
| 266 public synchronized void expectStateChange(DataChannel.State state) { | 271 public synchronized void expectStateChange(DataChannel.State state) { |
| 267 expectedStateChanges.add(state); | 272 expectedStateChanges.add(state); |
| 268 } | 273 } |
| 269 | 274 |
| 270 @Override | 275 @Override |
| 271 public synchronized void onComplete(StatsReport[] reports) { | 276 public synchronized void onComplete(StatsReport[] reports) { |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 TreeSet<String> threads = new TreeSet<String>(); | 768 TreeSet<String> threads = new TreeSet<String>(); |
| 764 // This pokes at /proc instead of using the Java APIs because we're also | 769 // This pokes at /proc instead of using the Java APIs because we're also |
| 765 // looking for libjingle/webrtc native threads, most of which won't have | 770 // looking for libjingle/webrtc native threads, most of which won't have |
| 766 // attached to the JVM. | 771 // attached to the JVM. |
| 767 for (String threadId : (new File("/proc/self/task")).list()) { | 772 for (String threadId : (new File("/proc/self/task")).list()) { |
| 768 threads.add(threadId); | 773 threads.add(threadId); |
| 769 } | 774 } |
| 770 return threads; | 775 return threads; |
| 771 } | 776 } |
| 772 } | 777 } |
| OLD | NEW |