mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 11:31:57 +00:00
Improve handling of intentionally broken links in test scripts.
BUG= Review URL: https://codereview.chromium.org//702673002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41492 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
dadff8c117
commit
49acd886b9
|
@ -17,7 +17,7 @@ main() {
|
||||||
test('fails from browser', () {
|
test('fails from browser', () {
|
||||||
// APIs should not work in standard browser apps.
|
// APIs should not work in standard browser apps.
|
||||||
expect(() {
|
expect(() {
|
||||||
_chrome.app.window.create('foo.html');
|
_chrome.app.window.create('IntentionallyMissingFile.html');
|
||||||
}, throws);
|
}, throws);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,9 +13,9 @@ main() {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('constructorTest2', () {
|
test('constructorTest2', () {
|
||||||
var audio = new AudioElement('hahaURL');
|
var audio = new AudioElement('IntentionallyMissingFileURL');
|
||||||
expect(audio, isNotNull);
|
expect(audio, isNotNull);
|
||||||
expect(audio is AudioElement, isTrue);
|
expect(audio is AudioElement, isTrue);
|
||||||
expect(audio.src, contains('hahaURL'));
|
expect(audio.src, contains('IntentionallyMissingFileURL'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -126,17 +126,7 @@ class TestingServers {
|
||||||
"/foo",
|
"/foo",
|
||||||
"/bar",
|
"/bar",
|
||||||
"/NonExistingFile",
|
"/NonExistingFile",
|
||||||
"/NonExistingFile.js",
|
"IntentionallyMissingFile",
|
||||||
"/hahaURL",
|
|
||||||
"/IntentionallyMissingFile",
|
|
||||||
"/IntentionallyMissingFile.dart",
|
|
||||||
"/IntentionallyMissingFile.html",
|
|
||||||
"/IntentionallyMissingFile.png",
|
|
||||||
"/IntentionallyMissingFile.css",
|
|
||||||
"/IntentionallyMissingFile.jpg",
|
|
||||||
"/IntentionallyMissingFile.ttf",
|
|
||||||
"/IntentionallyMissingFile.otf",
|
|
||||||
"/IntentionallyMissingFile.jpeg"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
List _serverList = [];
|
List _serverList = [];
|
||||||
|
@ -419,8 +409,8 @@ class TestingServers {
|
||||||
|
|
||||||
void _sendNotFound(HttpRequest request) {
|
void _sendNotFound(HttpRequest request) {
|
||||||
bool isHarmlessPath(String path) {
|
bool isHarmlessPath(String path) {
|
||||||
return _HARMLESS_REQUEST_PATH_ENDINGS.any((ending) {
|
return _HARMLESS_REQUEST_PATH_ENDINGS.any((pattern) {
|
||||||
return path.endsWith(ending);
|
return path.contains(pattern);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!isHarmlessPath(request.uri.path)) {
|
if (!isHarmlessPath(request.uri.path)) {
|
||||||
|
|
Loading…
Reference in a new issue