Tests for bug 536437
authorBenjamin Smedberg <benjamin@smedbergs.us>
Tue, 05 Jan 2010 12:12:41 -0500
changeset 46494 5d2e3cd990c6a9425ef84f34f565950a4fbc3827
parent 46493 077bdb4faf063916f5ff1ac5f55769e19de1e683
child 46495 3c2fda75cedb6173fa93560f0dd453b7b6413b02
push id14210
push userdougt@mozilla.com
push dateThu, 01 Jul 2010 06:28:42 +0000
treeherdermozilla-central@3aff97777291 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs536437
milestone1.9.3a1pre
Tests for bug 536437
modules/plugin/test/mochitest/test_streamNotify.html
--- a/modules/plugin/test/mochitest/test_streamNotify.html
+++ b/modules/plugin/test/mochitest/test_streamNotify.html
@@ -46,10 +46,41 @@
                       testDone();
                     }), "streamTest GET bad DNS");
 
     ok(p.streamTest("http://localhost:-8/", false, null,
                     function(r, t) {
                       is(r, 1, "Shouldn't load invalid URI");
                       testDone();
                     }), "streamTest GET invalid URL");
+
+    ok(p.streamTest("javascript:'Hello';", false, null,
+                    function(r, t) {
+                      is(r, 0, "GET javascript: URI");
+                      is(t, "Hello", "GET javascript: URI correct");
+                      testDone();
+                    }), "streamTest GET javascript: URI");
+
+/*
+ * XXX/cjones: disabled for now because it appears to be hard to make
+ * mochitest ignore the malformed javascript
+
+    ok(!p.streamTest("javascript:syntax##$&*@error-*", false, null,
+                     function(r, t) {
+                       is(r, 1, "Shouldn't load invalid javascript: URI");
+                       testDone();
+                     }), "streamTest GET bad javascript: URI");
+*/
+
+    ok(p.streamTest("data:text/plain,World", false, null,
+                    function(r, t) {
+                      is(r, 0, "GET data: URI");
+                      is(t, "World", "GET data: URI correct");
+                      testDone();
+                    }), "streamTest GET data: URI");
+
+    ok(!p.streamTest("data:malformed?", false, null,
+                     function(r, t) {
+                       is(r, 1, "Shouldn't load invalid data: URI");
+                       testDone();
+                     }), "streamTest GET bad data: URI");
   }
   </script>