Bug 1085369 - Move other long-running tests to separate test files. r=keeler, a=test-only
authorTim Taubert <ttaubert@mozilla.com>
Tue, 06 Jan 2015 12:03:22 +0100
changeset 243012 d0660bbc79a1
parent 243011 afab84ec4e34
child 243013 957b4a673416
push id4363
push userryanvm@gmail.com
push date2015-01-23 21:41 +0000
treeherdermozilla-beta@957b4a673416 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskeeler, test-only
bugs1085369
milestone36.0
Bug 1085369 - Move other long-running tests to separate test files. r=keeler, a=test-only
dom/crypto/test/mochitest.ini
dom/crypto/test/test_WebCrypto.html
dom/crypto/test/test_WebCrypto_Normalize.html
dom/crypto/test/test_WebCrypto_Reject_Generating_Keys_Without_Usages.html
--- a/dom/crypto/test/mochitest.ini
+++ b/dom/crypto/test/mochitest.ini
@@ -6,11 +6,13 @@ support-files =
   test-vectors.js
   test_WebCrypto.css
   util.js
 
 [test_WebCrypto.html]
 [test_WebCrypto_DH.html]
 [test_WebCrypto_ECDH.html]
 [test_WebCrypto_JWK.html]
+[test_WebCrypto_Normalize.html]
 [test_WebCrypto_PBKDF2.html]
+[test_WebCrypto_Reject_Generating_Keys_Without_Usages.html]
 [test_WebCrypto_RSA_OAEP.html]
 [test_WebCrypto_Wrap_Unwrap.html]
