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:
whesse@google.com 2014-11-04 15:00:00 +00:00
parent dadff8c117
commit 49acd886b9
3 changed files with 6 additions and 16 deletions

View file

@ -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);
});
}

View file

@ -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'));
});
}

View file

@ -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)) {