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

Unified 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: Add support for win, mac and android. 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 side-by-side diff with in-line comments
Download patch
Index: tests/standalone/io/network_interface_test.dart
diff --git a/tests/standalone/io/network_interface_test.dart b/tests/standalone/io/network_interface_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..ee6a25e9f9d7b092488b5b1f84f2368d13ff6f25
--- /dev/null
+++ b/tests/standalone/io/network_interface_test.dart
@@ -0,0 +1,39 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io';
+
+import "package:expect/expect.dart";
+
+
+void testListLoopback() {
+ NetworkInterface.list(includeLoopback: false).then((list) {
+ for (var i in list) {
+ for (var a in i.addresses) {
+ Expect.isFalse(a.isLoopback);
+ }
+ }
+ });
+
+ NetworkInterface.list(includeLoopback: true).then((list) {
+ Expect.isTrue(list.any((i) => i.addresses.any((a) => a.isLoopback)));
+ });
+}
+
+
+void testListLinkLocal() {
+ NetworkInterface.list(includeLinkLocal: false).then((list) {
+ for (var i in list) {
+ for (var a in i.addresses) {
+ Expect.isFalse(a.isLinkLocal);
+ }
+ }
+ });
+}
+
+
+void main() {
+ testListLoopback();
+ testListLinkLocal();
+}
« runtime/bin/socket_win.cc ('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