Skip to content
Snippets Groups Projects
Commit a814d7d9 authored by nweiz@google.com's avatar nweiz@google.com Committed by Natalie Weizenbaum
Browse files

Re-add missing pub tests.

R=rnystrom@google.com
BUG=

Review URL: https://codereview.chromium.org//210643002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge@34442 260f80e4-7a28-3924-810f-c04153c831b5
parent d333eaf3
No related branches found
No related tags found
No related merge requests found
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS d.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.
library pub_tests;
import 'package:scheduled_test/scheduled_test.dart';
import '../../descriptor.dart' as d;
import '../../test_pub.dart';
import '../utils.dart';
main() {
initConfig();
setUp(() {
d.dir(appPath, [
d.appPubspec()
]).create();
});
integration("responds with NOT_SERVED for an unknown domain", () {
pubServe();
expectWebSocketError("urlToAssetId", {
"url": "http://example.com:80/index.html"
}, NOT_SERVED, '"example.com:80" is not being served by pub.');
endPubServe();
});
integration("responds with NOT_SERVED for an unknown port", () {
pubServe();
expectWebSocketError("urlToAssetId", {
"url": "http://localhost:80/index.html"
}, NOT_SERVED, '"localhost:80" is not being served by pub.');
endPubServe();
});
}
\ No newline at end of file
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS d.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.
library pub_tests;
import 'package:scheduled_test/scheduled_test.dart';
import '../../descriptor.dart' as d;
import '../../test_pub.dart';
import '../utils.dart';
main() {
// TODO(rnystrom): Split into independent tests.
initConfig();
setUp(() {
d.dir("foo", [
d.libPubspec("foo", "0.0.1"),
d.dir("asset", [
d.file("foo.txt", "foo"),
d.dir("sub", [
d.file("bar.txt", "bar"),
])
]),
d.dir("lib", [
d.file("foo.dart", "foo")
])
]).create();
d.dir(appPath, [
d.appPubspec({
"foo": {"path": "../foo"}
}),
d.dir("lib", [
d.file("myapp.dart", "myapp"),
]),
d.dir("test", [
d.file("index.html", "<body>"),
d.dir("sub", [
d.file("bar.html", "bar"),
])
]),
d.dir("web", [
d.file("index.html", "<body>"),
d.dir("sub", [
d.file("bar.html", "bar"),
])
])
]).create();
});
integration("converts URLs to matching asset ids in web/", () {
pubServe(shouldGetFirst: true);
expectWebSocketResult("urlToAssetId", {
"url": getServerUrl("web", "index.html")
}, {"package": "myapp", "path": "web/index.html"});
endPubServe();
});
integration("converts URLs to matching asset ids in subdirectories of web/",
() {
pubServe(shouldGetFirst: true);
expectWebSocketResult("urlToAssetId", {
"url": getServerUrl("web", "sub/bar.html")
}, {"package": "myapp", "path": "web/sub/bar.html"});
endPubServe();
});
integration("converts URLs to matching asset ids in test/", () {
pubServe(shouldGetFirst: true);
expectWebSocketResult("urlToAssetId", {
"url": getServerUrl("test", "index.html")
}, {"package": "myapp", "path": "test/index.html"});
endPubServe();
});
integration("converts URLs to matching asset ids in subdirectories of test/",
() {
pubServe(shouldGetFirst: true);
expectWebSocketResult("urlToAssetId", {
"url": getServerUrl("test", "sub/bar.html")
}, {"package": "myapp", "path": "test/sub/bar.html"});
endPubServe();
});
integration("converts URLs to matching asset ids in the entrypoint's lib/",
() {
// Path in root package's lib/.
pubServe(shouldGetFirst: true);
expectWebSocketResult("urlToAssetId", {
"url": getServerUrl("web", "packages/myapp/myapp.dart")
}, {"package": "myapp", "path": "lib/myapp.dart"});
endPubServe();
});
integration("converts URLs to matching asset ids in a dependency's lib/", () {
// Path in lib/.
pubServe(shouldGetFirst: true);
expectWebSocketResult("urlToAssetId", {
"url": getServerUrl("web", "packages/foo/foo.dart")
}, {"package": "foo", "path": "lib/foo.dart"});
endPubServe();
});
integration("converts URLs to matching asset ids in the entrypoint's asset/",
() {
// Paths in asset/.
pubServe(shouldGetFirst: true);
expectWebSocketResult("urlToAssetId", {
"url": getServerUrl("web", "assets/foo/foo.txt")
}, {"package": "foo", "path": "asset/foo.txt"});
endPubServe();
});
integration("converts URLs to matching asset ids in a dependency's of asset/",
() {
pubServe(shouldGetFirst: true);
expectWebSocketResult("urlToAssetId", {
"url": getServerUrl("web", "assets/foo/sub/bar.txt")
}, {"package": "foo", "path": "asset/sub/bar.txt"});
endPubServe();
});
}
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS d.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.
library pub_tests;
import 'package:scheduled_test/scheduled_test.dart';
import '../../descriptor.dart' as d;
import '../../test_pub.dart';
import '../utils.dart';
main() {
initConfig();
integration("provides output line number if given source one", () {
d.dir(appPath, [
d.appPubspec(),
d.dir("web", [
d.file("main.dart", "main")
])
]).create();
pubServe();
// Paths in web/.
expectWebSocketResult("urlToAssetId", {
"url": getServerUrl("web", "main.dart"),
"line": 12345
}, {
"package": "myapp",
"path": "web/main.dart",
"line": 12345
});
endPubServe();
});
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment