forked from WebKit/WebKit-http
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement the WebGLContextEvent constructor
https://bugs.webkit.org/show_bug.cgi?id=72856 Reviewed by Adam Barth. Source/WebCore: This patch makes WebGLContextEvent constructable. The spec: http://www.khronos.org/registry/webgl/specs/latest/#5.14 Test: fast/events/constructors/webgl-context-event-constructor.html * html/canvas/WebGLContextEvent.cpp: Added an implementation of the WebGLContextEvent constructor. (WebCore::WebGLContextEventInit::WebGLContextEventInit): (WebCore::WebGLContextEvent::WebGLContextEvent): * html/canvas/WebGLContextEvent.h: Added a definition of WebGLContextEventInit. (WebCore::WebGLContextEvent::create): * html/canvas/WebGLContextEvent.idl: Added [ConstructorTemplate=Event] IDL. LayoutTests: webgl-context-event-constructor.html checks the behavior of the WebGLContextEvent constructor. * fast/dom/constructed-objects-prototypes-expected.txt: Added window.WebGLContextEvent. * fast/events/constructors/webgl-context-event-constructor-expected.txt: Added. * fast/events/constructors/webgl-context-event-constructor.html: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@101183 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
haraken@chromium.org
committed
Nov 25, 2011
1 parent
4a03b17
commit b78f809
Showing
8 changed files
with
142 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
LayoutTests/fast/events/constructors/webgl-context-event-constructor-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
This tests the constructor for the WebGLContextEvent DOM class. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS new WebGLContextEvent('eventType').bubbles is false | ||
PASS new WebGLContextEvent('eventType').cancelable is false | ||
PASS new WebGLContextEvent('eventType').statusMessage is "" | ||
PASS new WebGLContextEvent('eventType', { bubbles: false }).bubbles is false | ||
PASS new WebGLContextEvent('eventType', { bubbles: true }).bubbles is true | ||
PASS new WebGLContextEvent('eventType', { cancelable: false }).cancelable is false | ||
PASS new WebGLContextEvent('eventType', { cancelable: true }).cancelable is true | ||
PASS new WebGLContextEvent('eventType', { statusMessage: 'abcde' }).statusMessage is "abcde" | ||
PASS new WebGLContextEvent('eventType', { statusMessage: '' }).statusMessage is "" | ||
PASS new WebGLContextEvent('eventType', { statusMessage: undefined }).statusMessage is "undefined" | ||
PASS new WebGLContextEvent('eventType', { statusMessage: null }).statusMessage is "null" | ||
PASS new WebGLContextEvent('eventType', { statusMessage: false }).statusMessage is "false" | ||
PASS new WebGLContextEvent('eventType', { statusMessage: true }).statusMessage is "true" | ||
PASS new WebGLContextEvent('eventType', { statusMessage: 12345 }).statusMessage is "12345" | ||
PASS new WebGLContextEvent('eventType', { statusMessage: 18446744073709551615 }).statusMessage is "18446744073709552000" | ||
PASS new WebGLContextEvent('eventType', { statusMessage: NaN }).statusMessage is "NaN" | ||
PASS new WebGLContextEvent('eventType', { statusMessage: [] }).statusMessage is "" | ||
PASS new WebGLContextEvent('eventType', { statusMessage: [1, 2, 3] }).statusMessage is "1,2,3" | ||
PASS new WebGLContextEvent('eventType', { statusMessage: {abcde: 12345} }).statusMessage is "[object Object]" | ||
PASS new WebGLContextEvent('eventType', { statusMessage: {valueOf: function () { return 'abcde'; } } }).statusMessage is "[object Object]" | ||
PASS new WebGLContextEvent('eventType', { bubbles: true, cancelable: true, statusMessage: 'abcde' }).bubbles is true | ||
PASS new WebGLContextEvent('eventType', { bubbles: true, cancelable: true, statusMessage: 'abcde' }).cancelable is true | ||
PASS new WebGLContextEvent('eventType', { bubbles: true, cancelable: true, statusMessage: 'abcde' }).statusMessage is 'abcde' | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
51 changes: 51 additions & 0 deletions
51
LayoutTests/fast/events/constructors/webgl-context-event-constructor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src="../../js/resources/js-test-pre.js"></script> | ||
</head> | ||
<body> | ||
<p id="description"></p> | ||
<div id="console"></div> | ||
<script> | ||
|
||
description("This tests the constructor for the WebGLContextEvent DOM class."); | ||
|
||
// No initializer is passed. | ||
shouldBe("new WebGLContextEvent('eventType').bubbles", "false"); | ||
shouldBe("new WebGLContextEvent('eventType').cancelable", "false"); | ||
shouldBeEqualToString("new WebGLContextEvent('eventType').statusMessage", ""); | ||
|
||
// bubbles is passed. | ||
shouldBe("new WebGLContextEvent('eventType', { bubbles: false }).bubbles", "false"); | ||
shouldBe("new WebGLContextEvent('eventType', { bubbles: true }).bubbles", "true"); | ||
|
||
// cancelable is passed. | ||
shouldBe("new WebGLContextEvent('eventType', { cancelable: false }).cancelable", "false"); | ||
shouldBe("new WebGLContextEvent('eventType', { cancelable: true }).cancelable", "true"); | ||
|
||
// statusMessage is passed. | ||
// Strings. | ||
shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: 'abcde' }).statusMessage", "abcde"); | ||
shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: '' }).statusMessage", ""); | ||
|
||
// Non-strings. | ||
shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: undefined }).statusMessage", "undefined"); | ||
shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: null }).statusMessage", "null"); | ||
shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: false }).statusMessage", "false"); | ||
shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: true }).statusMessage", "true"); | ||
shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: 12345 }).statusMessage", "12345"); | ||
shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: 18446744073709551615 }).statusMessage", "18446744073709552000"); | ||
shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: NaN }).statusMessage", "NaN"); | ||
shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: [] }).statusMessage", ""); | ||
shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: [1, 2, 3] }).statusMessage", "1,2,3"); | ||
shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: {abcde: 12345} }).statusMessage", "[object Object]"); | ||
shouldBeEqualToString("new WebGLContextEvent('eventType', { statusMessage: {valueOf: function () { return 'abcde'; } } }).statusMessage", "[object Object]"); | ||
|
||
// All initializers are passed. | ||
shouldBe("new WebGLContextEvent('eventType', { bubbles: true, cancelable: true, statusMessage: 'abcde' }).bubbles", "true"); | ||
shouldBe("new WebGLContextEvent('eventType', { bubbles: true, cancelable: true, statusMessage: 'abcde' }).cancelable", "true"); | ||
shouldBe("new WebGLContextEvent('eventType', { bubbles: true, cancelable: true, statusMessage: 'abcde' }).statusMessage", "'abcde'"); | ||
</script> | ||
<script src="../../js/resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters