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

Unified Diff: mojo/dart/packages/mojo/test/standalone_test.dart

Issue 1978593002: Make the dart:mojo.internal import configuration specific. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Add test. Created 4 years, 7 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 | « mojo/dart/packages/mojo/sources.gni ('k') | mojo/tools/get_test_list.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/dart/packages/mojo/test/standalone_test.dart
diff --git a/mojo/dart/packages/mojo/test/standalone_test.dart b/mojo/dart/packages/mojo/test/standalone_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..62c983e48466444cab526d240e2719b8d319dc10
--- /dev/null
+++ b/mojo/dart/packages/mojo/test/standalone_test.dart
@@ -0,0 +1,27 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Test that an import of 'package:mojo' doesn't fail on the VM.
+import 'package:mojo/core.dart';
+
+shouldThrowUnsupported(description, f) {
+ try {
+ f();
+ throw "$description did not throw as expected.";
+ } catch (e) {
+ if (e is! UnsupportedError) {
+ throw "$description error is not an UnsupportedError $e.";
+ }
+ }
+}
+
+main() {
+ var invalid = new MojoHandle.invalid();
+ shouldThrowUnsupported("getTimeTicksNow()", () => getTimeTicksNow());
+ shouldThrowUnsupported(
+ "MojoMessagePipe allocation", () => new MojoMessagePipe());
+ shouldThrowUnsupported("MojoDataPipe allocation", () => new MojoDataPipe());
+ shouldThrowUnsupported(
+ "MojoSharedBuffer allocation", () => new MojoSharedBuffer.create(1024));
+}
« no previous file with comments | « mojo/dart/packages/mojo/sources.gni ('k') | mojo/tools/get_test_list.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698