005.html (554B)
1 <!doctype html> 2 <title>WebSockets: defineProperty getter for url</title> 3 <script src=/resources/testharness.js></script> 4 <script src=/resources/testharnessreport.js></script> 5 <script src=../../../constants.sub.js></script> 6 <meta name="variant" content="?default"> 7 <meta name="variant" content="?wss"> 8 <div id=log></div> 9 <script> 10 test(function() { 11 Object.defineProperty(WebSocket.prototype, 'url', { 12 get: function() { return 'foo'; } 13 }); 14 var ws = new WebSocket('ws://example.invalid/'); 15 assert_equals(ws.url, 'foo'); 16 }); 17 </script>