mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 16:41:07 +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', () {
|
||||
// APIs should not work in standard browser apps.
|
||||
expect(() {
|
||||
_chrome.app.window.create('foo.html');
|
||||
_chrome.app.window.create('IntentionallyMissingFile.html');
|
||||
}, throws);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -13,9 +13,9 @@ main() {
|
|||
});
|
||||
|
||||
test('constructorTest2', () {
|
||||
var audio = new AudioElement('hahaURL');
|
||||
var audio = new AudioElement('IntentionallyMissingFileURL');
|
||||
expect(audio, isNotNull);
|
||||
expect(audio is AudioElement, isTrue);
|
||||
expect(audio.src, contains('hahaURL'));
|
||||
expect(audio.src, contains('IntentionallyMissingFileURL'));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -126,17 +126,7 @@ class TestingServers {
|
|||
"/foo",
|
||||
"/bar",
|
||||
"/NonExistingFile",
|
||||
"/NonExistingFile.js",
|
||||
"/hahaURL",
|
||||
"/IntentionallyMissingFile",
|
||||
"/IntentionallyMissingFile.dart",
|
||||
"/IntentionallyMissingFile.html",
|
||||
"/IntentionallyMissingFile.png",
|
||||
"/IntentionallyMissingFile.css",
|
||||
"/IntentionallyMissingFile.jpg",
|
||||
"/IntentionallyMissingFile.ttf",
|
||||
"/IntentionallyMissingFile.otf",
|
||||
"/IntentionallyMissingFile.jpeg"
|
||||
"IntentionallyMissingFile",
|
||||
];
|
||||
|
||||
List _serverList = [];
|
||||
|
@ -419,8 +409,8 @@ class TestingServers {
|
|||
|
||||
void _sendNotFound(HttpRequest request) {
|
||||
bool isHarmlessPath(String path) {
|
||||
return _HARMLESS_REQUEST_PATH_ENDINGS.any((ending) {
|
||||
return path.endsWith(ending);
|
||||
return _HARMLESS_REQUEST_PATH_ENDINGS.any((pattern) {
|
||||
return path.contains(pattern);
|
||||
});
|
||||
}
|
||||
if (!isHarmlessPath(request.uri.path)) {
|
||||
|
|
Loading…
Reference in a new issue