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

Unified Diff: editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/util/LibraryReferenceFinderTest.java

Issue 11414205: Fix for issue 6651 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/util/LibraryReferenceFinderTest.java
===================================================================
--- editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/util/LibraryReferenceFinderTest.java (revision 15448)
+++ editor/tools/plugins/com.google.dart.tools.core_test/src/com/google/dart/tools/core/internal/util/LibraryReferenceFinderTest.java (working copy)
@@ -25,6 +25,28 @@
assertNotNull(finder);
}
+ public void test_LibraryReferenceFinder_malformed() throws Exception {
+ // issue 6651
+ String malformedHtml = "<html><body>"
+ + "\n <script type=\"application/dart\" src=\"bug.dart\"> /script>" + "\n</body></html>"
+ + "\n/Network/Servers/hdserver1.hdinternal.net/Users/egrimes/dart/bug/web/bug.html";
+ LibraryReferenceFinder finder = new LibraryReferenceFinder();
+ finder.processHTML(malformedHtml);
+ List<String> libraries = finder.getLibraryList();
+ assertNotNull(libraries);
+ assertEquals(1, libraries.size());
+ }
+
+ public void test_LibraryReferenceFinder_malformed2() throws Exception {
+ // issue 6651
+ String malformedHtml = "<html><body><script type=\"application/dart\" src=\"bug.dart\"";
+ LibraryReferenceFinder finder = new LibraryReferenceFinder();
+ finder.processHTML(malformedHtml);
+ List<String> libraries = finder.getLibraryList();
+ assertNotNull(libraries);
+ assertEquals(0, libraries.size());
+ }
+
public void test_LibraryReferenceFinder_noScripts() {
LibraryReferenceFinder finder = new LibraryReferenceFinder();
finder.processHTML(HTMLFactory.noScripts());
« no previous file with comments | « editor/tools/plugins/com.google.dart.tools.core/src/com/google/dart/tools/core/internal/util/LibraryReferenceFinder.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698