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

Side by Side Diff: dart/frog/leg/lib/mock.dart

Issue 9813012: Add "mock" compilation feature to dart2js and use it to improve test coverage. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 8 years, 9 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
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // Mocks of things that Leg cannot read directly. 5 // Mocks of things that Leg cannot read directly.
6 6
7 // TODO(ahe): Remove this file. 7 // TODO(ahe): Remove this file.
8 8
9 class AssertionError {} 9 class AssertionError {}
10 class TypeError extends AssertionError {} 10 class TypeError extends AssertionError {}
11 11
12 class FallThroughError { 12 class FallThroughError {
13 const FallThroughError(); 13 const FallThroughError();
14 String toString() => "Switch case fall-through."; 14 String toString() => "Switch case fall-through.";
15 } 15 }
16 16
17 // TODO(ahe): VM specfic exception? 17 // TODO(ahe): VM specfic exception?
18 class InternalError { 18 class InternalError {
19 const InternalError(this._msg); 19 const InternalError(this._msg);
20 String toString() => "InternalError: '${_msg}'"; 20 String toString() => "InternalError: '${_msg}'";
21 final String _msg; 21 final String _msg;
22 } 22 }
23 23
24 // TODO(ahe): VM specfic exception? 24 // TODO(ahe): VM specfic exception?
25 class StaticResolutionException implements Exception {} 25 class StaticResolutionException implements Exception {}
26 26
27 void assert(condition) {} 27 void assert(condition) {}
28
29 interface ByteArray extends List default _InternalByteArray {
30 ByteArray(int length);
31 }
32
33 class _InternalByteArray {
34 factory _InternalByteArray(int length) {
35 throw new UnsupportedOperationException("new ByteArray($length)");
36 }
37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698