Reviewers: ihab.awad,

Description:
Fixes <https://code.google.com/p/google-caja/issues/detail?id=1948>.
All test failures were due to harmless behavior changes in Firefox
that broke assumptions made by the tests.

See <https://code.google.com/p/google-caja/issues/detail?id=1947> for
information on the Firefox changes (function instances no longer have
the caller and arguments properties).

Additionally, increase the timeout for guest-scan test. It takes a
very long time when running on Firefox _under webdriver_. Would like
to fix it, but for now, accept it.

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

Affected files (+15, -9 lines):
  M     tests/com/google/caja/plugin/MainBrowserTest.java
  M     tests/com/google/caja/plugin/test-scan-guest.js
  M     tests/com/google/caja/plugin/test-taming-tamed-guest.html


Index: tests/com/google/caja/plugin/MainBrowserTest.java
===================================================================
--- tests/com/google/caja/plugin/MainBrowserTest.java   (revision 5705)
+++ tests/com/google/caja/plugin/MainBrowserTest.java   (working copy)
@@ -25,7 +25,8 @@
 @CatalogRunner.CatalogName("browser-tests.json")
 public class MainBrowserTest extends CatalogTestCase {
   /**
-   * Special case kludge for scan test which takes a long time under ES5/3.
+ * Special case kludge for scan test, which currently takes a very long time
+   * under the combination of webdriver+firefox only.
    *
    * TODO(kpreid): Either extend the catalog with timeout data or add a way
* for the scanner to communicate it's making progress (which must be count-up
@@ -34,7 +35,7 @@
   @Override
   protected int waitForCompletionTimeout() {
     if (entry.getLabel().startsWith("guest-scan-")) {
-      return 100000;     // msec
+      return 800 * 1000;  // milliseconds
     } else {
       return super.waitForCompletionTimeout();
     }
Index: tests/com/google/caja/plugin/test-scan-guest.js
===================================================================
--- tests/com/google/caja/plugin/test-scan-guest.js     (revision 5705)
+++ tests/com/google/caja/plugin/test-scan-guest.js     (working copy)
@@ -552,12 +552,10 @@
     argsByAnyFrame('Function.prototype.toString',
         // TODO test invocation on Function.prototype itself
         G.tuple(G.value(THIS), G.tuple()));
-    [function guestFn(){}, window.setTimeout].forEach(function(f) {
-      expectedAlwaysThrow.setByIdentity(getGetter(f, 'arguments'), true);
-      expectedAlwaysThrow.setByIdentity(getGetter(f, 'caller'), true);
-    });
-
-
+
+    argsByIdentity(cajaVM['[[ThrowTypeError]]'], genAllCall());
+    expectedAlwaysThrow.setByIdentity(cajaVM['[[ThrowTypeError]]'], true);
+
     argsByIdentity(Number, genAllCall(genSmallInteger));
     argsByAnyFrame('Number.prototype.toExponential',
         genMethod(genSmallInteger));
Index: tests/com/google/caja/plugin/test-taming-tamed-guest.html
===================================================================
--- tests/com/google/caja/plugin/test-taming-tamed-guest.html (revision 5705)
+++ tests/com/google/caja/plugin/test-taming-tamed-guest.html   (working copy)
@@ -138,7 +138,14 @@
       Object: getTamingFrameObject('Object'),
       Function: getTamingFrameObject('cajaVM.sharedImports.Function'),
       Array: getTamingFrameObject('Array'),
-      Error: getTamingFrameObject('Error')
+      Error: getTamingFrameObject('Error'),
+ // This object just to exercise this test's self-test, because the current + // state of affairs is that on Firefox there are no accessors in the above
+      // primordials.
+      _selfTestDummy: Object.freeze(Object.create(null, { accessorProp: {
+          get: Object.freeze(function() { return 10; }),
+          set: Object.freeze(function(value) {})
+      }}))
     };

     // Sanity checks to ensure our test has run


--

--- 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/d/optout.

Reply via email to