Changeset 97836 in webkit
- Timestamp:
- Oct 18, 2011 11:57:36 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r97831 r97836 1 2011-10-18 Kentaro Hara <haraken@chromium.org> 2 3 Generate a SharedWorker constructor of V8 using [Constructor] IDL 4 https://bugs.webkit.org/show_bug.cgi?id=67879 5 6 Reviewed by Hajime Morita. 7 8 Added test cases for an undefined name and a null name on SharedWorker constructor. 9 10 * fast/workers/resources/shared-worker-name.js: 11 (test7.try.worker.port.onmessage): 12 (test7): A test case for a null name. 13 (test8.worker.port.onmessage): 14 (test8): Ditto. 15 (test9.try.worker.port.onmessage): 16 (test9): A test case for an undefined name. 17 (test10.worker.port.onmessage): 18 (test10): Ditto. 19 * fast/workers/shared-worker-constructor-expected.txt: 20 * fast/workers/shared-worker-constructor.html: 21 * fast/workers/shared-worker-name-expected.txt: 22 * platform/chromium-win/fast/workers/shared-worker-constructor-expected.txt: Updated SyntaxError with TypeError. The reason why ui_tests has been so far working without updating this error type is that shared-worker-constructor.html is marked FLAKY in chromium. 23 1 24 2011-10-18 Johnny Ding <jnd@chromium.org> 2 25 -
trunk/LayoutTests/fast/workers/resources/shared-worker-name.js
r48666 r97836 19 19 done(); 20 20 } 21 22 23 21 24 22 function test1() … … 94 92 } 95 93 94 function test7() 95 { 96 // Make sure we can create a shared worker with name 'null'. 97 try { 98 var worker = new SharedWorker('resources/shared-worker-common.js', 'null'); 99 testPassed("created SharedWorker with name 'null'"); 100 worker.port.postMessage("eval self.foo = 5678"); 101 worker.port.onmessage = function(event) { 102 shouldBeEqual("setting self.foo", event.data, "self.foo = 5678: 5678"); 103 nextTest(); 104 }; 105 } catch (e) { 106 testFailed("SharedWorker with name 'null' threw an exception: " + e); 107 done(); 108 } 109 } 110 111 function test8() 112 { 113 // Creating a worker with a null name should match an existing worker with name 'null' 114 var worker = new SharedWorker('resources/shared-worker-common.js', null); 115 worker.port.postMessage("eval self.foo"); 116 worker.port.onmessage = function(event) { 117 shouldBeEqual("creating worker with a null name", event.data, "self.foo: 5678"); 118 nextTest(); 119 } 120 } 121 122 function test9() 123 { 124 // Make sure we can create a shared worker with name 'undefined'. 125 try { 126 var worker = new SharedWorker('resources/shared-worker-common.js', 'undefined'); 127 testPassed("created SharedWorker with name 'undefined'"); 128 worker.port.postMessage("eval self.foo = 1111"); 129 worker.port.onmessage = function(event) { 130 shouldBeEqual("setting self.foo", event.data, "self.foo = 1111: 1111"); 131 nextTest(); 132 }; 133 } catch (e) { 134 testFailed("SharedWorker with name 'undefined' threw an exception: " + e); 135 done(); 136 } 137 } 138 139 function test10() 140 { 141 // Creating a worker with an undefined name should match an existing worker with name 'undefined' 142 var worker = new SharedWorker('resources/shared-worker-common.js', undefined); 143 worker.port.postMessage("eval self.foo"); 144 worker.port.onmessage = function(event) { 145 shouldBeEqual("creating worker with an undefined name", event.data, "self.foo: 1111"); 146 nextTest(); 147 } 148 } 149 96 150 function shouldBeEqual(description, a, b) 97 151 { -
trunk/LayoutTests/fast/workers/shared-worker-constructor-expected.txt
r93339 r97836 5 5 PASS: invoking SharedWorker constructor without arguments resulted in an exception (TypeError: Not enough arguments) 6 6 PASS: invoking SharedWorker constructor without name did not result in an exception 7 PASS: invoking SharedWorker constructor with null name did not result in an exception 8 PASS: invoking SharedWorker constructor with undefined name did not result in an exception 7 9 PASS: SharedWorker constructor succeeded: [object SharedWorker] 8 10 DONE -
trunk/LayoutTests/fast/workers/shared-worker-constructor.html
r48666 r97836 46 46 47 47 try { 48 new SharedWorker("resources/shared-worker-common.js", null); 49 log("PASS: invoking SharedWorker constructor with null name did not result in an exception"); 50 } catch (ex) { 51 log("FAIL: invoking SharedWorker constructor with null name resulted in an exception (" + ex + ")"); 52 } 53 54 try { 55 new SharedWorker("resources/shared-worker-common.js", undefined); 56 log("PASS: invoking SharedWorker constructor with undefined name did not result in an exception"); 57 } catch (ex) { 58 log("FAIL: invoking SharedWorker constructor with undefined name resulted in an exception (" + ex + ")"); 59 } 60 61 try { 48 62 var worker = new SharedWorker("resources/shared-worker-common.js", "name"); 49 63 log ("PASS: SharedWorker constructor succeeded: " + worker); -
trunk/LayoutTests/fast/workers/shared-worker-name-expected.txt
r48666 r97836 11 11 PASS creating no-name worker with alternate URL 12 12 PASS creating empty name worker with alternate URL 13 PASS created SharedWorker with name 'null' 14 PASS setting self.foo 15 PASS creating worker with a null name 16 PASS created SharedWorker with name 'undefined' 17 PASS setting self.foo 18 PASS creating worker with an undefined name 13 19 14 20 TEST COMPLETE -
trunk/LayoutTests/platform/chromium-win/fast/workers/shared-worker-constructor-expected.txt
r56268 r97836 3 3 PASS: toString exception propagated correctly. 4 4 PASS: trying to create workers recursively resulted in an exception (RangeError: Maximum call stack size exceeded) 5 PASS: invoking SharedWorker constructor without arguments resulted in an exception ( SyntaxError: Not enough arguments)5 PASS: invoking SharedWorker constructor without arguments resulted in an exception (TypeError: Not enough arguments) 6 6 PASS: invoking SharedWorker constructor without name did not result in an exception 7 PASS: invoking SharedWorker constructor with null name did not result in an exception 8 PASS: invoking SharedWorker constructor with undefined name did not result in an exception 7 9 PASS: SharedWorker constructor succeeded: [object SharedWorker] 8 10 DONE -
trunk/Source/WebCore/ChangeLog
r97831 r97836 1 2011-10-18 Kentaro Hara <haraken@chromium.org> 2 3 Generate a SharedWorker constructor of V8 using [Constructor] IDL 4 https://bugs.webkit.org/show_bug.cgi?id=67879 5 6 Reviewed by Hajime Morita. 7 8 Spec: http://dev.w3.org/html5/workers/#shared-workers-and-the-sharedworker-interface 9 This patch changed SharedWorker::create(..., context, ec) to 10 SharedWorker::create(context, ..., ec), since a parameter specified by [CallWith] 11 should come at the beginning (c.f. bug 69799). 12 13 Test: ui_tests:WorkerTest.FLAKY_SharedWorkerFastConstructor 14 ui_tests:WorkerTest.FLAKY_SharedWorkerFastName 15 16 * WebCore.gypi: Removed bindings/v8/custom/V8SharedWorkerCustom.cpp 17 * WebCore.pro: Ditto. 18 * bindings/js/JSSharedWorkerCustom.cpp: Moved ScriptExecutionContext parameter to the beginning. 19 (WebCore::JSSharedWorkerConstructor::constructJSSharedWorker): 20 * bindings/v8/custom/V8SharedWorkerCustom.cpp: Removed. 21 * workers/SharedWorker.cpp: Moved ScriptExecutionContext parameter to the beginning. 22 (WebCore::SharedWorker::create): Ditto. 23 * workers/SharedWorker.h: Ditto. 24 * workers/SharedWorker.idl: Added [Constructor] IDL. 25 1 26 2011-10-18 Johnny Ding <jnd@chromium.org> 2 27 -
trunk/Source/WebCore/WebCore.gypi
r97818 r97836 2232 2232 'bindings/v8/custom/V8ScriptProfileCustom.cpp', 2233 2233 'bindings/v8/custom/V8ScriptProfileNodeCustom.cpp', 2234 'bindings/v8/custom/V8SharedWorkerCustom.cpp',2235 2234 'bindings/v8/custom/V8StorageCustom.cpp', 2236 2235 'bindings/v8/custom/V8StyleSheetCustom.cpp', -
trunk/Source/WebCore/WebCore.pro
r97812 r97836 204 204 bindings/v8/custom/V8WebSocketCustom.cpp \ 205 205 \ 206 bindings/v8/custom/V8SharedWorkerCustom.cpp \207 206 bindings/v8/custom/V8StorageCustom.cpp \ 208 207 bindings/v8/custom/V8StyleSheetCustom.cpp \ -
trunk/Source/WebCore/bindings/js/JSSharedWorkerCustom.cpp
r96346 r97836 74 74 DOMWindow* window = asJSDOMWindow(exec->lexicalGlobalObject())->impl(); 75 75 ExceptionCode ec = 0; 76 RefPtr<SharedWorker> worker = SharedWorker::create( ustringToString(scriptURL), ustringToString(name), window->document(), ec);76 RefPtr<SharedWorker> worker = SharedWorker::create(window->document(), ustringToString(scriptURL), ustringToString(name), ec); 77 77 if (ec) { 78 78 setDOMException(exec, ec); -
trunk/Source/WebCore/workers/SharedWorker.cpp
r95901 r97836 50 50 } 51 51 52 PassRefPtr<SharedWorker> SharedWorker::create( const String& url, const String& name, ScriptExecutionContext* context, ExceptionCode& ec)52 PassRefPtr<SharedWorker> SharedWorker::create(ScriptExecutionContext* context, const String& url, const String& name, ExceptionCode& ec) 53 53 { 54 54 RefPtr<SharedWorker> worker = adoptRef(new SharedWorker(context)); -
trunk/Source/WebCore/workers/SharedWorker.h
r95901 r97836 41 41 class SharedWorker : public AbstractWorker { 42 42 public: 43 static PassRefPtr<SharedWorker> create( const String& url, const String& name, ScriptExecutionContext*, ExceptionCode&);43 static PassRefPtr<SharedWorker> create(ScriptExecutionContext*, const String& url, const String& name, ExceptionCode&); 44 44 virtual ~SharedWorker(); 45 45 -
trunk/Source/WebCore/workers/SharedWorker.idl
r96788 r97836 36 36 ActiveDOMObject, 37 37 CanBeConstructed, 38 CustomConstructor,38 JSCustomConstructor, 39 39 ConstructorParameters=2, 40 Constructor(in DOMString scriptURL, in [Optional=CallWithNullValue] DOMString name), 41 CallWith=ScriptExecutionContext, 42 ConstructorRaisesException, 43 V8ConstructorSetsActiveDOMWrapper, 40 44 CustomMarkFunction, 41 45 GenerateNativeConverter,
Note: See TracChangeset
for help on using the changeset viewer.