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

Unified Diff: runtime/observatory/lib/src/elements/helpers/rendering_queue.dart

Issue 2176093002: Use Timer and not AnimationFrame during Observatory UI tests (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/observatory/tests/observatory_ui/curly_block/element_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/elements/helpers/rendering_queue.dart
diff --git a/runtime/observatory/lib/src/elements/helpers/rendering_queue.dart b/runtime/observatory/lib/src/elements/helpers/rendering_queue.dart
index a6062c38ebd64201b88518d6397e5c505f15d19b..7be443d7bd02e7b591059e3f6d8e1c18c3d8e4f6 100644
--- a/runtime/observatory/lib/src/elements/helpers/rendering_queue.dart
+++ b/runtime/observatory/lib/src/elements/helpers/rendering_queue.dart
@@ -37,6 +37,22 @@ class RenderingBarrierMock implements RenderingBarrier {
}
}
+/// MOCK synchronization system for timed barrier triggering.
+class TimedRenderingBarrier implements RenderingBarrier {
+ final StreamController<num> _stream = new StreamController<num>.broadcast();
+ num _ms = 0;
+
+ Future<num> get next => _stream.stream.first;
+
+ TimedRenderingBarrier({num milliseconds: 1}) {
+ assert(milliseconds != null);
+ assert(milliseconds > 0);
+ new Timer.periodic(new Duration(milliseconds: milliseconds), (Timer t) {
+ _stream.add(_ms += milliseconds);
+ });
+ }
+}
+
/// RenderingTask queuing and synchronization system.
class RenderingQueue {
final RenderingBarrier _barrier;
« no previous file with comments | « no previous file | runtime/observatory/tests/observatory_ui/curly_block/element_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698