Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: tools/testing/dart/html_test.dart

Issue 705733003: Support dart and js scripts in HTML tests, on dartium. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/html/scripts_test_js.js ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Classes and methods for running HTML tests. 6 * Classes and methods for running HTML tests.
7 * 7 *
8 * HTML tests are valid HTML files whose names end in _htmltest.html, and that 8 * HTML tests are valid HTML files whose names end in _htmltest.html, and that
9 * contain annotations specifying the scripts in the test and the 9 * contain annotations specifying the scripts in the test and the
10 * messages the test should post to its window, in order to pass. 10 * messages the test should post to its window, in order to pass.
(...skipping 26 matching lines...) Expand all
37 return null; 37 return null;
38 } 38 }
39 return new HtmlTestInformation(new Path(filename), 39 return new HtmlTestInformation(new Path(filename),
40 annotation['expectedMessages'], 40 annotation['expectedMessages'],
41 annotation['scripts']); 41 annotation['scripts']);
42 } 42 }
43 43
44 String getContents(HtmlTestInformation info) { 44 String getContents(HtmlTestInformation info) {
45 String contents = new File(info.filePath.toNativePath()).readAsStringSync(); 45 String contents = new File(info.filePath.toNativePath()).readAsStringSync();
46 return contents.replaceFirst(htmlAnnotation, ''); 46 return contents.replaceFirst(htmlAnnotation, '');
47 } 47 }
48
49 String makeFailingHtmlFile(String message) {
50 return '''
51 <!DOCTYPE html>
52 <html>
53 <head>
54 <script>window.parent.dispatchEvent(new Event('detect_errors'));</script>
55 <title>Failing HTML test</title>
56 </head><body>
57 <h1>Failing HTML test</h1>
58 $message
59 <script>
60 throw "HTML test failed: $message";
61 </script>
62 </body>
63 </html>
64 ''';
65 }
OLDNEW
« no previous file with comments | « tests/html/scripts_test_js.js ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698