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

Side by Side Diff: lib/src/runner/browser/post_message_channel.dart

Issue 2285133005: pkg/test: Fix a few analyzer warnings (Closed) Base URL: https://github.com/dart-lang/test.git@master
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | test/io.dart » ('j') | test/io.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:convert';
6 import 'dart:html'; 5 import 'dart:html';
7 6
8 import 'package:stream_channel/stream_channel.dart'; 7 import 'package:stream_channel/stream_channel.dart';
9 8
10 /// Constructs a [StreamChannel] wrapping `postMessage` communication with the 9 /// Constructs a [StreamChannel] wrapping `postMessage` communication with the
11 /// host page. 10 /// host page.
12 StreamChannel postMessageChannel() { 11 StreamChannel postMessageChannel() {
13 var controller = new StreamChannelController(sync: true); 12 var controller = new StreamChannelController(sync: true);
14 13
15 window.onMessage.listen((message) { 14 window.onMessage.listen((message) {
(...skipping 18 matching lines...) Expand all
34 33
35 // Send a ready message once we're listening so the host knows it's safe to 34 // Send a ready message once we're listening so the host knows it's safe to
36 // start sending events. 35 // start sending events.
37 window.parent.postMessage({ 36 window.parent.postMessage({
38 "href": window.location.href, 37 "href": window.location.href,
39 "ready": true 38 "ready": true
40 }, window.location.origin); 39 }, window.location.origin);
41 40
42 return controller.foreign; 41 return controller.foreign;
43 } 42 }
OLDNEW
« no previous file with comments | « no previous file | test/io.dart » ('j') | test/io.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698