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

Side by Side Diff: tests/isolate/browser/package_resolve_browser_hook2_test.dart

Issue 2495383003: Add implementation of Isolate.resolvePackageUri for dart2js. (Closed)
Patch Set: cl comments Created 4 years, 1 month 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
OLDNEW
(Empty)
1 // Copyright (c) 2015, 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:js';
6 import 'dart:isolate';
7 import 'package:unittest/unittest.dart';
8 import 'package:unittest/html_config.dart';
9
10 main() async {
11 useHtmlConfiguration();
12
13 setUp(() {
14 context['defaultPackagesBase'] = 'path1/';
15 });
16
17 test('hook overrides package-uri resolution', () async {
18 var uri = await Isolate.resolvePackageUri(Uri.parse('package:foo/bar.txt'));
19 expect(uri, Uri.base.resolve('path1/foo/bar.txt'));
20 });
21
22 test('hook is read once, on the first use of resolvePackageUri', () async {
23 await Isolate.resolvePackageUri(Uri.parse('package:foo/bar.txt'));
24 context['defaultPackagesBase'] = 'path2/';
25 var uri = await Isolate.resolvePackageUri(Uri.parse('package:foo/bar.txt'));
26 expect(uri, Uri.base.resolve('path1/foo/bar.txt'));
27 });
28 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/isolate_patch.dart ('k') | tests/isolate/browser/package_resolve_browser_hook_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698