--- a/dom/crypto/test/test_WebCrypto.html
+++ b/dom/crypto/test/test_WebCrypto.html
@@ -965,51 +965,16 @@ TestArray.addTest(
 
     crypto.subtle.importKey("pkcs8", tv.broken_pkcs8.dh, alg, false, ["decrypt"])
       .then(error(that), complete(that));
   }
 );
 
 // -----------------------------------------------------------------------------
 TestArray.addTest(
-  "Test that we properly normalize algorithm names",
-  function() {
-    var that = this;
-    var alg = { name: "hmac", hash: {name: "sHa-256"} };
-
-    function doGenerateAesKey() {
-      var alg = { name: "AES-gcm", length: 192 };
-      return crypto.subtle.generateKey(alg, false, ["encrypt"]);
-    }
-
-    function doGenerateRsaOaepKey() {
-      var alg = {
-        name: "rsa-OAEP",
-        hash: "sha-1",
-        modulusLength: 2048,
-        publicExponent: new Uint8Array([0x01, 0x00, 0x01])
-      };
-      return crypto.subtle.generateKey(alg, false, ["encrypt", "decrypt"]);
-    }
-
-    function doGenerateRsaSsaPkcs1Key() {
-      var alg = { name: "RSASSA-pkcs1-V1_5", hash: "SHA-1" };
-      return crypto.subtle.importKey("pkcs8", tv.pkcs8, alg, true, ["sign"]);
-    }
-
-    crypto.subtle.generateKey(alg, false, ["sign"])
-      .then(doGenerateAesKey)
-      .then(doGenerateRsaOaepKey)
-      .then(doGenerateRsaSsaPkcs1Key)
-      .then(complete(that), error(that));
-  }
-);
-
-// -----------------------------------------------------------------------------
-TestArray.addTest(
   "Test that we check keys before using them for encryption/signatures",
   function() {
     var that = this;
 
     function doCheckRSASSA() {
       var alg = {name: "HMAC", hash: {name: "SHA-1"}};
 
       function doSign(x) {
@@ -1017,42 +982,16 @@ TestArray.addTest(
       }
 
       return crypto.subtle.generateKey(alg, false, ["sign"]).then(doSign);
     }
 
     doCheckRSASSA().then(error(that), complete(that));
   }
 );
-
-// -----------------------------------------------------------------------------
-TestArray.addTest(
-  "Test that we reject generating keys without any usage",
-  function() {
-    var that = this;
-    var alg = {
-      name: "RSA-OAEP",
-      hash: "SHA-256",
-      modulusLength: 2048,
-      publicExponent: new Uint8Array([0x01, 0x00, 0x01])
-    };
-
-    function generateKey(usages) {
-      return crypto.subtle.generateKey(alg, false, usages);
-    }
-
-    generateKey(["encrypt", "decrypt"]).then(function () {
-      return generateKey(["encrypt"]);
-    }).then(function () {
-      return generateKey(["decrypt"]);
-    }).then(function () {
-      return generateKey(["sign"])
-    }, error(that)).then(error(that), complete(that));
-  }
-);
 /*]]>*/</script>
 </head>
 
 <body>
 
 <div id="content">
 	<div id="head">
 		<b>Web</b>Crypto<br>
new file mode 100644
--- /dev/null
+++ b/dom/crypto/test/test_WebCrypto_Normalize.html
@@ -0,0 +1,93 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+<title>WebCrypto Test Suite</title>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+<link rel="stylesheet" href="./test_WebCrypto.css"/>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+
+<!-- Utilities for manipulating ABVs -->
+<script src="util.js"></script>
+
+<!-- A simple wrapper around IndexedDB -->
+<script src="simpledb.js"></script>
+
+<!-- Test vectors drawn from the literature -->
+<script src="./test-vectors.js"></script>
+
+<!-- General testing framework -->
+<script src="./test-array.js"></script>
+
+<script>/*<![CDATA[*/
+"use strict";
+
+TestArray.addTest(
+  "Test that we properly normalize algorithm names",
+  function() {
+    var that = this;
+    var alg = { name: "hmac", hash: {name: "sHa-256"} };
+
+    function doGenerateAesKey() {
+      var alg = { name: "AES-gcm", length: 192 };
+      return crypto.subtle.generateKey(alg, false, ["encrypt"]);
+    }
+
+    function doGenerateRsaOaepKey() {
+      var alg = {
+        name: "rsa-OAEP",
+        hash: "sha-1",
+        modulusLength: 2048,
+        publicExponent: new Uint8Array([0x01, 0x00, 0x01])
+      };
+      return crypto.subtle.generateKey(alg, false, ["encrypt", "decrypt"]);
+    }
+
+    function doGenerateRsaSsaPkcs1Key() {
+      var alg = { name: "RSASSA-pkcs1-V1_5", hash: "SHA-1" };
+      return crypto.subtle.importKey("pkcs8", tv.pkcs8, alg, true, ["sign"]);
+    }
+
+    crypto.subtle.generateKey(alg, false, ["sign"])
+      .then(doGenerateAesKey)
+      .then(doGenerateRsaOaepKey)
+      .then(doGenerateRsaSsaPkcs1Key)
+      .then(complete(that), error(that));
+  }
+);
+
+/*]]>*/</script>
+</head>
+
+<body>
+
+<div id="content">
+	<div id="head">
+		<b>Web</b>Crypto<br>
+	</div>
+
+    <div id="start" onclick="start();">RUN ALL</div>
+
+    <div id="resultDiv" class="content">
+    Summary:
+    <span class="pass"><span id="passN">0</span> passed, </span>
+    <span class="fail"><span id="failN">0</span> failed, </span>
+    <span class="pending"><span id="pendingN">0</span> pending.</span>
+    <br/>
+    <br/>
+
+    <table id="results">
+        <tr>
+            <th>Test</th>
+            <th>Result</th>
+            <th>Time</th>
+        </tr>
+    </table>
+
+    </div>
+
+    <div id="foot"></div>
+</div>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/crypto/test/test_WebCrypto_Reject_Generating_Keys_Without_Usages.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+<title>WebCrypto Test Suite</title>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+<link rel="stylesheet" href="./test_WebCrypto.css"/>
+<script src="/tests/SimpleTest/SimpleTest.js"></script>
+
+<!-- Utilities for manipulating ABVs -->
+<script src="util.js"></script>
+
+<!-- A simple wrapper around IndexedDB -->
+<script src="simpledb.js"></script>
+
+<!-- Test vectors drawn from the literature -->
+<script src="./test-vectors.js"></script>
+
+<!-- General testing framework -->
+<script src="./test-array.js"></script>
+
+<script>/*<![CDATA[*/
+"use strict";
+
+TestArray.addTest(
+  "Test that we reject generating keys without any usage",
+  function() {
+    var that = this;
+    var alg = {
+      name: "RSA-OAEP",
+      hash: "SHA-256",
+      modulusLength: 2048,
+      publicExponent: new Uint8Array([0x01, 0x00, 0x01])
+    };
+
+    function generateKey(usages) {
+      return crypto.subtle.generateKey(alg, false, usages);
+    }
+
+    generateKey(["encrypt", "decrypt"]).then(function () {
+      return generateKey(["encrypt"]);
+    }).then(function () {
+      return generateKey(["decrypt"]);
+    }).then(function () {
+      return generateKey(["sign"])
+    }, error(that)).then(error(that), complete(that));
+  }
+);
+/*]]>*/</script>
+</head>
+
+<body>
+
+<div id="content">
+	<div id="head">
+		<b>Web</b>Crypto<br>
+	</div>
+
+    <div id="start" onclick="start();">RUN ALL</div>
+
+    <div id="resultDiv" class="content">
+    Summary:
+    <span class="pass"><span id="passN">0</span> passed, </span>
+    <span class="fail"><span id="failN">0</span> failed, </span>
+    <span class="pending"><span id="pendingN">0</span> pending.</span>
+    <br/>
+    <br/>
+
+    <table id="results">
+        <tr>
+            <th>Test</th>
+            <th>Result</th>
+            <th>Time</th>
+        </tr>
+    </table>
+
+    </div>
+
+    <div id="foot"></div>
+</div>
+
+</body>
+</html>