Chromium Code Reviews| Index: test/emitter_test.dart |
| diff --git a/test/emitter_test.dart b/test/emitter_test.dart |
| index 905b051eef70071ae36ca64977092dcf9bf40963..d05d86bb7bc07582cca1c4556b70e50a4b42103c 100644 |
| --- a/test/emitter_test.dart |
| +++ b/test/emitter_test.dart |
| @@ -327,6 +327,15 @@ main() { |
| '<link href="//example.com/a.css" rel="stylesheet">' |
| '<link href="/a.css" rel="stylesheet">' |
|
Siggi Cherem (dart-lang)
2013/03/07 22:14:20
we shouldn't be deleting this entry in the output.
terry
2013/03/08 20:11:24
Yeah, I've reverted this to test w/o polyfill I'll
|
| '</head><body></body></html>'; |
| + var expectedHtml = |
| + '<html><head>' |
| + '<script src="http://ex.com/a.js" type="text/javascript"></script>' |
| + '<script src="//example.com/a.js" type="text/javascript"></script>' |
| + '<script src="/a.js" type="text/javascript"></script>' |
| + '<link href="http://example.com/a.css" rel="stylesheet">' |
| + '<link rel="stylesheet"' |
| + ' type="text/css" href="mock_testing_file.html.css">' |
| + '</head><body></body></html>'; |
| var doc = parseDocument(html); |
| var fileInfo = analyzeNodeForTesting(doc, new Messages.silent()); |
| fileInfo.inlinedCode = new DartCodeInfo('main', null, [], '', null); |
| @@ -334,7 +343,7 @@ main() { |
| var emitter = new MainPageEmitter(fileInfo); |
| emitter.run(doc, pathInfo, null, true); |
| - expect(doc.outerHtml, equals(html)); |
| + expect(doc.outerHtml, equals(expectedHtml)); |
| }); |
| group('transform css urls', () { |
|
Siggi Cherem (dart-lang)
2013/03/07 22:14:20
the purpose of this test was to check that transfo
terry
2013/03/08 20:11:24
Done.
|
| @@ -342,7 +351,9 @@ main() { |
| var html = '<html><head>' |
| '<link href="a.css" rel="stylesheet">' |
| '</head><body></body></html>'; |
| - |
| + var expectedHtml = '<html><head>' |
| + '<link rel="stylesheet" type="text/css" href="a.html.css">' |
| + '</head><body></body></html>'; |
| test('html at the top level', () { |
| var doc = parseDocument(html); |
| var fileInfo = analyzeNodeForTesting(doc, new Messages.silent(), |
| @@ -354,7 +365,7 @@ main() { |
| var pathInfo = _newPathInfo('', 'out', true); |
| var emitter = new MainPageEmitter(fileInfo); |
| emitter.run(doc, pathInfo, null, true); |
| - expect(doc.outerHtml, html.replaceAll('a.css', '../a.css')); |
| + expect(doc.outerHtml, expectedHtml); |
| }); |
| test('file within dir -- base dir match input file dir', () { |
| @@ -368,7 +379,7 @@ main() { |
| var pathInfo = _newPathInfo('dir/', 'out', true); |
| var emitter = new MainPageEmitter(fileInfo); |
| emitter.run(doc, pathInfo, null, true); |
| - expect(doc.outerHtml, html.replaceAll('a.css', '../dir/a.css')); |
| + expect(doc.outerHtml, expectedHtml); |
| }); |
| test('file within dir, base dir at top-level', () { |
| @@ -382,7 +393,7 @@ main() { |
| var pathInfo = _newPathInfo('', 'out', true); |
| var emitter = new MainPageEmitter(fileInfo); |
| emitter.run(doc, pathInfo, null, true); |
| - expect(doc.outerHtml, html.replaceAll('a.css', '../../dir/a.css')); |
| + expect(doc.outerHtml, expectedHtml); |
| }); |
| test('no changes when feature is disabled', () { |
| @@ -394,7 +405,7 @@ main() { |
| var pathInfo = _newPathInfo('', 'out', true); |
| var emitter = new MainPageEmitter(fileInfo); |
| emitter.run(doc, pathInfo, null, false); |
| - expect(doc.outerHtml, html); |
| + expect(doc.outerHtml, expectedHtml); |
| }); |
| }); |
| }); |