Reviewers: felix8a,

Description:
Since ES5/3 is deprecated, we no longer want to consider it OK for
SES to be unsafe on a browser we're testing on since there is no
fallback.

Therefore, add one test, cajajs-success, which loads Caja with
maxAcceptableSeverity set to NO_KNOWN_EXPLOIT_SPEC_VIOLATION instead of
NEW_SYMPTOM.

All other tests are left as-is, so that it is still possible to
troubleshoot specific problems even with SES failure.

Please review this at https://codereview.appspot.com/65780043/

Affected files (+52, -2 lines):
  M     tests/com/google/caja/plugin/browser-tests.json
  A     tests/com/google/caja/plugin/test-success.js
  M     tests/com/google/caja/ses/test-ses-loading.html


Index: tests/com/google/caja/plugin/browser-tests.json
===================================================================
--- tests/com/google/caja/plugin/browser-tests.json     (revision 5667)
+++ tests/com/google/caja/plugin/browser-tests.json     (working copy)
@@ -10,6 +10,7 @@
     { "driver": "meta-test.js" }
   ]},
   { "label": "cajajs", "tests": [
+    { "driver": "test-success.js" },
     {
       "driver": "test-cajajs-invocation.js",
       "comment": "Including non-minified execution in automated tests",
Index: tests/com/google/caja/plugin/test-success.js
===================================================================
--- tests/com/google/caja/plugin/test-success.js        (revision 0)
+++ tests/com/google/caja/plugin/test-success.js        (working copy)
@@ -0,0 +1,48 @@
+// Copyright (C) 2014 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/**
+ * @fileoverview Test that non-modified startup is successful (SES is happy).
+ *
+ * @author [email protected]
+ * @requires caja, jsunitRegister, jsunitPass, jsunitRun, readyToTest, createDiv
+ */
+
+(function () {
+  jsunitRegister('testSuccess', function testSuccess() {
+    caja.initialize(
+        {
+          cajaServer: '/caja',
+          debug: true,
+          maxAcceptableSeverity: 'NO_KNOWN_EXPLOIT_SPEC_VIOLATION'
+        },
+        function() {},
+        function(err) {
+          jsunitFail('testSuccess', err);
+        });
+
+    caja.load(createDiv(), caja.policy.net.ALL, function(frame) {
+      frame.code(
+          location.protocol + '//' + location.host + '/',
+          'text/html',
+          '')
+          .run(function(result) {
+              jsunitPass('testSuccess');
+           });
+    });
+  });
+
+  readyToTest();
+  jsunitRun();
+})();
Index: tests/com/google/caja/ses/test-ses-loading.html
===================================================================
--- tests/com/google/caja/ses/test-ses-loading.html     (revision 5667)
+++ tests/com/google/caja/ses/test-ses-loading.html     (working copy)
@@ -6,8 +6,9 @@
   <body class="readytotest">
     <p>This file tests loading the standalone SES,
without the rest of Caja, in a browser. It does not test that SES loads
-        successfully (as it may not be supported), but only that it reports
- success or failure (as opposed to having a syntax error or such).</p>
+        successfully (as it may not be supported and we deal with that
+ elsewhere), but only that it reports success or failure (as opposed to
+        having a syntax error or such).</p>

     <p>If you are seeking to troubleshoot SES, then you probably want
         <a href="../../../../../src/com/google/caja/ses/explicit.html">


--

--- You received this message because you are subscribed to the Google Groups "Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to