OLD | NEW |
| (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:convert'; | |
6 | |
7 import '../descriptor.dart' as d; | |
8 import '../test_pub.dart'; | |
9 | |
10 /// Runs the hosted test server and serves a valid "browser" package that | |
11 /// contains the same files (but not their contents) as the real browser | |
12 /// package. | |
13 void serveBrowserPackage() { | |
14 serve([ | |
15 d.dir('api', [ | |
16 d.dir('packages', [ | |
17 d.file('browser', JSON.encode({ | |
18 'versions': [packageVersionApiMap(packageMap('browser', '1.0.0'))] | |
19 })), | |
20 d.dir('browser', [ | |
21 d.dir('versions', [ | |
22 d.file('1.0.0', JSON.encode( | |
23 packageVersionApiMap( | |
24 packageMap('browser', '1.0.0'), | |
25 full: true))) | |
26 ]) | |
27 ]) | |
28 ]) | |
29 ]), | |
30 d.dir('packages', [ | |
31 d.dir('browser', [ | |
32 d.dir('versions', [ | |
33 d.tar('1.0.0.tar.gz', [ | |
34 d.file('pubspec.yaml', yaml(packageMap("browser", "1.0.0"))), | |
35 d.dir('lib', [ | |
36 d.file('dart.js', 'contents of dart.js'), | |
37 d.file('interop.js', 'contents of interop.js') | |
38 ]) | |
39 ]) | |
40 ]) | |
41 ]) | |
42 ]) | |
43 ]); | |
44 } | |
OLD | NEW |