[VM] Fix for issue 33027 (Fixes strong mode runtime error in _FileSystemWatcher

Change-Id: Ic1b2c183cea460020b8675fd168ad6f10f1c32c5
Reviewed-on: https://dart-review.googlesource.com/53696
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
diff --git a/runtime/bin/file_patch.dart b/runtime/bin/file_patch.dart
index c026888..247c480 100644
--- a/runtime/bin/file_patch.dart
+++ b/runtime/bin/file_patch.dart
@@ -103,7 +103,7 @@
 
   _WatcherPath _watcherPath;
 
-  StreamController _broadcastController;
+  StreamController<FileSystemEvent> _broadcastController;
 
   @patch
   static Stream<FileSystemEvent> _watch(
@@ -127,11 +127,11 @@
       throw new FileSystemException(
           "File system watching is not supported on this platform", _path);
     }
-    _broadcastController =
-        new StreamController.broadcast(onListen: _listen, onCancel: _cancel);
+    _broadcastController = new StreamController<FileSystemEvent>.broadcast(
+        onListen: _listen, onCancel: _cancel);
   }
 
-  Stream get _stream => _broadcastController.stream;
+  Stream<FileSystemEvent> get _stream => _broadcastController.stream;
 
   void _listen() {
     if (_id == null) {
@@ -342,7 +342,7 @@
   Stream _pathWatched() {
     var pathId = _watcherPath.pathId;
     if (!_idMap.containsKey(pathId)) {
-      _idMap[pathId] = new StreamController.broadcast();
+      _idMap[pathId] = new StreamController<FileSystemEvent>.broadcast();
     }
     return _idMap[pathId].stream;
   }
@@ -364,7 +364,7 @@
 
   Stream _pathWatched() {
     var pathId = _watcherPath.pathId;
-    _controller = new StreamController();
+    _controller = new StreamController<FileSystemEvent>();
     _subscription =
         _FileSystemWatcher._listenOnSocket(pathId, 0, pathId).listen((event) {
       assert(event[0] == pathId);
@@ -393,7 +393,7 @@
   Stream _pathWatched() {
     var pathId = _watcherPath.pathId;
     var socketId = _FileSystemWatcher._getSocketId(0, pathId);
-    _controller = new StreamController();
+    _controller = new StreamController<FileSystemEvent>();
     _subscription =
         _FileSystemWatcher._listenOnSocket(socketId, 0, pathId).listen((event) {
       if (event[1] != null) {
diff --git a/tests/standalone_2/standalone_2.status b/tests/standalone_2/standalone_2.status
index 6c02786..eb1b3b2 100644
--- a/tests/standalone_2/standalone_2.status
+++ b/tests/standalone_2/standalone_2.status
@@ -105,7 +105,6 @@
 io/dependency_graph_test: CompileTimeError
 io/directory_test: RuntimeError
 io/file_error_test: RuntimeError
-io/file_system_watcher_test: RuntimeError
 io/file_test: RuntimeError
 io/http_auth_digest_test: RuntimeError
 io/http_auth_test: RuntimeError