2010-10-28 Adrienne Walker <enne@google.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Oct 2010 19:05:41 +0000 (19:05 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Oct 2010 19:05:41 +0000 (19:05 +0000)
        Reviewed by Kenneth Russell.

        Add shouldBeDefined function to js-test-pre.js and update
        context-attributes-etc test to use it.
        https://bugs.webkit.org/show_bug.cgi?id=47853

        * fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias-expected.txt:
        * fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias.html:
        * fast/dom/Window/window-property-descriptors-expected.txt:
        * fast/js/resources/js-test-pre.js:
        (shouldBeDefined):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70794 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias-expected.txt
LayoutTests/fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias.html
LayoutTests/fast/dom/Window/window-property-descriptors-expected.txt
LayoutTests/fast/js/resources/js-test-pre.js

index b8dbc45..2e19864 100644 (file)
@@ -1,3 +1,17 @@
+2010-10-28  Adrienne Walker  <enne@google.com>
+
+        Reviewed by Kenneth Russell.
+
+        Add shouldBeDefined function to js-test-pre.js and update
+        context-attributes-etc test to use it.
+        https://bugs.webkit.org/show_bug.cgi?id=47853
+
+        * fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias-expected.txt:
+        * fast/canvas/webgl/context-attributes-alpha-depth-stencil-antialias.html:
+        * fast/dom/Window/window-property-descriptors-expected.txt:
+        * fast/js/resources/js-test-pre.js:
+        (shouldBeDefined):
+
 2010-10-28  Chris Fleizach  <cfleizach@apple.com>
 
         Reviewed by Adele Peterson.
index dd1885e..1e24348 100644 (file)
@@ -6,74 +6,74 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 Testing alpha = true
 PASS webGL = getWebGL('alphaOn', { alpha: true, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0) is non-null.
 PASS contextAttribs = webGL.getContextAttributes() is non-null.
-PASS contextAttribs.alpha is non-null.
-PASS contextAttribs.depth is non-null.
-PASS contextAttribs.stencil is non-null.
-PASS contextAttribs.antialias is non-null.
-PASS contextAttribs.premultipliedAlpha is non-null.
+PASS contextAttribs.alpha is defined.
+PASS contextAttribs.depth is defined.
+PASS contextAttribs.stencil is defined.
+PASS contextAttribs.antialias is defined.
+PASS contextAttribs.premultipliedAlpha is defined.
 PASS pixel is correctColor
 Testing alpha = false
 PASS webGL = getWebGL('alphaOff', { alpha: false, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0) is non-null.
 PASS contextAttribs = webGL.getContextAttributes() is non-null.
-PASS contextAttribs.alpha is non-null.
-PASS contextAttribs.depth is non-null.
-PASS contextAttribs.stencil is non-null.
-PASS contextAttribs.antialias is non-null.
-PASS contextAttribs.premultipliedAlpha is non-null.
+PASS contextAttribs.alpha is defined.
+PASS contextAttribs.depth is defined.
+PASS contextAttribs.stencil is defined.
+PASS contextAttribs.antialias is defined.
+PASS contextAttribs.premultipliedAlpha is defined.
 PASS pixel is correctColor
 Testing depth = true
 PASS webGL = getWebGL('depthOn', { stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0) is non-null.
 PASS contextAttribs = webGL.getContextAttributes() is non-null.
-PASS contextAttribs.depth is non-null.
-PASS contextAttribs.alpha is non-null.
-PASS contextAttribs.stencil is non-null.
-PASS contextAttribs.antialias is non-null.
-PASS contextAttribs.premultipliedAlpha is non-null.
+PASS contextAttribs.depth is defined.
+PASS contextAttribs.alpha is defined.
+PASS contextAttribs.stencil is defined.
+PASS contextAttribs.antialias is defined.
+PASS contextAttribs.premultipliedAlpha is defined.
 PASS pixel is correctColor
 Testing depth = false
 PASS webGL = getWebGL('depthOff', { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0) is non-null.
 PASS contextAttribs = webGL.getContextAttributes() is non-null.
-PASS contextAttribs.depth is non-null.
-PASS contextAttribs.alpha is non-null.
-PASS contextAttribs.stencil is non-null.
-PASS contextAttribs.antialias is non-null.
-PASS contextAttribs.premultipliedAlpha is non-null.
+PASS contextAttribs.depth is defined.
+PASS contextAttribs.alpha is defined.
+PASS contextAttribs.stencil is defined.
+PASS contextAttribs.antialias is defined.
+PASS contextAttribs.premultipliedAlpha is defined.
 PASS pixel is correctColor
 Testing stencil = true
 PASS webGL = getWebGL('stencilOn', { depth: false, stencil: true, antialias: false }, [ 0, 0, 0, 1 ], 1, 0) is non-null.
 PASS contextAttribs = webGL.getContextAttributes() is non-null.
-PASS contextAttribs.depth is non-null.
-PASS contextAttribs.alpha is non-null.
-PASS contextAttribs.stencil is non-null.
-PASS contextAttribs.antialias is non-null.
-PASS contextAttribs.premultipliedAlpha is non-null.
+PASS contextAttribs.depth is defined.
+PASS contextAttribs.alpha is defined.
+PASS contextAttribs.stencil is defined.
+PASS contextAttribs.antialias is defined.
+PASS contextAttribs.premultipliedAlpha is defined.
 PASS pixel is correctColor
 Testing stencil = false
 PASS webGL = getWebGL('stencilOff', { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0) is non-null.
 PASS contextAttribs = webGL.getContextAttributes() is non-null.
-PASS contextAttribs.depth is non-null.
-PASS contextAttribs.alpha is non-null.
-PASS contextAttribs.stencil is non-null.
-PASS contextAttribs.antialias is non-null.
-PASS contextAttribs.premultipliedAlpha is non-null.
+PASS contextAttribs.depth is defined.
+PASS contextAttribs.alpha is defined.
+PASS contextAttribs.stencil is defined.
+PASS contextAttribs.antialias is defined.
+PASS contextAttribs.premultipliedAlpha is defined.
 PASS pixel is correctColor
 Testing antialias = true
 PASS webGL = getWebGL('antialiasOn', { depth: false, stencil: false, alpha: false, antialias: true }, [ 0, 0, 0, 1 ], 1, 0) is non-null.
 PASS contextAttribs = webGL.getContextAttributes() is non-null.
-PASS contextAttribs.depth is non-null.
-PASS contextAttribs.alpha is non-null.
-PASS contextAttribs.stencil is non-null.
-PASS contextAttribs.antialias is non-null.
-PASS contextAttribs.premultipliedAlpha is non-null.
+PASS contextAttribs.depth is defined.
+PASS contextAttribs.alpha is defined.
+PASS contextAttribs.stencil is defined.
+PASS contextAttribs.antialias is defined.
+PASS contextAttribs.premultipliedAlpha is defined.
 PASS pixel[0] != 255 && pixel[0] != 0 is contextAttribs.antialias
 Testing antialias = false
 PASS webGL = getWebGL('antialiasOff', { depth: false, stencil: false, alpha: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0) is non-null.
 PASS contextAttribs = webGL.getContextAttributes() is non-null.
-PASS contextAttribs.depth is non-null.
-PASS contextAttribs.alpha is non-null.
-PASS contextAttribs.stencil is non-null.
-PASS contextAttribs.antialias is non-null.
-PASS contextAttribs.premultipliedAlpha is non-null.
+PASS contextAttribs.depth is defined.
+PASS contextAttribs.alpha is defined.
+PASS contextAttribs.stencil is defined.
+PASS contextAttribs.antialias is defined.
+PASS contextAttribs.premultipliedAlpha is defined.
 PASS pixel[0] != 255 && pixel[0] != 0 is contextAttribs.antialias
 PASS successfullyParsed is true
 
index cf8b181..1ff55cb 100644 (file)
@@ -140,11 +140,11 @@ function testAlpha(alpha)
     else
         shouldBeNonNull("webGL = getWebGL('alphaOff', { alpha: false, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0)");
     shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
-    shouldBeNonNull("contextAttribs.alpha");
-    shouldBeNonNull("contextAttribs.depth");
-    shouldBeNonNull("contextAttribs.stencil");
-    shouldBeNonNull("contextAttribs.antialias");
-    shouldBeNonNull("contextAttribs.premultipliedAlpha");
+    shouldBeDefined("contextAttribs.alpha");
+    shouldBeDefined("contextAttribs.depth");
+    shouldBeDefined("contextAttribs.stencil");
+    shouldBeDefined("contextAttribs.antialias");
+    shouldBeDefined("contextAttribs.premultipliedAlpha");
 
     var buf = new Uint8Array(1 * 1 * 4);
     webGL.readPixels(0, 0, 1, 1, webGL.RGBA, webGL.UNSIGNED_BYTE, buf);
@@ -164,11 +164,11 @@ function testDepth(depth)
     else
         shouldBeNonNull("webGL = getWebGL('depthOff', { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
     shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
-    shouldBeNonNull("contextAttribs.depth");
-    shouldBeNonNull("contextAttribs.alpha");
-    shouldBeNonNull("contextAttribs.stencil");
-    shouldBeNonNull("contextAttribs.antialias");
-    shouldBeNonNull("contextAttribs.premultipliedAlpha");
+    shouldBeDefined("contextAttribs.depth");
+    shouldBeDefined("contextAttribs.alpha");
+    shouldBeDefined("contextAttribs.stencil");
+    shouldBeDefined("contextAttribs.antialias");
+    shouldBeDefined("contextAttribs.premultipliedAlpha");
 
     webGL.depthFunc(webGL.NEVER);
 
@@ -204,11 +204,11 @@ function testStencil(stencil)
     else
         shouldBeNonNull("webGL = getWebGL('stencilOff', { depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
     shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
-    shouldBeNonNull("contextAttribs.depth");
-    shouldBeNonNull("contextAttribs.alpha");
-    shouldBeNonNull("contextAttribs.stencil");
-    shouldBeNonNull("contextAttribs.antialias");
-    shouldBeNonNull("contextAttribs.premultipliedAlpha");
+    shouldBeDefined("contextAttribs.depth");
+    shouldBeDefined("contextAttribs.alpha");
+    shouldBeDefined("contextAttribs.stencil");
+    shouldBeDefined("contextAttribs.antialias");
+    shouldBeDefined("contextAttribs.premultipliedAlpha");
 
     webGL.depthFunc(webGL.ALWAYS);
 
@@ -247,11 +247,11 @@ function testAntialias(antialias)
     else
         shouldBeNonNull("webGL = getWebGL('antialiasOff', { depth: false, stencil: false, alpha: false, antialias: false }, [ 0, 0, 0, 1 ], 1, 0)");
     shouldBeNonNull("contextAttribs = webGL.getContextAttributes()");
-    shouldBeNonNull("contextAttribs.depth");
-    shouldBeNonNull("contextAttribs.alpha");
-    shouldBeNonNull("contextAttribs.stencil");
-    shouldBeNonNull("contextAttribs.antialias");
-    shouldBeNonNull("contextAttribs.premultipliedAlpha");
+    shouldBeDefined("contextAttribs.depth");
+    shouldBeDefined("contextAttribs.alpha");
+    shouldBeDefined("contextAttribs.stencil");
+    shouldBeDefined("contextAttribs.antialias");
+    shouldBeDefined("contextAttribs.premultipliedAlpha");
 
     var vertices = new Float32Array([
          1.0, 1.0, 0.0,
index bbbf4f7..b9de586 100644 (file)
@@ -460,6 +460,7 @@ PASS typeof Object.getOwnPropertyDescriptor(window, 'scrollbars') is 'object'
 PASS typeof Object.getOwnPropertyDescriptor(window, 'self') is 'object'
 PASS typeof Object.getOwnPropertyDescriptor(window, 'sessionStorage') is 'object'
 PASS typeof Object.getOwnPropertyDescriptor(window, 'shouldBe') is 'object'
+PASS typeof Object.getOwnPropertyDescriptor(window, 'shouldBeDefined') is 'object'
 PASS typeof Object.getOwnPropertyDescriptor(window, 'shouldBeEqualToString') is 'object'
 PASS typeof Object.getOwnPropertyDescriptor(window, 'shouldBeFalse') is 'object'
 PASS typeof Object.getOwnPropertyDescriptor(window, 'shouldBeGreaterThanOrEqual') is 'object'
index 3536a89..c14d513 100644 (file)
@@ -219,6 +219,24 @@ function shouldBeUndefined(_a)
     testFailed(_a + " should be undefined. Was " + _av);
 }
 
+function shouldBeDefined(_a)
+{
+  var exception;
+  var _av;
+  try {
+     _av = eval(_a);
+  } catch (e) {
+     exception = e;
+  }
+
+  if (exception)
+    testFailed(_a + " should be defined. Threw exception " + exception);
+  else if (_av !== undefined)
+    testPassed(_a + " is defined.");
+  else
+    testFailed(_a + " should be defined. Was " + _av);
+}
+
 function shouldBeGreaterThanOrEqual(_a, _b) {
     if (typeof _a != "string" || typeof _b != "string")
         debug("WARN: shouldBeGreaterThanOrEqual expects string arguments");