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

Side by Side Diff: tests/standalone/io/network_interface_test.dart

Issue 16514010: Add NetworkAdaptor to dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Clean up implementation and add tests. Created 7 years, 6 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
OLDNEW
(Empty)
1 // Copyright (c) 2013, 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 import 'dart:io';
6
7 import "package:expect/expect.dart";
8
9
10 void testListLoopback() {
11 NetworkInterface.list(includeLoopback: false).then((list) {
12 for (var i in list) {
13 for (var a in i.addresses) {
14 Expect.isFalse(a.isLoopback);
15 }
16 }
17 });
18
19 NetworkInterface.list(includeLoopback: true).then((list) {
20 Expect.isTrue(list.any((i) => i.addresses.any((a) => a.isLoopback)));
21 });
22 }
23
24
25 void testListLinkLocal() {
26 NetworkInterface.list(includeLinkLocal: false).then((list) {
27 for (var i in list) {
28 for (var a in i.addresses) {
29 Expect.isFalse(a.isLinkLocal);
30 }
31 }
32 });
33 }
34
35
36 void main() {
37 testListLoopback();
38 testListLinkLocal();
39 }
OLDNEW
« runtime/bin/socket_patch.dart ('K') | « tests/standalone/io/internet_address_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698