diff options
53 files changed, 317 insertions, 187 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-hit-regions-fill-rule-test-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/canvas-hit-regions-fill-rule-test-expected.txt index 587c8e4..461e5f0 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-hit-regions-fill-rule-test-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-hit-regions-fill-rule-test-expected.txt @@ -16,7 +16,7 @@ PASS clickCanvas(99, 98) is 'nonzero' PASS clickCanvas(21, 21) is 'nonzero' PASS clickCanvas(50, 50) is 'nonzero' -PASS context.addHitRegion({id : "nonzero", fillRule : null }); threw exception TypeError: Failed to execute 'addHitRegion' on 'CanvasRenderingContext2D': member fillRule ('null') is not a valid enum value.. +PASS context.addHitRegion({id : "nonzero", fillRule : null }); threw exception TypeError: Failed to execute 'addHitRegion' on 'CanvasRenderingContext2D': The provided value 'null' is not a valid enum value.. fillRule = undefined, falls back to default (nonzero): PASS clickCanvas(1, 1) is 'nonzero' PASS clickCanvas(99, 98) is 'nonzero' diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-isPointInPath-winding-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/canvas-isPointInPath-winding-expected.txt index 0288bec..f04a4c1 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-isPointInPath-winding-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-isPointInPath-winding-expected.txt @@ -26,24 +26,24 @@ Testing evenodd isPointInPath with Path object PASS ctx.isPointInPath(path, 50, 50, 'evenodd') is false Testing invalid enumeration isPointInPath (w/ and w/o Path object -PASS ctx.isPointInPath(path, 50, 50, 'gazonk') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 4 ('gazonk') is not a valid enum value.. -PASS ctx.isPointInPath(50, 50, 'gazonk') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 3 ('gazonk') is not a valid enum value.. +PASS ctx.isPointInPath(path, 50, 50, 'gazonk') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': The provided value 'gazonk' is not a valid enum value.. +PASS ctx.isPointInPath(50, 50, 'gazonk') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': The provided value 'gazonk' is not a valid enum value.. Testing invalid type isPointInPath with Path object -PASS ctx.isPointInPath(null, 50, 50) threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 3 ('50') is not a valid enum value.. +PASS ctx.isPointInPath(null, 50, 50) threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': The provided value '50' is not a valid enum value.. PASS ctx.isPointInPath(null, 50, 50, 'nonzero') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.isPointInPath(null, 50, 50, 'evenodd') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.isPointInPath(null, 50, 50, null) threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. -PASS ctx.isPointInPath(path, 50, 50, null) threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 4 ('null') is not a valid enum value.. -PASS ctx.isPointInPath(undefined, 50, 50) threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 3 ('50') is not a valid enum value.. +PASS ctx.isPointInPath(path, 50, 50, null) threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': The provided value 'null' is not a valid enum value.. +PASS ctx.isPointInPath(undefined, 50, 50) threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': The provided value '50' is not a valid enum value.. PASS ctx.isPointInPath(undefined, 50, 50, 'nonzero') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.isPointInPath(undefined, 50, 50, 'evenodd') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.isPointInPath(undefined, 50, 50, undefined) threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. -PASS ctx.isPointInPath(path, 50, 50, undefined) threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 4 ('undefined') is not a valid enum value.. -PASS ctx.isPointInPath([], 50, 50) threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 3 ('50') is not a valid enum value.. +PASS ctx.isPointInPath(path, 50, 50, undefined) threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': The provided value 'undefined' is not a valid enum value.. +PASS ctx.isPointInPath([], 50, 50) threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': The provided value '50' is not a valid enum value.. PASS ctx.isPointInPath([], 50, 50, 'nonzero') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.isPointInPath([], 50, 50, 'evenodd') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. -PASS ctx.isPointInPath({}, 50, 50) threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 3 ('50') is not a valid enum value.. +PASS ctx.isPointInPath({}, 50, 50) threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': The provided value '50' is not a valid enum value.. PASS ctx.isPointInPath({}, 50, 50, 'nonzero') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.isPointInPath({}, 50, 50, 'evenodd') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-path-context-clip-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/canvas-path-context-clip-expected.txt index 4aeb651..191f460 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-path-context-clip-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-path-context-clip-expected.txt @@ -39,21 +39,21 @@ PASS pixelDataAtPoint()[1] is within 5 of 0 PASS pixelDataAtPoint()[2] is within 5 of 0 PASS pixelDataAtPoint()[3] is within 5 of 255 -PASS ctx.clip(null) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 ('null') is not a valid enum value.. +PASS ctx.clip(null) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': The provided value 'null' is not a valid enum value.. PASS ctx.clip(null, null) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.clip(null, 'nonzero') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. -PASS ctx.clip(path, null) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 2 ('null') is not a valid enum value.. +PASS ctx.clip(path, null) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': The provided value 'null' is not a valid enum value.. PASS ctx.clip([], 'nonzero') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.clip({}, 'nonzero') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.clip(null, 'evenodd') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.clip([], 'evenodd') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.clip({}, 'evenodd') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. -PASS ctx.clip('gazonk') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 ('gazonk') is not a valid enum value.. -PASS ctx.clip(path, 'gazonk') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 2 ('gazonk') is not a valid enum value.. -PASS ctx.clip(undefined) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 ('undefined') is not a valid enum value.. +PASS ctx.clip('gazonk') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': The provided value 'gazonk' is not a valid enum value.. +PASS ctx.clip(path, 'gazonk') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': The provided value 'gazonk' is not a valid enum value.. +PASS ctx.clip(undefined) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': The provided value 'undefined' is not a valid enum value.. PASS ctx.clip(undefined, undefined) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.clip(undefined, 'nonzero') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. -PASS ctx.clip(path, undefined) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 2 ('undefined') is not a valid enum value.. +PASS ctx.clip(path, undefined) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': The provided value 'undefined' is not a valid enum value.. PASS successfullyParsed is true TEST COMPLETE diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-path-context-fill-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/canvas-path-context-fill-expected.txt index ca99174..86bd08e 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-path-context-fill-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-path-context-fill-expected.txt @@ -39,21 +39,21 @@ PASS pixelDataAtPoint()[1] is within 5 of 0 PASS pixelDataAtPoint()[2] is within 5 of 0 PASS pixelDataAtPoint()[3] is within 5 of 255 -PASS ctx.fill(null) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 ('null') is not a valid enum value.. +PASS ctx.fill(null) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': The provided value 'null' is not a valid enum value.. PASS ctx.fill(null, null) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.fill(null, 'nonzero') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. -PASS ctx.fill(path, null) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 2 ('null') is not a valid enum value.. +PASS ctx.fill(path, null) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': The provided value 'null' is not a valid enum value.. PASS ctx.fill([], 'nonzero') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.fill({}, 'nonzero') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.fill(null, 'evenodd') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.fill([], 'evenodd') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.fill({}, 'evenodd') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. -PASS ctx.fill('gazonk') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 ('gazonk') is not a valid enum value.. -PASS ctx.fill(path, 'gazonk') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 2 ('gazonk') is not a valid enum value.. -PASS ctx.fill(undefined) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 ('undefined') is not a valid enum value.. +PASS ctx.fill('gazonk') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': The provided value 'gazonk' is not a valid enum value.. +PASS ctx.fill(path, 'gazonk') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': The provided value 'gazonk' is not a valid enum value.. +PASS ctx.fill(undefined) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': The provided value 'undefined' is not a valid enum value.. PASS ctx.fill(undefined, undefined) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.fill(undefined, path) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. -PASS ctx.fill(path, undefined) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 2 ('undefined') is not a valid enum value.. +PASS ctx.fill(path, undefined) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': The provided value 'undefined' is not a valid enum value.. PASS successfullyParsed is true TEST COMPLETE diff --git a/third_party/WebKit/LayoutTests/fast/canvas/winding-enumeration-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/winding-enumeration-expected.txt index 9f892ab..d32689b 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/winding-enumeration-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/canvas/winding-enumeration-expected.txt @@ -1,12 +1,12 @@ PASS context.fill() did not throw exception. PASS context.fill('nonzero') did not throw exception. -PASS context.fill('randomstring') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 ('randomstring') is not a valid enum value.. +PASS context.fill('randomstring') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': The provided value 'randomstring' is not a valid enum value.. PASS context.clip() did not throw exception. PASS context.clip('nonzero') did not throw exception. -PASS context.clip('randomstring') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 ('randomstring') is not a valid enum value.. +PASS context.clip('randomstring') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': The provided value 'randomstring' is not a valid enum value.. PASS context.isPointInPath(0, 0) did not throw exception. PASS context.isPointInPath(0, 0, 'nonzero') did not throw exception. -PASS context.isPointInPath(0, 0, 'randomstring') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': parameter 3 ('randomstring') is not a valid enum value.. +PASS context.isPointInPath(0, 0, 'randomstring') threw exception TypeError: Failed to execute 'isPointInPath' on 'CanvasRenderingContext2D': The provided value 'randomstring' is not a valid enum value.. PASS successfullyParsed is true TEST COMPLETE diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-scroll-arguments-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-scroll-arguments-expected.txt index 9b08816..a0a4777 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-scroll-arguments-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-scroll-arguments-expected.txt @@ -22,9 +22,9 @@ PASS window.scrollTo({ left: x, top: y, behavior: "auto" }) did not throw except PASS window.scrollTo({ left: x, top: y, behavior: "instant" }) did not throw exception. PASS window.scrollTo({ left: x, top: y, behavior: "smooth" }) did not throw exception. Testing - scrollTo with an invalid ScrollToOptions argument -PASS window.scrollTo({ behavior: "" }) threw exception TypeError: Failed to execute 'scrollTo' on 'Window': member behavior ('') is not a valid enum value.. -PASS window.scrollTo({ left: x, top: y, behavior: "abcd" }) threw exception TypeError: Failed to execute 'scrollTo' on 'Window': member behavior ('abcd') is not a valid enum value.. -PASS window.scrollTo({ left: x, top: y, behavior: 200 }) threw exception TypeError: Failed to execute 'scrollTo' on 'Window': member behavior ('200') is not a valid enum value.. +PASS window.scrollTo({ behavior: "" }) threw exception TypeError: Failed to execute 'scrollTo' on 'Window': The provided value '' is not a valid enum value.. +PASS window.scrollTo({ left: x, top: y, behavior: "abcd" }) threw exception TypeError: Failed to execute 'scrollTo' on 'Window': The provided value 'abcd' is not a valid enum value.. +PASS window.scrollTo({ left: x, top: y, behavior: 200 }) threw exception TypeError: Failed to execute 'scrollTo' on 'Window': The provided value '200' is not a valid enum value.. window.scroll Tests @@ -44,9 +44,9 @@ PASS window.scroll({ left: x, top: y, behavior: "auto" }) did not throw exceptio PASS window.scroll({ left: x, top: y, behavior: "instant" }) did not throw exception. PASS window.scroll({ left: x, top: y, behavior: "smooth" }) did not throw exception. Testing - scroll with an invalid ScrollToOptions argument -PASS window.scroll({ behavior: "" }) threw exception TypeError: Failed to execute 'scroll' on 'Window': member behavior ('') is not a valid enum value.. -PASS window.scroll({ left: x, top: y, behavior: "abcd" }) threw exception TypeError: Failed to execute 'scroll' on 'Window': member behavior ('abcd') is not a valid enum value.. -PASS window.scroll({ left: x, top: y, behavior: 200 }) threw exception TypeError: Failed to execute 'scroll' on 'Window': member behavior ('200') is not a valid enum value.. +PASS window.scroll({ behavior: "" }) threw exception TypeError: Failed to execute 'scroll' on 'Window': The provided value '' is not a valid enum value.. +PASS window.scroll({ left: x, top: y, behavior: "abcd" }) threw exception TypeError: Failed to execute 'scroll' on 'Window': The provided value 'abcd' is not a valid enum value.. +PASS window.scroll({ left: x, top: y, behavior: 200 }) threw exception TypeError: Failed to execute 'scroll' on 'Window': The provided value '200' is not a valid enum value.. window.scrollBy Tests @@ -66,9 +66,9 @@ PASS window.scrollBy({ left: x, top: y, behavior: "auto" }) did not throw except PASS window.scrollBy({ left: x, top: y, behavior: "instant" }) did not throw exception. PASS window.scrollBy({ left: x, top: y, behavior: "smooth" }) did not throw exception. Testing - scrollBy with an invalid ScrollOptions argument -PASS window.scrollBy({ behavior: "" }) threw exception TypeError: Failed to execute 'scrollBy' on 'Window': member behavior ('') is not a valid enum value.. -PASS window.scrollBy({ left: x, top: y, behavior: "abcd" }) threw exception TypeError: Failed to execute 'scrollBy' on 'Window': member behavior ('abcd') is not a valid enum value.. -PASS window.scrollBy({ left: x, top: y, behavior: 200 }) threw exception TypeError: Failed to execute 'scrollBy' on 'Window': member behavior ('200') is not a valid enum value.. +PASS window.scrollBy({ behavior: "" }) threw exception TypeError: Failed to execute 'scrollBy' on 'Window': The provided value '' is not a valid enum value.. +PASS window.scrollBy({ left: x, top: y, behavior: "abcd" }) threw exception TypeError: Failed to execute 'scrollBy' on 'Window': The provided value 'abcd' is not a valid enum value.. +PASS window.scrollBy({ left: x, top: y, behavior: 200 }) threw exception TypeError: Failed to execute 'scrollBy' on 'Window': The provided value '200' is not a valid enum value.. PASS successfullyParsed is true TEST COMPLETE diff --git a/third_party/WebKit/LayoutTests/fast/dom/domparser-parsefromstring-mimetype-support-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/domparser-parsefromstring-mimetype-support-expected.txt index 0e1bae0..9717d0c 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/domparser-parsefromstring-mimetype-support-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/domparser-parsefromstring-mimetype-support-expected.txt @@ -23,19 +23,19 @@ Root element: svg PASS 6. Should THROW exception for mime-type = "text/xsl" -TypeError: Failed to execute 'parseFromString' on 'DOMParser': parameter 2 ('text/xsl') is not a valid enum value. +TypeError: Failed to execute 'parseFromString' on 'DOMParser': The provided value 'text/xsl' is not a valid enum value. PASS 7. Should THROW exception for mime-type = "text/dummy+xml" -TypeError: Failed to execute 'parseFromString' on 'DOMParser': parameter 2 ('text/dummy+xml') is not a valid enum value. +TypeError: Failed to execute 'parseFromString' on 'DOMParser': The provided value 'text/dummy+xml' is not a valid enum value. PASS 8. Should THROW exception for mime-type = "text/XML" -TypeError: Failed to execute 'parseFromString' on 'DOMParser': parameter 2 ('text/XML') is not a valid enum value. +TypeError: Failed to execute 'parseFromString' on 'DOMParser': The provided value 'text/XML' is not a valid enum value. PASS 9. Should THROW exception for mime-type = "TEXT/html" -TypeError: Failed to execute 'parseFromString' on 'DOMParser': parameter 2 ('TEXT/html') is not a valid enum value. +TypeError: Failed to execute 'parseFromString' on 'DOMParser': The provided value 'TEXT/html' is not a valid enum value. PASS diff --git a/third_party/WebKit/LayoutTests/fast/dom/idl-dictionary-unittest-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/idl-dictionary-unittest-expected.txt index 227fed5..3fcfdd9 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/idl-dictionary-unittest-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/idl-dictionary-unittest-expected.txt @@ -21,6 +21,7 @@ PASS dict.stringSequenceOrNullMember is undefined. PASS dict.elementMember is undefined. PASS dict.elementOrNullMember is undefined. PASS dict.enumMember is undefined. +PASS dict.enumArrayMember is undefined. PASS dict.enumMemberWithDefault is "foo" PASS dict.enumOrNullMember is undefined. PASS dict.objectMember is undefined. @@ -67,6 +68,7 @@ PASS dict.elementOrNullMember is undefined. PASS dict.enumMember is "foo" PASS dict.enumMemberWithDefault is "bar" PASS dict.enumOrNullMember is "baz" +PASS dict.enumArrayMember is ["foo", "bar", "baz"] PASS dict.objectMember is testObject1 PASS dict.objectOrNullMemberWithDefault is testObject2 PASS dict.doubleOrStringMember is 3.14 @@ -100,7 +102,8 @@ PASS dictionaryTest.set({byteStringMember: 'Ā'}) threw exception TypeError: Fai Test for setting invalid USVString value PASS dict.usvStringMember is "_�_�_��_" Test for setting invalid enum value -PASS dictionaryTest.set({enumMember: 'invalid'}) threw exception TypeError: Failed to execute 'set' on 'DictionaryTest': member enumMember ('invalid') is not a valid enum value.. +PASS dictionaryTest.set({enumMember: 'invalid'}) threw exception TypeError: Failed to execute 'set' on 'DictionaryTest': The provided value 'invalid' is not a valid enum value.. +PASS dictionaryTest.set({enumArrayMember: ['foo', 'invalid', 'baz']}) threw exception TypeError: Failed to execute 'set' on 'DictionaryTest': The provided value 'invalid' is not a valid enum value.. Test for setting invalid object value PASS dictionaryTest.set({objectMember: 42}) threw exception TypeError: Failed to execute 'set' on 'DictionaryTest': member objectMember is not an object.. diff --git a/third_party/WebKit/LayoutTests/fast/dom/idl-dictionary-unittest.html b/third_party/WebKit/LayoutTests/fast/dom/idl-dictionary-unittest.html index a31e494..e25d5dd 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/idl-dictionary-unittest.html +++ b/third_party/WebKit/LayoutTests/fast/dom/idl-dictionary-unittest.html @@ -28,6 +28,7 @@ if (window.internals && internals.dictionaryTest) { shouldBeUndefined('dict.elementMember'); shouldBeUndefined('dict.elementOrNullMember'); shouldBeUndefined('dict.enumMember'); + shouldBeUndefined('dict.enumArrayMember'); shouldBeEqualToString('dict.enumMemberWithDefault', 'foo'); shouldBeUndefined('dict.enumOrNullMember'); shouldBeUndefined('dict.objectMember'); @@ -81,6 +82,7 @@ if (window.internals && internals.dictionaryTest) { enumMember: 'foo', enumMemberWithDefault: 'bar', enumOrNullMember: 'baz', + enumArrayMember: ['foo', 'bar', 'baz'], objectMember: testObject1, objectOrNullMemberWithDefault: testObject2, doubleOrStringMember: 3.14, @@ -106,6 +108,7 @@ if (window.internals && internals.dictionaryTest) { shouldBeEqualToString('dict.enumMember', 'foo'); shouldBeEqualToString('dict.enumMemberWithDefault', 'bar'); shouldBeEqualToString('dict.enumOrNullMember', 'baz'); + shouldBe('dict.enumArrayMember', '["foo", "bar", "baz"]'); shouldBe('dict.objectMember', 'testObject1'); shouldBe('dict.objectOrNullMemberWithDefault', 'testObject2'); shouldBe('dict.doubleOrStringMember', '3.14'); @@ -182,6 +185,7 @@ if (window.internals && internals.dictionaryTest) { debug('Test for setting invalid enum value'); shouldThrow("dictionaryTest.set({enumMember: 'invalid'})"); + shouldThrow("dictionaryTest.set({enumArrayMember: ['foo', 'invalid', 'baz']})"); debug(''); debug('Test for setting invalid object value'); diff --git a/third_party/WebKit/LayoutTests/fast/dom/idl-union-type-unittest-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/idl-union-type-unittest-expected.txt index 6e0c797..fada7d0 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/idl-union-type-unittest-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/idl-union-type-unittest-expected.txt @@ -25,10 +25,10 @@ PASS unionTypesTest.doubleOrStringArg() threw exception TypeError: Failed to exe PASS unionTypesTest.doubleOrInternalEnumArg(3.14) is "double is passed: 3.14" PASS unionTypesTest.doubleOrInternalEnumArg("foo") is "InternalEnum is passed: foo" -PASS unionTypesTest.doubleOrInternalEnumArg("invalid") threw exception TypeError: Failed to execute 'doubleOrInternalEnumArg' on 'UnionTypesTest': 'invalid' is not a valid enum value.. -PASS unionTypesTest.doubleOrInternalEnumArg(null) threw exception TypeError: Failed to execute 'doubleOrInternalEnumArg' on 'UnionTypesTest': 'null' is not a valid enum value.. -PASS unionTypesTest.doubleOrInternalEnumArg({}) threw exception TypeError: Failed to execute 'doubleOrInternalEnumArg' on 'UnionTypesTest': '[object Object]' is not a valid enum value.. -PASS unionTypesTest.doubleOrInternalEnumArg([]) threw exception TypeError: Failed to execute 'doubleOrInternalEnumArg' on 'UnionTypesTest': '' is not a valid enum value.. +PASS unionTypesTest.doubleOrInternalEnumArg("invalid") threw exception TypeError: Failed to execute 'doubleOrInternalEnumArg' on 'UnionTypesTest': The provided value 'invalid' is not a valid enum value.. +PASS unionTypesTest.doubleOrInternalEnumArg(null) threw exception TypeError: Failed to execute 'doubleOrInternalEnumArg' on 'UnionTypesTest': The provided value 'null' is not a valid enum value.. +PASS unionTypesTest.doubleOrInternalEnumArg({}) threw exception TypeError: Failed to execute 'doubleOrInternalEnumArg' on 'UnionTypesTest': The provided value '[object Object]' is not a valid enum value.. +PASS unionTypesTest.doubleOrInternalEnumArg([]) threw exception TypeError: Failed to execute 'doubleOrInternalEnumArg' on 'UnionTypesTest': The provided value '' is not a valid enum value.. PASS unionTypesTest.doubleOrStringArrayArg([]) is "" PASS unionTypesTest.doubleOrStringArrayArg([3.14, "foo"]) is "double: 3.14, string: foo" diff --git a/third_party/WebKit/LayoutTests/fast/mediastream/RTCSessionDescription-expected.txt b/third_party/WebKit/LayoutTests/fast/mediastream/RTCSessionDescription-expected.txt index ac87b11..8de1d72 100644 --- a/third_party/WebKit/LayoutTests/fast/mediastream/RTCSessionDescription-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/mediastream/RTCSessionDescription-expected.txt @@ -14,7 +14,7 @@ PASS new RTCSessionDescription(); did not throw exception. PASS new RTCSessionDescription({}); did not throw exception. PASS new RTCSessionDescription(5); threw exception TypeError: Failed to construct 'RTCSessionDescription': parameter 1 ('descriptionInitDict') is not an object.. PASS new RTCSessionDescription('foobar'); threw exception TypeError: Failed to construct 'RTCSessionDescription': parameter 1 ('descriptionInitDict') is not an object.. -PASS new RTCSessionDescription({type:'foobar', sdp:'x'}); threw exception TypeError: Failed to construct 'RTCSessionDescription': member type ('foobar') is not a valid enum value.. +PASS new RTCSessionDescription({type:'foobar', sdp:'x'}); threw exception TypeError: Failed to construct 'RTCSessionDescription': The provided value 'foobar' is not a valid enum value.. PASS new RTCSessionDescription({type:'offer', sdp:''}); did not throw exception. PASS new RTCSessionDescription({type:'offer', sdp:'x'}); did not throw exception. PASS new RTCSessionDescription({type:'answer', sdp:'x'}); did not throw exception. diff --git a/third_party/WebKit/LayoutTests/fast/xmlhttprequest/xmlhttprequest-set-responsetype-expected.txt b/third_party/WebKit/LayoutTests/fast/xmlhttprequest/xmlhttprequest-set-responsetype-expected.txt index 8934554..dbbab57 100644 --- a/third_party/WebKit/LayoutTests/fast/xmlhttprequest/xmlhttprequest-set-responsetype-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/xmlhttprequest/xmlhttprequest-set-responsetype-expected.txt @@ -1,5 +1,5 @@ -CONSOLE WARNING: The provided value 'dkjdfkjdfkj' is not a valid value of type 'XMLHttpRequestResponseType'. -CONSOLE WARNING: The provided value 'asdfasdfasd' is not a valid value of type 'XMLHttpRequestResponseType'. +CONSOLE WARNING: The provided value 'dkjdfkjdfkj' is not a valid enum value. +CONSOLE WARNING: The provided value 'asdfasdfasd' is not a valid enum value. This test checks if setting non-supported type does not throw an exception On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". diff --git a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-sourcebuffer-mode-expected.txt b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-sourcebuffer-mode-expected.txt index 8b91fa6..5f5916b 100644 --- a/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-sourcebuffer-mode-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-sourcebuffer-mode-expected.txt @@ -1,7 +1,7 @@ -CONSOLE WARNING: The provided value 'invalidmode' is not a valid value of type 'AppendMode'. -CONSOLE WARNING: The provided value 'null' is not a valid value of type 'AppendMode'. -CONSOLE WARNING: The provided value '' is not a valid value of type 'AppendMode'. -CONSOLE WARNING: The provided value 'Segments' is not a valid value of type 'AppendMode'. +CONSOLE WARNING: The provided value 'invalidmode' is not a valid enum value. +CONSOLE WARNING: The provided value 'null' is not a valid enum value. +CONSOLE WARNING: The provided value '' is not a valid enum value. +CONSOLE WARNING: The provided value 'Segments' is not a valid enum value. PASS Test initial value of SourceBuffer.mode is "segments" PASS Test setting SourceBuffer.mode diff --git a/third_party/WebKit/LayoutTests/inspector/layers/layer-canvas-log-expected.txt b/third_party/WebKit/LayoutTests/inspector/layers/layer-canvas-log-expected.txt index ee0b5a4..ccedde6 100644 --- a/third_party/WebKit/LayoutTests/inspector/layers/layer-canvas-log-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector/layers/layer-canvas-log-expected.txt @@ -2,9 +2,6 @@ Canvas log: { 0 : { - method : "save" - } - 1 : { method : "drawRect" params : { paint : { @@ -31,16 +28,7 @@ Canvas log: } } } - 10 : { - method : "restore" - } - 11 : { - method : "restore" - } - 12 : { - method : "restore" - } - 2 : { + 1 : { method : "drawRect" params : { paint : { @@ -67,18 +55,27 @@ Canvas log: } } } - 3 : { + 10 : { + method : "restore" + } + 11 : { + method : "restore" + } + 12 : { + method : "restore" + } + 2 : { method : "drawBitmapRectToRect" params : { bitmap : { config : "ARGB8888" data : { - base64 : "iVBORw0KGgoAAAANSUhEUgAAABMAAAAVCAYAAACkCdXRAAAAKElEQVQ4T2P8DwQMVAKMo4aRHJKjYUZykDGMhtlomOEIgdGkMcBJAwBg3lPCYiIiUQAAAABJRU5ErkJggg==" + base64 : "iVBORw0KGgoAAAANSUhEUgAAABMAAAAVCAYAAACkCdXRAAAAKklEQVQ4T2P8////fwYqAcZRw0gOydEwIznIGEbDbDTMcITAaNIY4KQBAGDeU8KwDOsAAAAAAElFTkSuQmCC" mimeType : "image/png" } height : 21 immutable : true - opaque : true + opaque : false volatile : false width : 19 } @@ -91,7 +88,7 @@ Canvas log: flags : 0 paint : { color : "#FF000000" - filterLevel : "Low" + filterLevel : "High" flags : "none" hinting : "Normal" strokeCap : "Butt" @@ -113,10 +110,10 @@ Canvas log: } } } - 4 : { + 3 : { method : "save" } - 5 : { + 4 : { method : "clipRect" params : { SkRegion::Op : "kIntersect_Op" @@ -129,6 +126,9 @@ Canvas log: softClipEdgeStyle : false } } + 5 : { + method : "save" + } 6 : { method : "setMatrix" params : { diff --git a/third_party/WebKit/LayoutTests/media/track/track-addtrack-kind-expected.txt b/third_party/WebKit/LayoutTests/media/track/track-addtrack-kind-expected.txt index 736da5b..723b97c 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-addtrack-kind-expected.txt +++ b/third_party/WebKit/LayoutTests/media/track/track-addtrack-kind-expected.txt @@ -2,7 +2,7 @@ Tests that the addTextTrack() only accepts known 'kind' values. ++ Test invalid 'kind'. EXPECTED (video.textTracks.length == '0') OK -TEST(video.addTextTrack('kaptions')) THROWS("TypeError: Failed to execute 'addTextTrack' on 'HTMLMediaElement': parameter 1 ('kaptions') is not a valid enum value.") OK +TEST(video.addTextTrack('kaptions')) THROWS("TypeError: Failed to execute 'addTextTrack' on 'HTMLMediaElement': parameter 1 ('kaptions') is not a valid enum value.") FAIL EXPECTED (video.textTracks.length == '0') OK ++ Test all valid 'kind' keywords. diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-expected.txt b/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-expected.txt index c89927a..f124c62 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-expected.txt +++ b/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-expected.txt @@ -1,5 +1,5 @@ -CONSOLE WARNING: The provided value 'RL' is not a valid value of type 'DirectionSetting'. -CONSOLE WARNING: The provided value 'End' is not a valid value of type 'AlignSetting'. +CONSOLE WARNING: The provided value 'RL' is not a valid enum value. +CONSOLE WARNING: The provided value 'End' is not a valid enum value. Tests modifying attributes of a VTTCue ** Test initial values. @@ -37,7 +37,7 @@ EXPECTED (textCue.snapToLines == 'false') OK On setting, the text track cue line position must be set to the new value; if the new value is the string 'auto', then it must be interpreted as the special value auto. http://dev.w3.org/html5/webvtt/#dfn-vttcue-line EXPECTED (textCue.line == 'auto') OK -TEST(textCue.line = 'gazonk') THROWS("TypeError: Failed to set the 'line' property on 'VTTCue': 'gazonk' is not a valid enum value.") OK +TEST(textCue.line = 'gazonk') THROWS("TypeError: Failed to set the 'line' property on 'VTTCue': 'gazonk' is not a valid enum value.") FAIL EXPECTED (textCue.line == 'auto') OK RUN(textCue.line = 42) EXPECTED (textCue.line == '42') OK diff --git a/third_party/WebKit/LayoutTests/media/track/track-mode-expected.txt b/third_party/WebKit/LayoutTests/media/track/track-mode-expected.txt index fb24c09..7e7e02f 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-mode-expected.txt +++ b/third_party/WebKit/LayoutTests/media/track/track-mode-expected.txt @@ -1,5 +1,5 @@ -CONSOLE WARNING: The provided value 'bogus' is not a valid value of type 'TextTrackMode'. -CONSOLE WARNING: The provided value '2' is not a valid value of type 'TextTrackMode'. +CONSOLE WARNING: The provided value 'bogus' is not a valid enum value. +CONSOLE WARNING: The provided value '2' is not a valid enum value. Tests that the TextTrack mode attribute is appropriately set. diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/exceptions-expected.txt b/third_party/WebKit/LayoutTests/storage/indexeddb/exceptions-expected.txt index a1bbb50..2f5dc6c 100644 --- a/third_party/WebKit/LayoutTests/storage/indexeddb/exceptions-expected.txt +++ b/third_party/WebKit/LayoutTests/storage/indexeddb/exceptions-expected.txt @@ -106,7 +106,7 @@ Exception message: Failed to execute 'transaction' on 'IDBDatabase': One of the The value for the mode parameter is invalid. Expecting TypeError exception from db.transaction('store', 'invalid-mode') PASS Exception was thrown. -PASS db.transaction('store', 'invalid-mode') threw TypeError: Failed to execute 'transaction' on 'IDBDatabase': parameter 2 ('invalid-mode') is not a valid enum value. +PASS db.transaction('store', 'invalid-mode') threw TypeError: Failed to execute 'transaction' on 'IDBDatabase': The provided value 'invalid-mode' is not a valid enum value. The 'versionchange' value for the mode parameter can only be set internally during upgradeneeded. Expecting TypeError exception from db.transaction('store', 'versionchange') PASS Exception was thrown. @@ -276,7 +276,7 @@ Exception message: Failed to execute 'openKeyCursor' on 'IDBObjectStore': The tr The value for the direction parameter is invalid. Expecting TypeError exception from store.openKeyCursor(0, 'invalid-direction') PASS Exception was thrown. -PASS store.openKeyCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openKeyCursor' on 'IDBObjectStore': parameter 2 ('invalid-direction') is not a valid enum value. +PASS store.openKeyCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openKeyCursor' on 'IDBObjectStore': The provided value 'invalid-direction' is not a valid enum value. IDBObjectStore.put() This method throws a DOMException of type ReadOnlyError if the transaction which this IDBObjectStore belongs to is has its mode set to "readonly". @@ -413,7 +413,7 @@ Exception message: Failed to execute 'openCursor' on 'IDBIndex': The transaction The value for the direction parameter is invalid. Expecting TypeError exception from index.openCursor(0, 'invalid-direction') PASS Exception was thrown. -PASS index.openCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openCursor' on 'IDBIndex': parameter 2 ('invalid-direction') is not a valid enum value. +PASS index.openCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openCursor' on 'IDBIndex': The provided value 'invalid-direction' is not a valid enum value. IDBIndex.openKeyCursor() If the range parameter is specified but is not a valid key or a key range, this method throws a DOMException of type DataError. @@ -431,7 +431,7 @@ Exception message: Failed to execute 'openKeyCursor' on 'IDBIndex': The transact The value for the direction parameter is invalid. Expecting TypeError exception from index.openKeyCursor(0, 'invalid-direction') PASS Exception was thrown. -PASS index.openKeyCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openKeyCursor' on 'IDBIndex': parameter 2 ('invalid-direction') is not a valid enum value. +PASS index.openKeyCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openKeyCursor' on 'IDBIndex': The provided value 'invalid-direction' is not a valid enum value. 3.2.7 Cursor transaction = db.transaction(['store', 'inlineKeyStore'], 'readwrite') diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/index-basics-expected.txt b/third_party/WebKit/LayoutTests/storage/indexeddb/index-basics-expected.txt index 176a2c6..31461ba 100644 --- a/third_party/WebKit/LayoutTests/storage/indexeddb/index-basics-expected.txt +++ b/third_party/WebKit/LayoutTests/storage/indexeddb/index-basics-expected.txt @@ -70,7 +70,7 @@ PASS event.target.result is "key2" Verify that specifying an invalid direction raises an exception: Expecting TypeError exception from indexObject.openKeyCursor(0, 'invalid-direction') PASS Exception was thrown. -PASS indexObject.openKeyCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openKeyCursor' on 'IDBIndex': parameter 2 ('invalid-direction') is not a valid enum value. +PASS indexObject.openKeyCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openKeyCursor' on 'IDBIndex': The provided value 'invalid-direction' is not a valid enum value. indexObject.openKeyCursor() PASS event.target.source is indexObject @@ -95,7 +95,7 @@ PASS event.target.result is null Verify that specifying an invalid direction raises an exception: Expecting TypeError exception from indexObject.openCursor(0, 'invalid-direction') PASS Exception was thrown. -PASS indexObject.openCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openCursor' on 'IDBIndex': parameter 2 ('invalid-direction') is not a valid enum value. +PASS indexObject.openCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openCursor' on 'IDBIndex': The provided value 'invalid-direction' is not a valid enum value. indexObject.openCursor() PASS event.target.source is indexObject diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/index-basics-workers-expected.txt b/third_party/WebKit/LayoutTests/storage/indexeddb/index-basics-workers-expected.txt index 451081c..6bfcb8f 100644 --- a/third_party/WebKit/LayoutTests/storage/indexeddb/index-basics-workers-expected.txt +++ b/third_party/WebKit/LayoutTests/storage/indexeddb/index-basics-workers-expected.txt @@ -71,7 +71,7 @@ PASS [Worker] event.target.result is "key2" [Worker] Verify that specifying an invalid direction raises an exception: [Worker] Expecting TypeError exception from indexObject.openKeyCursor(0, 'invalid-direction') PASS [Worker] Exception was thrown. -PASS [Worker] indexObject.openKeyCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openKeyCursor' on 'IDBIndex': parameter 2 ('invalid-direction') is not a valid enum value. +PASS [Worker] indexObject.openKeyCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openKeyCursor' on 'IDBIndex': The provided value 'invalid-direction' is not a valid enum value. [Worker] [Worker] indexObject.openKeyCursor() PASS [Worker] event.target.source is indexObject @@ -96,7 +96,7 @@ PASS [Worker] event.target.result is null [Worker] Verify that specifying an invalid direction raises an exception: [Worker] Expecting TypeError exception from indexObject.openCursor(0, 'invalid-direction') PASS [Worker] Exception was thrown. -PASS [Worker] indexObject.openCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openCursor' on 'IDBIndex': parameter 2 ('invalid-direction') is not a valid enum value. +PASS [Worker] indexObject.openCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openCursor' on 'IDBIndex': The provided value 'invalid-direction' is not a valid enum value. [Worker] [Worker] indexObject.openCursor() PASS [Worker] event.target.source is indexObject diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/objectstore-keycursor-expected.txt b/third_party/WebKit/LayoutTests/storage/indexeddb/objectstore-keycursor-expected.txt index f49249d..379a19e 100644 --- a/third_party/WebKit/LayoutTests/storage/indexeddb/objectstore-keycursor-expected.txt +++ b/third_party/WebKit/LayoutTests/storage/indexeddb/objectstore-keycursor-expected.txt @@ -13,7 +13,7 @@ objectStore = db.createObjectStore('someObjectStore') Verify that specifying an invalid direction raises an exception: Expecting TypeError exception from objectStore.openKeyCursor(0, 'invalid-direction') PASS Exception was thrown. -PASS objectStore.openKeyCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openKeyCursor' on 'IDBObjectStore': parameter 2 ('invalid-direction') is not a valid enum value. +PASS objectStore.openKeyCursor(0, 'invalid-direction') threw TypeError: Failed to execute 'openKeyCursor' on 'IDBObjectStore': The provided value 'invalid-direction' is not a valid enum value. objectStore.add('', testData[nextToAdd]) objectStore.add('', testData[nextToAdd]) diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/transaction-basics-expected.txt b/third_party/WebKit/LayoutTests/storage/indexeddb/transaction-basics-expected.txt index c0b0f7a..d4077bf 100644 --- a/third_party/WebKit/LayoutTests/storage/indexeddb/transaction-basics-expected.txt +++ b/third_party/WebKit/LayoutTests/storage/indexeddb/transaction-basics-expected.txt @@ -230,7 +230,7 @@ PASS all stores present in transaction Verify that specifying an invalid mode raises an exception Expecting TypeError exception from db.transaction(['storeName'], 'lsakjdf') PASS Exception was thrown. -PASS db.transaction(['storeName'], 'lsakjdf') threw TypeError: Failed to execute 'transaction' on 'IDBDatabase': parameter 2 ('lsakjdf') is not a valid enum value. +PASS db.transaction(['storeName'], 'lsakjdf') threw TypeError: Failed to execute 'transaction' on 'IDBDatabase': The provided value 'lsakjdf' is not a valid enum value. Test that null and undefined are treated as strings Expecting exception from db.transaction(null) diff --git a/third_party/WebKit/LayoutTests/storage/quota/storagequota-query-info-expected.txt b/third_party/WebKit/LayoutTests/storage/quota/storagequota-query-info-expected.txt index 21e5f81..71b39c4 100644 --- a/third_party/WebKit/LayoutTests/storage/quota/storagequota-query-info-expected.txt +++ b/third_party/WebKit/LayoutTests/storage/quota/storagequota-query-info-expected.txt @@ -10,7 +10,7 @@ PASS quota is >= usage PASS usage is >= 0 PASS quota is >= usage * Querying about unknown storage. -PASS rejected as expected: TypeError: Failed to execute 'queryInfo' on 'StorageQuota': parameter 1 ('unknown') is not a valid enum value. +PASS rejected as expected: TypeError: Failed to execute 'queryInfo' on 'StorageQuota': The provided value 'unknown' is not a valid enum value. * Querying with missing storage type. PASS rejected as expected: TypeError: Failed to execute 'queryInfo' on 'StorageQuota': 1 argument required, but only 0 present. Finished running tests. diff --git a/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-path-context-clip-expected.txt b/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-path-context-clip-expected.txt index 4aeb651..191f460 100644 --- a/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-path-context-clip-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-path-context-clip-expected.txt @@ -39,21 +39,21 @@ PASS pixelDataAtPoint()[1] is within 5 of 0 PASS pixelDataAtPoint()[2] is within 5 of 0 PASS pixelDataAtPoint()[3] is within 5 of 255 -PASS ctx.clip(null) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 ('null') is not a valid enum value.. +PASS ctx.clip(null) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': The provided value 'null' is not a valid enum value.. PASS ctx.clip(null, null) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.clip(null, 'nonzero') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. -PASS ctx.clip(path, null) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 2 ('null') is not a valid enum value.. +PASS ctx.clip(path, null) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': The provided value 'null' is not a valid enum value.. PASS ctx.clip([], 'nonzero') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.clip({}, 'nonzero') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.clip(null, 'evenodd') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.clip([], 'evenodd') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.clip({}, 'evenodd') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. -PASS ctx.clip('gazonk') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 ('gazonk') is not a valid enum value.. -PASS ctx.clip(path, 'gazonk') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 2 ('gazonk') is not a valid enum value.. -PASS ctx.clip(undefined) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 ('undefined') is not a valid enum value.. +PASS ctx.clip('gazonk') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': The provided value 'gazonk' is not a valid enum value.. +PASS ctx.clip(path, 'gazonk') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': The provided value 'gazonk' is not a valid enum value.. +PASS ctx.clip(undefined) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': The provided value 'undefined' is not a valid enum value.. PASS ctx.clip(undefined, undefined) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.clip(undefined, 'nonzero') threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. -PASS ctx.clip(path, undefined) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': parameter 2 ('undefined') is not a valid enum value.. +PASS ctx.clip(path, undefined) threw exception TypeError: Failed to execute 'clip' on 'CanvasRenderingContext2D': The provided value 'undefined' is not a valid enum value.. PASS successfullyParsed is true TEST COMPLETE diff --git a/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-path-context-fill-expected.txt b/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-path-context-fill-expected.txt index ca99174..86bd08e 100644 --- a/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-path-context-fill-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-path-context-fill-expected.txt @@ -39,21 +39,21 @@ PASS pixelDataAtPoint()[1] is within 5 of 0 PASS pixelDataAtPoint()[2] is within 5 of 0 PASS pixelDataAtPoint()[3] is within 5 of 255 -PASS ctx.fill(null) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 ('null') is not a valid enum value.. +PASS ctx.fill(null) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': The provided value 'null' is not a valid enum value.. PASS ctx.fill(null, null) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.fill(null, 'nonzero') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. -PASS ctx.fill(path, null) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 2 ('null') is not a valid enum value.. +PASS ctx.fill(path, null) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': The provided value 'null' is not a valid enum value.. PASS ctx.fill([], 'nonzero') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.fill({}, 'nonzero') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.fill(null, 'evenodd') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.fill([], 'evenodd') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.fill({}, 'evenodd') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. -PASS ctx.fill('gazonk') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 ('gazonk') is not a valid enum value.. -PASS ctx.fill(path, 'gazonk') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 2 ('gazonk') is not a valid enum value.. -PASS ctx.fill(undefined) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 ('undefined') is not a valid enum value.. +PASS ctx.fill('gazonk') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': The provided value 'gazonk' is not a valid enum value.. +PASS ctx.fill(path, 'gazonk') threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': The provided value 'gazonk' is not a valid enum value.. +PASS ctx.fill(undefined) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': The provided value 'undefined' is not a valid enum value.. PASS ctx.fill(undefined, undefined) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. PASS ctx.fill(undefined, path) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 1 is not of type 'Path2D'.. -PASS ctx.fill(path, undefined) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': parameter 2 ('undefined') is not a valid enum value.. +PASS ctx.fill(path, undefined) threw exception TypeError: Failed to execute 'fill' on 'CanvasRenderingContext2D': The provided value 'undefined' is not a valid enum value.. PASS successfullyParsed is true TEST COMPLETE diff --git a/third_party/WebKit/LayoutTests/webaudio/biquadfilternode-basic-expected.txt b/third_party/WebKit/LayoutTests/webaudio/biquadfilternode-basic-expected.txt index 7a67434..cbe20aa 100644 --- a/third_party/WebKit/LayoutTests/webaudio/biquadfilternode-basic-expected.txt +++ b/third_party/WebKit/LayoutTests/webaudio/biquadfilternode-basic-expected.txt @@ -1,4 +1,4 @@ -CONSOLE WARNING: The provided value '99' is not a valid value of type 'BiquadFilterType'. +CONSOLE WARNING: The provided value '99' is not a valid enum value. Basic tests for BiquadFilterNode. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". diff --git a/third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt b/third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt index 9f7d572..f61231e 100644 --- a/third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt +++ b/third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt @@ -1,9 +1,9 @@ -CONSOLE WARNING: The provided value 'fancy' is not a valid value of type 'ChannelCountMode'. -CONSOLE WARNING: The provided value 'undefined' is not a valid value of type 'ChannelInterpretation'. -CONSOLE WARNING: The provided value '9x' is not a valid value of type 'OverSampleType'. +CONSOLE WARNING: The provided value 'fancy' is not a valid enum value. +CONSOLE WARNING: The provided value 'undefined' is not a valid enum value. +CONSOLE WARNING: The provided value '9x' is not a valid enum value. CONSOLE WARNING: Setting AudioBufferSourceNode.buffer more than once is deprecated and will no longer work in Chrome 43. -CONSOLE WARNING: The provided value 'junk' is not a valid value of type 'ChannelCountMode'. -CONSOLE WARNING: The provided value 'junk' is not a valid value of type 'ChannelCountMode'. +CONSOLE WARNING: The provided value 'junk' is not a valid enum value. +CONSOLE WARNING: The provided value 'junk' is not a valid enum value. Tests DOM exception messages On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". diff --git a/third_party/WebKit/LayoutTests/webaudio/oscillator-basic-expected.txt b/third_party/WebKit/LayoutTests/webaudio/oscillator-basic-expected.txt index a4f3bef..5a3dac2b 100644 --- a/third_party/WebKit/LayoutTests/webaudio/oscillator-basic-expected.txt +++ b/third_party/WebKit/LayoutTests/webaudio/oscillator-basic-expected.txt @@ -1,4 +1,4 @@ -CONSOLE WARNING: The provided value '0' is not a valid value of type 'OscillatorType'. +CONSOLE WARNING: The provided value '0' is not a valid enum value. Basic test of setting Oscillator node types. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". diff --git a/third_party/WebKit/LayoutTests/webaudio/pannernode-basic-expected.txt b/third_party/WebKit/LayoutTests/webaudio/pannernode-basic-expected.txt index 2e40ed6..0ddb5b6 100644 --- a/third_party/WebKit/LayoutTests/webaudio/pannernode-basic-expected.txt +++ b/third_party/WebKit/LayoutTests/webaudio/pannernode-basic-expected.txt @@ -1,5 +1,5 @@ -CONSOLE WARNING: The provided value '1' is not a valid value of type 'PanningModelType'. -CONSOLE WARNING: The provided value '1' is not a valid value of type 'DistanceModelType'. +CONSOLE WARNING: The provided value '1' is not a valid enum value. +CONSOLE WARNING: The provided value '1' is not a valid enum value. Basic tests for PannerNode. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp index b288a29..b9c554f 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp @@ -778,6 +778,25 @@ void crashIfV8IsDead() } } +bool isValidEnum(const String value, const char** validValues, size_t length, ExceptionState& exceptionState) +{ + for (size_t i = 0; i < length; ++i) { + if (value == validValues[i]) + return true; + } + exceptionState.throwTypeError("The provided value '" + value + "' is not a valid enum value."); + return false; +} + +bool isValidEnum(const Vector<String>& values, const char** validValues, size_t length, ExceptionState& exceptionState) +{ + for (auto value : values) { + if (!isValidEnum(value, validValues, length, exceptionState)) + return false; + } + return true; +} + v8::Handle<v8::Function> getBoundFunction(v8::Handle<v8::Function> function) { v8::Handle<v8::Value> boundFunction = function->GetBoundFunction(); diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h index bd91db5..c5abdc3 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.h +++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.h @@ -919,6 +919,9 @@ template<class Collection> static void indexedPropertyEnumerator(const v8::Prope v8SetReturnValue(info, properties); } +bool isValidEnum(const String value, const char** validValues, size_t length, ExceptionState&); +bool isValidEnum(const Vector<String>& values, const char** validValues, size_t length, ExceptionState&); + // These methods store hidden values into an array that is stored in the internal field of a DOM wrapper. void addHiddenValueToArray(v8::Isolate*, v8::Handle<v8::Object>, v8::Local<v8::Value>, int cacheIndex); void removeHiddenValueFromArray(v8::Isolate*, v8::Handle<v8::Object>, v8::Local<v8::Value>, int cacheIndex); diff --git a/third_party/WebKit/Source/bindings/scripts/idl_types.py b/third_party/WebKit/Source/bindings/scripts/idl_types.py index e75123c..20038d3 100644 --- a/third_party/WebKit/Source/bindings/scripts/idl_types.py +++ b/third_party/WebKit/Source/bindings/scripts/idl_types.py @@ -180,7 +180,7 @@ class IdlType(IdlTypeBase): @property def enum_values(self): - return IdlType.enums[self.name] + return IdlType.enums.get(self.name) @property def is_integer_type(self): @@ -345,6 +345,10 @@ class IdlArrayOrSequenceType(IdlTypeBase): def is_array_or_sequence_type(self): return True + @property + def enum_values(self): + return self.element_type.enum_values + class IdlArrayType(IdlArrayOrSequenceType): def __init__(self, element_type): diff --git a/third_party/WebKit/Source/bindings/scripts/v8_attributes.py b/third_party/WebKit/Source/bindings/scripts/v8_attributes.py index 01188b6..995662a 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_attributes.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_attributes.py @@ -50,7 +50,7 @@ def attribute_context(interface, attribute): extended_attributes = attribute.extended_attributes idl_type.add_includes_for_type() - if idl_type.enum_validation_expression: + if idl_type.enum_values: includes.add('core/inspector/ConsoleMessage.h') # [CheckSecurity] @@ -106,7 +106,7 @@ def attribute_context(interface, attribute): 'cpp_type': idl_type.cpp_type, 'cpp_type_initializer': idl_type.cpp_type_initializer, 'deprecate_as': v8_utilities.deprecate_as(attribute), # [DeprecateAs] - 'enum_validation_expression': idl_type.enum_validation_expression, + 'enum_values': idl_type.enum_values, 'exposed_test': v8_utilities.exposed(attribute, interface), # [Exposed] 'has_custom_getter': has_custom_getter(attribute), 'has_custom_setter': has_custom_setter(attribute), diff --git a/third_party/WebKit/Source/bindings/scripts/v8_dictionary.py b/third_party/WebKit/Source/bindings/scripts/v8_dictionary.py index 1d1f2f4..8b492c9 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_dictionary.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_dictionary.py @@ -104,7 +104,7 @@ def member_context(dictionary, member): creation_context='creationContext', extended_attributes=member.extended_attributes), 'deprecate_as': v8_utilities.deprecate_as(member), - 'enum_validation_expression': unwrapped_idl_type.enum_validation_expression, + 'enum_values': unwrapped_idl_type.enum_values, 'has_method_name': has_method_name_for_dictionary_member(member), 'idl_type': idl_type.base_type, 'is_interface_type': idl_type.is_interface_type and not idl_type.is_dictionary, diff --git a/third_party/WebKit/Source/bindings/scripts/v8_methods.py b/third_party/WebKit/Source/bindings/scripts/v8_methods.py index fc2be40..5e76f6f 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_methods.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_methods.py @@ -223,7 +223,7 @@ def argument_context(interface, method, argument, index): 'cpp_value': this_cpp_value, # FIXME: check that the default value's type is compatible with the argument's 'set_default_value': set_default_value, - 'enum_validation_expression': idl_type.enum_validation_expression, + 'enum_values': idl_type.enum_values, 'handle': '%sHandle' % argument.name, # FIXME: remove once [Default] removed and just use argument.default_value 'has_default': 'Default' in extended_attributes or set_default_value, @@ -457,5 +457,4 @@ def argument_conversion_needs_exception_state(method, argument): idl_type = argument.idl_type return (idl_type.v8_conversion_needs_exception_state or argument.is_variadic or - (method.returns_promise and (idl_type.is_string_type or - idl_type.is_enum))) + (method.returns_promise and idl_type.is_string_type)) diff --git a/third_party/WebKit/Source/bindings/scripts/v8_types.py b/third_party/WebKit/Source/bindings/scripts/v8_types.py index 1f3770b..dcce5284 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_types.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_types.py @@ -499,6 +499,7 @@ V8_VALUE_TO_CPP_VALUE = { def v8_conversion_needs_exception_state(idl_type): return (idl_type.is_numeric_type or + idl_type.is_enum or idl_type.is_dictionary or idl_type.name in ('ByteString', 'Dictionary', 'USVString', 'SerializedScriptValue')) diff --git a/third_party/WebKit/Source/bindings/scripts/v8_union.py b/third_party/WebKit/Source/bindings/scripts/v8_union.py index 177394e..13b52cf 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_union.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_union.py @@ -143,7 +143,7 @@ def member_context(member, interfaces_info): 'cpp_value_to_v8_value': member.cpp_value_to_v8_value( cpp_value='impl.getAs%s()' % member.name, isolate='isolate', creation_context='creationContext'), - 'enum_validation_expression': member.enum_validation_expression, + 'enum_values': member.enum_values, 'is_traceable': member.is_traceable, 'rvalue_cpp_type': member.cpp_type_args(used_as_rvalue_type=True), 'specific_type_enum': 'SpecificType' + member.name, diff --git a/third_party/WebKit/Source/bindings/scripts/v8_utilities.py b/third_party/WebKit/Source/bindings/scripts/v8_utilities.py index b2b31ef..da957af 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_utilities.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_utilities.py @@ -28,8 +28,6 @@ """Functions shared by various parts of the code generator. -Extends IdlTypeBase type with |enum_validation_expression| property. - Design doc: http://www.chromium.org/developers/design-documents/idl-compiler """ @@ -119,15 +117,6 @@ def uncapitalize(name): # C++ ################################################################################ -def enum_validation_expression(idl_type): - # FIXME: Add IdlEnumType, move property to derived type, and remove this check - if not idl_type.is_enum: - return None - return ' || '.join(['string == "%s"' % enum_value - for enum_value in idl_type.enum_values]) -IdlTypeBase.enum_validation_expression = property(enum_validation_expression) - - def scoped_name(interface, definition, base_name): if 'ImplementedInPrivateScript' in definition.extended_attributes: return '%s::PrivateScript::%s' % (v8_class_name(interface), base_name) diff --git a/third_party/WebKit/Source/bindings/templates/attributes.cpp b/third_party/WebKit/Source/bindings/templates/attributes.cpp index bc3da71..7b50e51 100644 --- a/third_party/WebKit/Source/bindings/templates/attributes.cpp +++ b/third_party/WebKit/Source/bindings/templates/attributes.cpp @@ -1,4 +1,4 @@ -{% from 'conversions.cpp' import v8_value_to_local_cpp_value %} +{% from 'conversions.cpp' import declare_enum_validation_variable, v8_value_to_local_cpp_value %} {##############################################################################} @@ -330,12 +330,15 @@ v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info exceptionState.throwIfNeeded(); return; } - {% elif attribute.enum_validation_expression %} + {% elif attribute.enum_values %} {# Setter ignores invalid enum values: http://www.w3.org/TR/WebIDL/#idl-enums #} - String string = cppValue; - if (!({{attribute.enum_validation_expression}})) { - currentExecutionContext(info.GetIsolate())->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "The provided value '" + string + "' is not a valid value of type '{{attribute.idl_type}}'.")); + {% if not attribute.has_setter_exception_state %} + NonThrowableExceptionState exceptionState; + {% endif %} + {{declare_enum_validation_variable(attribute.enum_values) | indent}} + if (!isValidEnum(cppValue, validValues, WTF_ARRAY_LENGTH(validValues), exceptionState)) { + currentExecutionContext(info.GetIsolate())->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, exceptionState.message())); return; } {% endif %} diff --git a/third_party/WebKit/Source/bindings/templates/conversions.cpp b/third_party/WebKit/Source/bindings/templates/conversions.cpp index cb48705..fdf9d78 100644 --- a/third_party/WebKit/Source/bindings/templates/conversions.cpp +++ b/third_party/WebKit/Source/bindings/templates/conversions.cpp @@ -29,3 +29,12 @@ if ({{item.check_expression}}) {% endif %}{# item.check_expression #} {% endif %}{# item.error_message #} {% endmacro %} + + +{% macro declare_enum_validation_variable(enum_values) %} +static const char* validValues[] = { +{% for enum_value in enum_values %} + "{{enum_value}}", +{% endfor %} +}; +{%-endmacro %} diff --git a/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp b/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp index c6b6d13..366c91f 100644 --- a/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp +++ b/third_party/WebKit/Source/bindings/templates/dictionary_v8.cpp @@ -1,3 +1,4 @@ +{% from 'conversions.cpp' import declare_enum_validation_variable %} // Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -62,12 +63,10 @@ void {{v8_class}}::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, {{ return; } {% endif %} - {% if member.enum_validation_expression %} - String string = {{member.name}}; - if (!({{member.enum_validation_expression}})) { - exceptionState.throwTypeError("member {{member.name}} ('" + string + "') is not a valid enum value."); + {% if member.enum_values %} + {{declare_enum_validation_variable(member.enum_values) | indent(8)}} + if (!isValidEnum({{member.name}}, validValues, WTF_ARRAY_LENGTH(validValues), exceptionState)) return; - } {% elif member.is_object %} if (!{{member.name}}.isObject()) { exceptionState.throwTypeError("member {{member.name}} is not an object."); diff --git a/third_party/WebKit/Source/bindings/templates/methods.cpp b/third_party/WebKit/Source/bindings/templates/methods.cpp index 865271c..ba5af8fc 100644 --- a/third_party/WebKit/Source/bindings/templates/methods.cpp +++ b/third_party/WebKit/Source/bindings/templates/methods.cpp @@ -1,4 +1,4 @@ -{% from 'conversions.cpp' import v8_value_to_local_cpp_value %} +{% from 'conversions.cpp' import declare_enum_validation_variable, v8_value_to_local_cpp_value %} {##############################################################################} @@ -196,13 +196,12 @@ if (!{{argument.name}}{% if argument.is_nullable %} && !isUndefinedOrNull(info[{ {{throw_type_error(method, '"parameter %s is not of type \'%s\'."' % (argument.index + 1, argument.idl_type)) | indent}} } -{% elif argument.enum_validation_expression %} +{% elif argument.enum_values %} {# Invalid enum values: http://www.w3.org/TR/WebIDL/#idl-enums #} -String string = {{argument.name}}; -if (!({{argument.enum_validation_expression}})) { - {{throw_type_error(method, - '"parameter %s (\'" + string + "\') is not a valid enum value."' % - (argument.index + 1)) | indent}} +{{declare_enum_validation_variable(argument.enum_values)}} +if (!isValidEnum({{argument.name}}, validValues, WTF_ARRAY_LENGTH(validValues), exceptionState)) { + exceptionState.throwIfNeeded(); + return; } {% elif argument.idl_type == 'Promise' %} {# We require this for our implementation of promises, though not in spec: diff --git a/third_party/WebKit/Source/bindings/templates/union.cpp b/third_party/WebKit/Source/bindings/templates/union.cpp index 3191d5e..9803119 100644 --- a/third_party/WebKit/Source/bindings/templates/union.cpp +++ b/third_party/WebKit/Source/bindings/templates/union.cpp @@ -1,3 +1,4 @@ +{% from 'conversions.cpp' import declare_enum_validation_variable %} // Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -37,9 +38,10 @@ namespace blink { void {{container.cpp_class}}::set{{member.type_name}}({{member.rvalue_cpp_type}} value) { ASSERT(isNull()); - {% if member.enum_validation_expression %} - String string = value; - if (!({{member.enum_validation_expression}})) { + {% if member.enum_values %} + NonThrowableExceptionState exceptionState; + {{declare_enum_validation_variable(member.enum_values) | indent}} + if (!isValidEnum(value, validValues, WTF_ARRAY_LENGTH(validValues), exceptionState)) { ASSERT_NOT_REACHED(); return; } @@ -136,12 +138,10 @@ void V8{{container.cpp_class}}::toImpl(v8::Isolate* isolate, v8::Local<v8::Value {# 16. String #} { {{v8_value_to_local_cpp_value(container.string_type) | indent(8)}} - {% if container.string_type.enum_validation_expression %} - String string = cppValue; - if (!({{container.string_type.enum_validation_expression}})) { - exceptionState.throwTypeError("'" + string + "' is not a valid enum value."); + {% if container.string_type.enum_values %} + {{declare_enum_validation_variable(container.string_type.enum_values) | indent(8)}} + if (!isValidEnum(cppValue, validValues, WTF_ARRAY_LENGTH(validValues), exceptionState)) return; - } {% endif %} impl.set{{container.string_type.type_name}}(cppValue); return; diff --git a/third_party/WebKit/Source/bindings/tests/idls/core/TestDictionary.idl b/third_party/WebKit/Source/bindings/tests/idls/core/TestDictionary.idl index 1b429dd..7e8481d 100644 --- a/third_party/WebKit/Source/bindings/tests/idls/core/TestDictionary.idl +++ b/third_party/WebKit/Source/bindings/tests/idls/core/TestDictionary.idl @@ -19,6 +19,7 @@ dictionary TestDictionary { DOMString[] stringArrayMember; sequence<DOMString> stringSequenceMember; TestEnum enumMember = "foo"; + sequence<TestEnum> enumSequenceMember; Element? elementOrNullMember; object objectMember; object? objectOrNullMember; diff --git a/third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.h b/third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.h index 787573a..9694301 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.h +++ b/third_party/WebKit/Source/bindings/tests/results/core/TestDictionary.h @@ -55,6 +55,10 @@ public: String enumMember() const { return m_enumMember; } void setEnumMember(String value) { m_enumMember = value; } + bool hasEnumSequenceMember() const { return !m_enumSequenceMember.isNull(); } + const Vector<String>& enumSequenceMember() const { return m_enumSequenceMember.get(); } + void setEnumSequenceMember(const Vector<String>& value) { m_enumSequenceMember = value; } + bool hasEventTargetMember() const { return m_eventTargetMember; } PassRefPtrWillBeRawPtr<EventTarget> eventTargetMember() const { return m_eventTargetMember; } void setEventTargetMember(PassRefPtrWillBeRawPtr<EventTarget> value) { m_eventTargetMember = value; } @@ -149,6 +153,7 @@ private: DoubleOrString m_doubleOrStringMember; RefPtrWillBeMember<Element> m_elementOrNullMember; String m_enumMember; + Nullable<Vector<String>> m_enumSequenceMember; RefPtrWillBeMember<EventTarget> m_eventTargetMember; Nullable<Vector<InternalDictionary>> m_internalDictionarySequenceMember; Nullable<int> m_longMember; diff --git a/third_party/WebKit/Source/bindings/tests/results/core/UnionTypesCore.cpp b/third_party/WebKit/Source/bindings/tests/results/core/UnionTypesCore.cpp index 8e9f21d..80dd50b 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/UnionTypesCore.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/UnionTypesCore.cpp @@ -758,8 +758,14 @@ String TestEnumOrDouble::getAsTestEnum() const void TestEnumOrDouble::setTestEnum(String value) { ASSERT(isNull()); - String string = value; - if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3")) { + NonThrowableExceptionState exceptionState; + static const char* validValues[] = { + "", + "EnumValue1", + "EnumValue2", + "EnumValue3", + }; + if (!isValidEnum(value, validValues, WTF_ARRAY_LENGTH(validValues), exceptionState)) { ASSERT_NOT_REACHED(); return; } @@ -811,11 +817,14 @@ void V8TestEnumOrDouble::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Val V8StringResource<> cppValue = v8Value; if (!cppValue.prepare(exceptionState)) return; - String string = cppValue; - if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3")) { - exceptionState.throwTypeError("'" + string + "' is not a valid enum value."); + static const char* validValues[] = { + "", + "EnumValue1", + "EnumValue2", + "EnumValue3", + }; + if (!isValidEnum(cppValue, validValues, WTF_ARRAY_LENGTH(validValues), exceptionState)) return; - } impl.setTestEnum(cppValue); return; } diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp index 62cd43d..55b39d7 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestDictionary.cpp @@ -130,14 +130,39 @@ void V8TestDictionary::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value V8StringResource<> enumMember = enumMemberValue; if (!enumMember.prepare(exceptionState)) return; - String string = enumMember; - if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3")) { - exceptionState.throwTypeError("member enumMember ('" + string + "') is not a valid enum value."); + static const char* validValues[] = { + "", + "EnumValue1", + "EnumValue2", + "EnumValue3", + }; + if (!isValidEnum(enumMember, validValues, WTF_ARRAY_LENGTH(validValues), exceptionState)) return; - } impl.setEnumMember(enumMember); } + v8::Local<v8::Value> enumSequenceMemberValue = v8Object->Get(v8String(isolate, "enumSequenceMember")); + if (block.HasCaught()) { + exceptionState.rethrowV8Exception(block.Exception()); + return; + } + if (enumSequenceMemberValue.IsEmpty() || enumSequenceMemberValue->IsUndefined()) { + // Do nothing. + } else { + Vector<String> enumSequenceMember = toImplArray<String>(enumSequenceMemberValue, 0, isolate, exceptionState); + if (exceptionState.hadException()) + return; + static const char* validValues[] = { + "", + "EnumValue1", + "EnumValue2", + "EnumValue3", + }; + if (!isValidEnum(enumSequenceMember, validValues, WTF_ARRAY_LENGTH(validValues), exceptionState)) + return; + impl.setEnumSequenceMember(enumSequenceMember); + } + v8::Local<v8::Value> eventTargetMemberValue = v8Object->Get(v8String(isolate, "eventTargetMember")); if (block.HasCaught()) { exceptionState.rethrowV8Exception(block.Exception()); @@ -495,6 +520,10 @@ void toV8TestDictionary(const TestDictionary& impl, v8::Local<v8::Object> dictio dictionary->Set(v8String(isolate, "enumMember"), v8String(isolate, String("foo"))); } + if (impl.hasEnumSequenceMember()) { + dictionary->Set(v8String(isolate, "enumSequenceMember"), toV8(impl.enumSequenceMember(), creationContext, isolate)); + } + if (impl.hasEventTargetMember()) { dictionary->Set(v8String(isolate, "eventTargetMember"), toV8(impl.eventTargetMember(), creationContext, isolate)); } diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp index f7c0727..ccb0e1e 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp @@ -276,13 +276,19 @@ static void testEnumAttributeAttributeGetterCallback(v8::Local<v8::Name>, const static void testEnumAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) { v8::Local<v8::Object> holder = info.Holder(); + ExceptionState exceptionState(ExceptionState::SetterContext, "testEnumAttribute", "TestInterface", holder, info.GetIsolate()); TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); V8StringResource<> cppValue = v8Value; if (!cppValue.prepare()) return; - String string = cppValue; - if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3")) { - currentExecutionContext(info.GetIsolate())->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "The provided value '" + string + "' is not a valid value of type 'TestEnum'.")); + static const char* validValues[] = { + "", + "EnumValue1", + "EnumValue2", + "EnumValue3", + }; + if (!isValidEnum(cppValue, validValues, WTF_ARRAY_LENGTH(validValues), exceptionState)) { + currentExecutionContext(info.GetIsolate())->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, exceptionState.message())); return; } impl->setTestEnumAttribute(cppValue); @@ -958,13 +964,17 @@ static void partialPartialEnumTypeAttributeAttributeGetterCallback(v8::Local<v8: static void partialPartialEnumTypeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) { v8::Local<v8::Object> holder = info.Holder(); + ExceptionState exceptionState(ExceptionState::SetterContext, "partialPartialEnumTypeAttribute", "TestInterface", holder, info.GetIsolate()); TestInterfaceImplementation* impl = V8TestInterface::toImpl(holder); V8StringResource<> cppValue = v8Value; if (!cppValue.prepare()) return; - String string = cppValue; - if (!(string == "foo" || string == "bar")) { - currentExecutionContext(info.GetIsolate())->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "The provided value '" + string + "' is not a valid value of type 'PartialEnumType'.")); + static const char* validValues[] = { + "foo", + "bar", + }; + if (!isValidEnum(cppValue, validValues, WTF_ARRAY_LENGTH(validValues), exceptionState)) { + currentExecutionContext(info.GetIsolate())->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, exceptionState.message())); return; } TestPartialInterface::setPartialPartialEnumTypeAttribute(*impl, cppValue); @@ -1168,8 +1178,10 @@ static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCallback(co static void voidMethodTestEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { + ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodTestEnumArg", "TestInterface", info.Holder(), info.GetIsolate()); if (UNLIKELY(info.Length() < 1)) { - V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(info.GetIsolate(), "voidMethodTestEnumArg", "TestInterface", 1, info.Length()), info.GetIsolate()); + setMinimumArityTypeError(exceptionState, 1, info.Length()); + exceptionState.throwIfNeeded(); return; } TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); @@ -1178,9 +1190,14 @@ static void voidMethodTestEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value testEnumArg = info[0]; if (!testEnumArg.prepare()) return; - String string = testEnumArg; - if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3")) { - V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodTestEnumArg", "TestInterface", "parameter 1 ('" + string + "') is not a valid enum value.")); + static const char* validValues[] = { + "", + "EnumValue1", + "EnumValue2", + "EnumValue3", + }; + if (!isValidEnum(testEnumArg, validValues, WTF_ARRAY_LENGTH(validValues), exceptionState)) { + exceptionState.throwIfNeeded(); return; } } diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp index 9f7655c..61d7038a 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp @@ -1719,13 +1719,19 @@ static void testEnumAttributeAttributeGetterCallback(v8::Local<v8::Name>, const static void testEnumAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) { v8::Local<v8::Object> holder = info.Holder(); + ExceptionState exceptionState(ExceptionState::SetterContext, "testEnumAttribute", "TestObject", holder, info.GetIsolate()); TestObject* impl = V8TestObject::toImpl(holder); V8StringResource<> cppValue = v8Value; if (!cppValue.prepare()) return; - String string = cppValue; - if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3")) { - currentExecutionContext(info.GetIsolate())->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "The provided value '" + string + "' is not a valid value of type 'TestEnum'.")); + static const char* validValues[] = { + "", + "EnumValue1", + "EnumValue2", + "EnumValue3", + }; + if (!isValidEnum(cppValue, validValues, WTF_ARRAY_LENGTH(validValues), exceptionState)) { + currentExecutionContext(info.GetIsolate())->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, exceptionState.message())); return; } impl->setTestEnumAttribute(cppValue); @@ -1755,13 +1761,19 @@ static void testEnumOrNullAttributeAttributeGetterCallback(v8::Local<v8::Name>, static void testEnumOrNullAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) { v8::Local<v8::Object> holder = info.Holder(); + ExceptionState exceptionState(ExceptionState::SetterContext, "testEnumOrNullAttribute", "TestObject", holder, info.GetIsolate()); TestObject* impl = V8TestObject::toImpl(holder); V8StringResource<TreatNullAsNullString> cppValue = v8Value; if (!cppValue.prepare()) return; - String string = cppValue; - if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3")) { - currentExecutionContext(info.GetIsolate())->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "The provided value '" + string + "' is not a valid value of type 'TestEnum'.")); + static const char* validValues[] = { + "", + "EnumValue1", + "EnumValue2", + "EnumValue3", + }; + if (!isValidEnum(cppValue, validValues, WTF_ARRAY_LENGTH(validValues), exceptionState)) { + currentExecutionContext(info.GetIsolate())->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, exceptionState.message())); return; } impl->setTestEnumOrNullAttribute(cppValue); @@ -5530,13 +5542,19 @@ static void enumForPrivateScriptAttributeGetterCallback(v8::Local<v8::Name>, con static void enumForPrivateScriptAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) { v8::Local<v8::Object> holder = info.Holder(); + ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivateScript", "TestObject", holder, info.GetIsolate()); TestObject* impl = V8TestObject::toImpl(holder); V8StringResource<> cppValue = v8Value; if (!cppValue.prepare()) return; - String string = cppValue; - if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3")) { - currentExecutionContext(info.GetIsolate())->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, "The provided value '" + string + "' is not a valid value of type 'TestEnum'.")); + static const char* validValues[] = { + "", + "EnumValue1", + "EnumValue2", + "EnumValue3", + }; + if (!isValidEnum(cppValue, validValues, WTF_ARRAY_LENGTH(validValues), exceptionState)) { + currentExecutionContext(info.GetIsolate())->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, exceptionState.message())); return; } V8TestObject::PrivateScript::enumForPrivateScriptAttributeSetter(toLocalFrame(toFrameIfNotDetached(info.GetIsolate()->GetCurrentContext())), impl, cppValue); @@ -7389,8 +7407,10 @@ static void testEnumMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Valu static void voidMethodTestEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { + ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodTestEnumArg", "TestObject", info.Holder(), info.GetIsolate()); if (UNLIKELY(info.Length() < 1)) { - V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(info.GetIsolate(), "voidMethodTestEnumArg", "TestObject", 1, info.Length()), info.GetIsolate()); + setMinimumArityTypeError(exceptionState, 1, info.Length()); + exceptionState.throwIfNeeded(); return; } TestObject* impl = V8TestObject::toImpl(info.Holder()); @@ -7399,9 +7419,14 @@ static void voidMethodTestEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value testEnumTypeArg = info[0]; if (!testEnumTypeArg.prepare()) return; - String string = testEnumTypeArg; - if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3")) { - V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("voidMethodTestEnumArg", "TestObject", "parameter 1 ('" + string + "') is not a valid enum value.")); + static const char* validValues[] = { + "", + "EnumValue1", + "EnumValue2", + "EnumValue3", + }; + if (!isValidEnum(testEnumTypeArg, validValues, WTF_ARRAY_LENGTH(validValues), exceptionState)) { + exceptionState.throwIfNeeded(); return; } } diff --git a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp index 96f1305..aefe719 100644 --- a/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterfacePartial.cpp @@ -222,8 +222,10 @@ static void partial2VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& static void partialVoidTestEnumModulesArgMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { + ExceptionState exceptionState(ExceptionState::ExecutionContext, "partialVoidTestEnumModulesArgMethod", "TestInterface", info.Holder(), info.GetIsolate()); if (UNLIKELY(info.Length() < 1)) { - V8ThrowException::throwException(createMinimumArityTypeErrorForMethod(info.GetIsolate(), "partialVoidTestEnumModulesArgMethod", "TestInterface", 1, info.Length()), info.GetIsolate()); + setMinimumArityTypeError(exceptionState, 1, info.Length()); + exceptionState.throwIfNeeded(); return; } TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); @@ -232,9 +234,12 @@ static void partialVoidTestEnumModulesArgMethodMethod(const v8::FunctionCallback arg = info[0]; if (!arg.prepare()) return; - String string = arg; - if (!(string == "EnumModulesValue1" || string == "EnumModulesValue2")) { - V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::failedToExecute("partialVoidTestEnumModulesArgMethod", "TestInterface", "parameter 1 ('" + string + "') is not a valid enum value.")); + static const char* validValues[] = { + "EnumModulesValue1", + "EnumModulesValue2", + }; + if (!isValidEnum(arg, validValues, WTF_ARRAY_LENGTH(validValues), exceptionState)) { + exceptionState.throwIfNeeded(); return; } } diff --git a/third_party/WebKit/Source/core/testing/DictionaryTest.cpp b/third_party/WebKit/Source/core/testing/DictionaryTest.cpp index 19dac4d..07d1251 100644 --- a/third_party/WebKit/Source/core/testing/DictionaryTest.cpp +++ b/third_party/WebKit/Source/core/testing/DictionaryTest.cpp @@ -51,6 +51,8 @@ void DictionaryTest::set(const InternalDictionary& testingDictionary) m_enumMember = testingDictionary.enumMember(); m_enumMemberWithDefault = testingDictionary.enumMemberWithDefault(); m_enumOrNullMember = testingDictionary.enumOrNullMember(); + if (testingDictionary.hasEnumArrayMember()) + m_enumArrayMember = testingDictionary.enumArrayMember(); if (testingDictionary.hasElementMember()) m_elementMember = testingDictionary.elementMember(); if (testingDictionary.hasElementOrNullMember()) @@ -92,6 +94,8 @@ void DictionaryTest::get(InternalDictionary& result) result.setEnumMember(m_enumMember); result.setEnumMemberWithDefault(m_enumMemberWithDefault); result.setEnumOrNullMember(m_enumOrNullMember); + if (m_enumArrayMember) + result.setEnumArrayMember(m_enumArrayMember.get()); if (m_elementMember) result.setElementMember(m_elementMember); if (m_elementOrNullMember) @@ -136,6 +140,7 @@ void DictionaryTest::reset() m_enumMember = String(); m_enumMemberWithDefault = String(); m_enumOrNullMember = String(); + m_enumArrayMember = nullptr; m_elementMember = nullptr; m_elementOrNullMember = nullptr; m_objectMember = ScriptValue(); diff --git a/third_party/WebKit/Source/core/testing/DictionaryTest.h b/third_party/WebKit/Source/core/testing/DictionaryTest.h index 722bb8f..fdb9c5e 100644 --- a/third_party/WebKit/Source/core/testing/DictionaryTest.h +++ b/third_party/WebKit/Source/core/testing/DictionaryTest.h @@ -65,6 +65,7 @@ private: String m_enumMember; String m_enumMemberWithDefault; String m_enumOrNullMember; + Nullable<Vector<String>> m_enumArrayMember; RefPtrWillBeMember<Element> m_elementMember; RefPtrWillBeMember<Element> m_elementOrNullMember; ScriptValue m_objectMember; diff --git a/third_party/WebKit/Source/core/testing/InternalDictionary.idl b/third_party/WebKit/Source/core/testing/InternalDictionary.idl index 594d129..db50184 100644 --- a/third_party/WebKit/Source/core/testing/InternalDictionary.idl +++ b/third_party/WebKit/Source/core/testing/InternalDictionary.idl @@ -25,6 +25,7 @@ dictionary InternalDictionary { InternalEnum enumMember; InternalEnum enumMemberWithDefault = "foo"; InternalEnum? enumOrNullMember; + InternalEnum[] enumArrayMember; Element elementMember; Element? elementOrNullMember; object objectMember; |