зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1416151 - Moving websocket code and tests in dom/websocket, r=qdot
--HG-- rename : dom/base/WebSocket.cpp => dom/websocket/WebSocket.cpp rename : dom/base/WebSocket.h => dom/websocket/WebSocket.h rename : dom/base/test/file_bug1384658.html => dom/websocket/tests/file_bug1384658.html rename : dom/base/test/file_websocket_basic_wsh.py => dom/websocket/tests/file_websocket_basic_wsh.py rename : dom/base/test/file_websocket_bigBlob_wsh.py => dom/websocket/tests/file_websocket_bigBlob_wsh.py rename : dom/base/test/file_websocket_hello_wsh.py => dom/websocket/tests/file_websocket_hello_wsh.py rename : dom/base/test/file_websocket_http_resource.txt => dom/websocket/tests/file_websocket_http_resource.txt rename : dom/base/test/file_websocket_permessage_deflate_disabled_wsh.py => dom/websocket/tests/file_websocket_permessage_deflate_disabled_wsh.py rename : dom/base/test/file_websocket_permessage_deflate_params_wsh.py => dom/websocket/tests/file_websocket_permessage_deflate_params_wsh.py rename : dom/base/test/file_websocket_permessage_deflate_rejected_wsh.py => dom/websocket/tests/file_websocket_permessage_deflate_rejected_wsh.py rename : dom/base/test/file_websocket_permessage_deflate_wsh.py => dom/websocket/tests/file_websocket_permessage_deflate_wsh.py rename : dom/base/test/file_websocket_wsh.py => dom/websocket/tests/file_websocket_wsh.py rename : dom/base/test/frame_bug1384658.html => dom/websocket/tests/frame_bug1384658.html rename : dom/base/test/iframe_webSocket_sandbox.html => dom/websocket/tests/iframe_webSocket_sandbox.html rename : dom/base/test/test_bug1081686.html => dom/websocket/tests/test_bug1081686.html rename : dom/base/test/test_bug1384658.html => dom/websocket/tests/test_bug1384658.html rename : dom/base/test/test_webSocket_sandbox.html => dom/websocket/tests/test_webSocket_sandbox.html rename : dom/workers/test/test_webSocket_sharedWorker.html => dom/websocket/tests/test_webSocket_sharedWorker.html rename : dom/base/test/test_websocket1.html => dom/websocket/tests/test_websocket1.html rename : dom/base/test/test_websocket2.html => dom/websocket/tests/test_websocket2.html rename : dom/base/test/test_websocket3.html => dom/websocket/tests/test_websocket3.html rename : dom/base/test/test_websocket4.html => dom/websocket/tests/test_websocket4.html rename : dom/base/test/test_websocket5.html => dom/websocket/tests/test_websocket5.html rename : dom/base/test/test_websocket_basic.html => dom/websocket/tests/test_websocket_basic.html rename : dom/base/test/test_websocket_bigBlob.html => dom/websocket/tests/test_websocket_bigBlob.html rename : dom/base/test/test_websocket_frame.html => dom/websocket/tests/test_websocket_frame.html rename : dom/base/test/test_websocket_hello.html => dom/websocket/tests/test_websocket_hello.html rename : dom/base/test/test_websocket_permessage_deflate.html => dom/websocket/tests/test_websocket_permessage_deflate.html rename : dom/workers/test/test_websocket1.html => dom/websocket/tests/test_worker_websocket1.html rename : dom/workers/test/test_websocket2.html => dom/websocket/tests/test_worker_websocket2.html rename : dom/workers/test/test_websocket3.html => dom/websocket/tests/test_worker_websocket3.html rename : dom/workers/test/test_websocket4.html => dom/websocket/tests/test_worker_websocket4.html rename : dom/workers/test/test_websocket5.html => dom/websocket/tests/test_worker_websocket5.html rename : dom/workers/test/test_websocket_basic.html => dom/websocket/tests/test_worker_websocket_basic.html rename : dom/workers/test/test_websocket_https.html => dom/websocket/tests/test_worker_websocket_https.html rename : dom/workers/test/test_websocket_loadgroup.html => dom/websocket/tests/test_worker_websocket_loadgroup.html rename : dom/workers/test/webSocket_sharedWorker.js => dom/websocket/tests/webSocket_sharedWorker.js rename : dom/workers/test/websocket_basic_worker.js => dom/websocket/tests/websocket_basic_worker.js rename : dom/base/test/websocket_helpers.js => dom/websocket/tests/websocket_helpers.js rename : dom/workers/test/websocket_https_worker.js => dom/websocket/tests/websocket_https_worker.js rename : dom/base/test/websocket_hybi/file_binary-frames_wsh.py => dom/websocket/tests/websocket_hybi/file_binary-frames_wsh.py rename : dom/base/test/websocket_hybi/file_check-binary-messages_wsh.py => dom/websocket/tests/websocket_hybi/file_check-binary-messages_wsh.py rename : dom/base/test/websocket_hybi/mochitest.ini => dom/websocket/tests/websocket_hybi/mochitest.ini rename : dom/base/test/websocket_hybi/test_receive-arraybuffer.html => dom/websocket/tests/websocket_hybi/test_receive-arraybuffer.html rename : dom/base/test/websocket_hybi/test_receive-blob.html => dom/websocket/tests/websocket_hybi/test_receive-blob.html rename : dom/base/test/websocket_hybi/test_send-arraybuffer.html => dom/websocket/tests/websocket_hybi/test_send-arraybuffer.html rename : dom/base/test/websocket_hybi/test_send-blob.html => dom/websocket/tests/websocket_hybi/test_send-blob.html rename : dom/workers/test/websocket_loadgroup_worker.js => dom/websocket/tests/websocket_loadgroup_worker.js rename : dom/base/test/websocket_tests.js => dom/websocket/tests/websocket_tests.js rename : dom/workers/test/websocket_worker1.js => dom/websocket/tests/websocket_worker1.js rename : dom/workers/test/websocket_worker2.js => dom/websocket/tests/websocket_worker2.js rename : dom/workers/test/websocket_worker3.js => dom/websocket/tests/websocket_worker3.js rename : dom/workers/test/websocket_worker4.js => dom/websocket/tests/websocket_worker4.js rename : dom/workers/test/websocket_worker5.js => dom/websocket/tests/websocket_worker5.js rename : dom/workers/test/websocket_https.html => dom/websocket/tests/websocket_worker_https.html rename : dom/base/test/window_bug1384658.html => dom/websocket/tests/window_bug1384658.html
This commit is contained in:
Родитель
d6b8e1b490
Коммит
3794888bc4
|
@ -245,6 +245,7 @@ dom/vr/**
|
||||||
dom/webauthn/**
|
dom/webauthn/**
|
||||||
dom/webbrowserpersist/**
|
dom/webbrowserpersist/**
|
||||||
dom/webidl/**
|
dom/webidl/**
|
||||||
|
dom/websocket/**
|
||||||
dom/workers/**
|
dom/workers/**
|
||||||
dom/worklet/**
|
dom/worklet/**
|
||||||
dom/xbl/**
|
dom/xbl/**
|
||||||
|
|
|
@ -216,7 +216,6 @@ EXPORTS.mozilla.dom += [
|
||||||
'TimeoutManager.h',
|
'TimeoutManager.h',
|
||||||
'TreeWalker.h',
|
'TreeWalker.h',
|
||||||
'WebKitCSSMatrix.h',
|
'WebKitCSSMatrix.h',
|
||||||
'WebSocket.h',
|
|
||||||
'WindowOrientationObserver.h',
|
'WindowOrientationObserver.h',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -364,7 +363,6 @@ UNIFIED_SOURCES += [
|
||||||
'TimeoutManager.cpp',
|
'TimeoutManager.cpp',
|
||||||
'TreeWalker.cpp',
|
'TreeWalker.cpp',
|
||||||
'WebKitCSSMatrix.cpp',
|
'WebKitCSSMatrix.cpp',
|
||||||
'WebSocket.cpp',
|
|
||||||
'WindowNamedPropertiesHandler.cpp',
|
'WindowNamedPropertiesHandler.cpp',
|
||||||
'WindowOrientationObserver.cpp',
|
'WindowOrientationObserver.cpp',
|
||||||
'XPathGenerator.cpp',
|
'XPathGenerator.cpp',
|
||||||
|
|
|
@ -34,4 +34,3 @@ support-files = file_navigator_resolve_identity_xrays.xul
|
||||||
[test_sandboxed_blob_uri.html]
|
[test_sandboxed_blob_uri.html]
|
||||||
[test_sendQueryContentAndSelectionSetEvent.html]
|
[test_sendQueryContentAndSelectionSetEvent.html]
|
||||||
[test_urgent_start.html]
|
[test_urgent_start.html]
|
||||||
[test_websocket_frame.html]
|
|
||||||
|
|
|
@ -65,7 +65,6 @@ support-files =
|
||||||
file_bug1091883_frame.html
|
file_bug1091883_frame.html
|
||||||
file_bug1091883_subframe.html
|
file_bug1091883_subframe.html
|
||||||
file_bug1091883_target.html
|
file_bug1091883_target.html
|
||||||
file_bug1384658.html
|
|
||||||
file_bug28293.sjs
|
file_bug28293.sjs
|
||||||
file_bug326337.xml
|
file_bug326337.xml
|
||||||
file_bug326337_inner.html
|
file_bug326337_inner.html
|
||||||
|
@ -156,15 +155,6 @@ support-files =
|
||||||
file_timer_flood.html
|
file_timer_flood.html
|
||||||
file_viewport_scroll_quirks.html
|
file_viewport_scroll_quirks.html
|
||||||
file_viewport_scroll_xml.xml
|
file_viewport_scroll_xml.xml
|
||||||
file_websocket_basic_wsh.py
|
|
||||||
file_websocket_bigBlob_wsh.py
|
|
||||||
file_websocket_hello_wsh.py
|
|
||||||
file_websocket_http_resource.txt
|
|
||||||
file_websocket_permessage_deflate_wsh.py
|
|
||||||
file_websocket_permessage_deflate_disabled_wsh.py
|
|
||||||
file_websocket_permessage_deflate_rejected_wsh.py
|
|
||||||
file_websocket_permessage_deflate_params_wsh.py
|
|
||||||
file_websocket_wsh.py
|
|
||||||
file_x-frame-options_main.html
|
file_x-frame-options_main.html
|
||||||
file_x-frame-options_page.sjs
|
file_x-frame-options_page.sjs
|
||||||
file_xhtmlserializer_1.xhtml
|
file_xhtmlserializer_1.xhtml
|
||||||
|
@ -224,8 +214,6 @@ support-files =
|
||||||
file_bug1250148.sjs
|
file_bug1250148.sjs
|
||||||
file_bug1268962.sjs
|
file_bug1268962.sjs
|
||||||
mozbrowser_api_utils.js
|
mozbrowser_api_utils.js
|
||||||
websocket_helpers.js
|
|
||||||
websocket_tests.js
|
|
||||||
!/dom/security/test/cors/file_CrossSiteXHR_server.sjs
|
!/dom/security/test/cors/file_CrossSiteXHR_server.sjs
|
||||||
!/image/test/mochitest/blue.png
|
!/image/test/mochitest/blue.png
|
||||||
script_bug1238440.js
|
script_bug1238440.js
|
||||||
|
@ -250,8 +238,6 @@ support-files =
|
||||||
file4_setting_opener.html
|
file4_setting_opener.html
|
||||||
PASS.html
|
PASS.html
|
||||||
FAIL.html
|
FAIL.html
|
||||||
window_bug1384658.html
|
|
||||||
frame_bug1384658.html
|
|
||||||
|
|
||||||
[test_anchor_area_referrer.html]
|
[test_anchor_area_referrer.html]
|
||||||
[test_anchor_area_referrer_changing.html]
|
[test_anchor_area_referrer_changing.html]
|
||||||
|
@ -599,8 +585,6 @@ skip-if = stylo # bug 1293844
|
||||||
[test_bug1064481.html]
|
[test_bug1064481.html]
|
||||||
[test_bug1070015.html]
|
[test_bug1070015.html]
|
||||||
[test_bug1075702.html]
|
[test_bug1075702.html]
|
||||||
[test_bug1081686.html]
|
|
||||||
skip-if = toolkit == 'android'
|
|
||||||
[test_bug1091883.html]
|
[test_bug1091883.html]
|
||||||
[test_bug1101364.html]
|
[test_bug1101364.html]
|
||||||
skip-if = toolkit == 'android'
|
skip-if = toolkit == 'android'
|
||||||
|
@ -625,8 +609,6 @@ skip-if = toolkit == 'android'
|
||||||
[test_bug1318303.html]
|
[test_bug1318303.html]
|
||||||
[test_bug1375050.html]
|
[test_bug1375050.html]
|
||||||
[test_bug1381710.html]
|
[test_bug1381710.html]
|
||||||
[test_bug1384658.html]
|
|
||||||
skip-if = toolkit == 'android'
|
|
||||||
[test_bug1384661.html]
|
[test_bug1384661.html]
|
||||||
[test_bug1399603.html]
|
[test_bug1399603.html]
|
||||||
[test_bug1399605.html]
|
[test_bug1399605.html]
|
||||||
|
@ -805,27 +787,6 @@ skip-if = toolkit == 'android'
|
||||||
tags = audiochannel
|
tags = audiochannel
|
||||||
[test_webaudioNotificationStopOnNavigation.html]
|
[test_webaudioNotificationStopOnNavigation.html]
|
||||||
tags = audiochannel
|
tags = audiochannel
|
||||||
[test_websocket_basic.html]
|
|
||||||
skip-if = toolkit == 'android'
|
|
||||||
[test_websocket_hello.html]
|
|
||||||
skip-if = toolkit == 'android'
|
|
||||||
[test_websocket_permessage_deflate.html]
|
|
||||||
skip-if = toolkit == 'android'
|
|
||||||
[test_webSocket_sandbox.html]
|
|
||||||
skip-if = toolkit == 'android'
|
|
||||||
support-files = iframe_webSocket_sandbox.html
|
|
||||||
[test_websocket1.html]
|
|
||||||
skip-if = toolkit == 'android'
|
|
||||||
[test_websocket2.html]
|
|
||||||
skip-if = toolkit == 'android'
|
|
||||||
[test_websocket3.html]
|
|
||||||
skip-if = toolkit == 'android'
|
|
||||||
[test_websocket4.html]
|
|
||||||
skip-if = toolkit == 'android'
|
|
||||||
[test_websocket5.html]
|
|
||||||
skip-if = toolkit == 'android'
|
|
||||||
[test_websocket_bigBlob.html]
|
|
||||||
skip-if = toolkit == 'android'
|
|
||||||
[test_window_constructor.html]
|
[test_window_constructor.html]
|
||||||
[test_window_content.html]
|
[test_window_content.html]
|
||||||
[test_window_cross_origin_props.html]
|
[test_window_cross_origin_props.html]
|
||||||
|
|
|
@ -11,7 +11,6 @@ XPCSHELL_TESTS_MANIFESTS += [
|
||||||
|
|
||||||
MOCHITEST_MANIFESTS += [
|
MOCHITEST_MANIFESTS += [
|
||||||
'mochitest.ini',
|
'mochitest.ini',
|
||||||
'websocket_hybi/mochitest.ini',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
MOCHITEST_CHROME_MANIFESTS += [
|
MOCHITEST_CHROME_MANIFESTS += [
|
||||||
|
|
|
@ -108,6 +108,7 @@ DIRS += [
|
||||||
'worklet',
|
'worklet',
|
||||||
'script',
|
'script',
|
||||||
'payments',
|
'payments',
|
||||||
|
'websocket',
|
||||||
]
|
]
|
||||||
|
|
||||||
if CONFIG['OS_ARCH'] == 'WINNT':
|
if CONFIG['OS_ARCH'] == 'WINNT':
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||||
|
# vim: set filetype=python:
|
||||||
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
with Files("**"):
|
||||||
|
BUG_COMPONENT = ("Core", "DOM")
|
||||||
|
|
||||||
|
EXPORTS.mozilla.dom += [
|
||||||
|
'WebSocket.h',
|
||||||
|
]
|
||||||
|
|
||||||
|
UNIFIED_SOURCES += [
|
||||||
|
'WebSocket.cpp',
|
||||||
|
]
|
||||||
|
|
||||||
|
LOCAL_INCLUDES += [
|
||||||
|
'/dom/base',
|
||||||
|
'/dom/workers',
|
||||||
|
]
|
||||||
|
|
||||||
|
MOCHITEST_CHROME_MANIFESTS += [
|
||||||
|
'tests/chrome.ini',
|
||||||
|
]
|
||||||
|
|
||||||
|
MOCHITEST_MANIFESTS += [
|
||||||
|
'tests/mochitest.ini',
|
||||||
|
'tests/websocket_hybi/mochitest.ini',
|
||||||
|
]
|
||||||
|
|
||||||
|
include('/ipc/chromium/chromium-config.mozbuild')
|
||||||
|
|
||||||
|
FINAL_LIBRARY = 'xul'
|
|
@ -0,0 +1,4 @@
|
||||||
|
[DEFAULT]
|
||||||
|
skip-if = os == 'android'
|
||||||
|
|
||||||
|
[test_websocket_frame.html]
|
|
@ -8,7 +8,7 @@
|
||||||
bc.close();
|
bc.close();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
new WebSocket("ws://mochi.test:8888/tests/dom/base/test/file_websocket_basic");
|
new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_basic");
|
||||||
done(true); // no hang!
|
done(true); // no hang!
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
done(false);
|
done(false);
|
|
@ -23,7 +23,7 @@ if (location.search == '?nested') {
|
||||||
"</scr" + "ipt></html>";
|
"</scr" + "ipt></html>";
|
||||||
} else if (location.search == '?opener') {
|
} else if (location.search == '?opener') {
|
||||||
try{
|
try{
|
||||||
var socket = new WebSocket('ws://mochi.test:8888/tests/dom/base/test/file_websocket_basic');
|
var socket = new WebSocket('ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_basic');
|
||||||
socket.onerror = function(e) {
|
socket.onerror = function(e) {
|
||||||
opener.postMessage('WS onerror', '*');
|
opener.postMessage('WS onerror', '*');
|
||||||
close();
|
close();
|
||||||
|
@ -44,7 +44,7 @@ if (location.search == '?nested') {
|
||||||
ifr.srcdoc = `
|
ifr.srcdoc = `
|
||||||
<html><script>
|
<html><script>
|
||||||
try{
|
try{
|
||||||
var socket = new WebSocket('ws://mochi.test:8888/tests/dom/base/test/file_websocket_basic');
|
var socket = new WebSocket('ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_basic');
|
||||||
socket.onerror = function(e) {
|
socket.onerror = function(e) {
|
||||||
parent.postMessage('WS onerror', '*');
|
parent.postMessage('WS onerror', '*');
|
||||||
};
|
};
|
|
@ -0,0 +1,48 @@
|
||||||
|
[DEFAULT]
|
||||||
|
skip-if = toolkit == 'android' # bug 982828
|
||||||
|
support-files =
|
||||||
|
file_websocket_basic_wsh.py
|
||||||
|
file_websocket_hello_wsh.py
|
||||||
|
file_websocket_http_resource.txt
|
||||||
|
file_websocket_permessage_deflate_wsh.py
|
||||||
|
file_websocket_permessage_deflate_disabled_wsh.py
|
||||||
|
file_websocket_permessage_deflate_rejected_wsh.py
|
||||||
|
file_websocket_permessage_deflate_params_wsh.py
|
||||||
|
file_websocket_wsh.py
|
||||||
|
websocket_helpers.js
|
||||||
|
websocket_tests.js
|
||||||
|
websocket_worker_helpers.js
|
||||||
|
|
||||||
|
[test_bug1081686.html]
|
||||||
|
[test_bug1384658.html]
|
||||||
|
support-files = window_bug1384658.html frame_bug1384658.html file_bug1384658.html
|
||||||
|
[test_websocket1.html]
|
||||||
|
[test_websocket2.html]
|
||||||
|
[test_websocket3.html]
|
||||||
|
[test_websocket4.html]
|
||||||
|
[test_websocket5.html]
|
||||||
|
[test_websocket_basic.html]
|
||||||
|
[test_websocket_hello.html]
|
||||||
|
[test_websocket_permessage_deflate.html]
|
||||||
|
[test_webSocket_sandbox.html]
|
||||||
|
support-files = iframe_webSocket_sandbox.html
|
||||||
|
[test_worker_websocket1.html]
|
||||||
|
support-files = websocket_worker1.js
|
||||||
|
[test_worker_websocket2.html]
|
||||||
|
support-files = websocket_worker2.js
|
||||||
|
[test_worker_websocket3.html]
|
||||||
|
support-files = websocket_worker3.js
|
||||||
|
[test_worker_websocket4.html]
|
||||||
|
support-files = websocket_worker4.js
|
||||||
|
[test_worker_websocket5.html]
|
||||||
|
support-files = websocket_worker5.js
|
||||||
|
[test_worker_websocket_basic.html]
|
||||||
|
support-files = websocket_basic_worker.js
|
||||||
|
[test_worker_websocket_https.html]
|
||||||
|
support-files = websocket_worker_https.html websocket_https_worker.js
|
||||||
|
[test_worker_websocket_loadgroup.html]
|
||||||
|
support-files = websocket_loadgroup_worker.js
|
||||||
|
[test_webSocket_sharedWorker.html]
|
||||||
|
support-files = webSocket_sharedWorker.js
|
||||||
|
[test_websocket_bigBlob.html]
|
||||||
|
support-files = file_websocket_bigBlob_wsh.py
|
|
@ -27,7 +27,7 @@ function forcegc()
|
||||||
}
|
}
|
||||||
|
|
||||||
function testWebSocket () {
|
function testWebSocket () {
|
||||||
ws = new WebSocket("ws://mochi.test:8888/tests/dom/base/test/file_websocket_hello");
|
ws = new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_hello");
|
||||||
ws.onopen = function(e) {
|
ws.onopen = function(e) {
|
||||||
ws.send("data");
|
ws.send("data");
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ function testWebSocket () {
|
||||||
is(ws.binaryType, 'blob', 'WebSocket.binaryType is blob');
|
is(ws.binaryType, 'blob', 'WebSocket.binaryType is blob');
|
||||||
ws.binaryType = 'arraybuffer';
|
ws.binaryType = 'arraybuffer';
|
||||||
is(ws.binaryType, 'arraybuffer', 'WebSocket.binaryType is arraybuffer');
|
is(ws.binaryType, 'arraybuffer', 'WebSocket.binaryType is arraybuffer');
|
||||||
is(ws.url, 'ws://mochi.test:8888/tests/dom/base/test/file_websocket_hello', 'WebSocket.url is correct');
|
is(ws.url, 'ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_hello', 'WebSocket.url is correct');
|
||||||
ws.close();
|
ws.close();
|
||||||
ws.send('foobar');
|
ws.send('foobar');
|
||||||
SimpleTest.finish();
|
SimpleTest.finish();
|
|
@ -23,7 +23,7 @@ function test_frameset() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_window() {
|
function test_window() {
|
||||||
var win = window.open("http://example.com/tests/dom/base/test/window_bug1384658.html",
|
var win = window.open("http://example.com/tests/dom/websocket/tests/window_bug1384658.html",
|
||||||
"_blank", "width=100,height=100");
|
"_blank", "width=100,height=100");
|
||||||
var bc = new BroadcastChannel("test_channel");
|
var bc = new BroadcastChannel("test_channel");
|
||||||
bc.onmessage = ev => {
|
bc.onmessage = ev => {
|
|
@ -9,9 +9,9 @@
|
||||||
<div id="container"></div>
|
<div id="container"></div>
|
||||||
<iframe id="frame"></iframe>
|
<iframe id="frame"></iframe>
|
||||||
<script type="application/javascript;version=1.8">
|
<script type="application/javascript;version=1.8">
|
||||||
var urls = [ "https://example.com/tests/dom/base/test/iframe_webSocket_sandbox.html",
|
var urls = [ "https://example.com/tests/dom/websocket/tests/iframe_webSocket_sandbox.html",
|
||||||
"https://example.com/tests/dom/base/test/iframe_webSocket_sandbox.html?nested",
|
"https://example.com/tests/dom/websocket/tests/iframe_webSocket_sandbox.html?nested",
|
||||||
"https://example.com/tests/dom/base/test/iframe_webSocket_sandbox.html?popup" ];
|
"https://example.com/tests/dom/websocket/tests/iframe_webSocket_sandbox.html?popup" ];
|
||||||
|
|
||||||
onmessage = function(e) {
|
onmessage = function(e) {
|
||||||
is(e.data, "WS Throws!", "ws://URI cannot be used by a https iframe");
|
is(e.data, "WS Throws!", "ws://URI cannot be used by a https iframe");
|
|
@ -14,7 +14,7 @@
|
||||||
<pre id="test">
|
<pre id="test">
|
||||||
<script class="testbody" type="text/javascript">
|
<script class="testbody" type="text/javascript">
|
||||||
|
|
||||||
const kUrl = "ws://mochi.test:8888/tests/dom/base/test/file_websocket_basic";
|
const kUrl = "ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_basic";
|
||||||
|
|
||||||
var gTestElement;
|
var gTestElement;
|
||||||
var ws;
|
var ws;
|
||||||
|
@ -37,7 +37,7 @@ function testWebSocket1() {
|
||||||
gTestElement.textContent = "Running testWebSocket1()";
|
gTestElement.textContent = "Running testWebSocket1()";
|
||||||
|
|
||||||
var results = ["test",
|
var results = ["test",
|
||||||
"/tests/dom/base/test/file_websocket_basic",
|
"/tests/dom/websocket/tests/file_websocket_basic",
|
||||||
"http://mochi.test:8888",
|
"http://mochi.test:8888",
|
||||||
"end"];
|
"end"];
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<body>
|
<body>
|
||||||
<script class="testbody" type="text/javascript">
|
<script class="testbody" type="text/javascript">
|
||||||
|
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket_bigBlob");
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_bigBlob");
|
||||||
is(ws.readyState, 0, "Initial readyState is 0");
|
is(ws.readyState, 0, "Initial readyState is 0");
|
||||||
ws.binaryType = "blob";
|
ws.binaryType = "blob";
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||||
|
|
||||||
const URI = "ws://mochi.test:8888/tests/dom/base/test/file_websocket_basic";
|
const URI = "ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_basic";
|
||||||
|
|
||||||
var frameReceivedCounter = 0;
|
var frameReceivedCounter = 0;
|
||||||
var frameSentCounter = 0;
|
var frameSentCounter = 0;
|
|
@ -18,7 +18,7 @@
|
||||||
var ws;
|
var ws;
|
||||||
|
|
||||||
function testWebSocket () {
|
function testWebSocket () {
|
||||||
ws = new WebSocket("ws://mochi.test:8888/tests/dom/base/test/file_websocket_hello");
|
ws = new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_hello");
|
||||||
ws.onopen = function(e) {
|
ws.onopen = function(e) {
|
||||||
ws.send("data");
|
ws.send("data");
|
||||||
}
|
}
|
|
@ -21,13 +21,13 @@ var sendText = true;
|
||||||
|
|
||||||
tests = [
|
tests = [
|
||||||
// enable PMCE
|
// enable PMCE
|
||||||
[ true, true, "ws://mochi.test:8888/tests/dom/base/test/file_websocket_permessage_deflate" ],
|
[ true, true, "ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_permessage_deflate" ],
|
||||||
// disable PMCE
|
// disable PMCE
|
||||||
[ false, false, "ws://mochi.test:8888/tests/dom/base/test/file_websocket_permessage_deflate_disabled" ],
|
[ false, false, "ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_permessage_deflate_disabled" ],
|
||||||
// server rejects offered PMCE
|
// server rejects offered PMCE
|
||||||
[ true, false, "ws://mochi.test:8888/tests/dom/base/test/file_websocket_permessage_deflate_rejected" ],
|
[ true, false, "ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_permessage_deflate_rejected" ],
|
||||||
// server returns parameters in the handshake
|
// server returns parameters in the handshake
|
||||||
[ true, true, "ws://mochi.test:8888/tests/dom/base/test/file_websocket_permessage_deflate_params" ]
|
[ true, true, "ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_permessage_deflate_params" ]
|
||||||
]
|
]
|
||||||
|
|
||||||
function ab2str(buf) {
|
function ab2str(buf) {
|
|
@ -25,6 +25,6 @@
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</pre>
|
</pre>
|
||||||
<iframe src="https://example.com/tests/dom/workers/test/websocket_https.html"></iframe>
|
<iframe src="https://example.com/tests/dom/websocket/tests/websocket_worker_https.html"></iframe>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -1,5 +1,5 @@
|
||||||
onconnect = function(evt) {
|
onconnect = function(evt) {
|
||||||
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/base/test/file_websocket_hello");
|
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_hello");
|
||||||
|
|
||||||
ws.onopen = function(e) {
|
ws.onopen = function(e) {
|
||||||
evt.ports[0].postMessage({type: 'status', status: true, msg: 'OnOpen called' });
|
evt.ports[0].postMessage({type: 'status', status: true, msg: 'OnOpen called' });
|
|
@ -19,7 +19,7 @@ onmessage = function(event) {
|
||||||
|
|
||||||
postMessage({type: 'status', status: status, msg: 'WebSocket object:' + WebSocket});
|
postMessage({type: 'status', status: status, msg: 'WebSocket object:' + WebSocket});
|
||||||
|
|
||||||
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/base/test/file_websocket_hello");
|
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_hello");
|
||||||
ws.onopen = function(e) {
|
ws.onopen = function(e) {
|
||||||
postMessage({type: 'status', status: true, msg: 'OnOpen called' });
|
postMessage({type: 'status', status: true, msg: 'OnOpen called' });
|
||||||
ws.send("data");
|
ws.send("data");
|
|
@ -1,7 +1,7 @@
|
||||||
onmessage = function() {
|
onmessage = function() {
|
||||||
var wsCreated = true;
|
var wsCreated = true;
|
||||||
try {
|
try {
|
||||||
new WebSocket("ws://mochi.test:8888/tests/dom/base/test/file_websocket_hello");
|
new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_hello");
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
wsCreated = false;
|
wsCreated = false;
|
||||||
}
|
}
|
|
@ -39,7 +39,7 @@ function createArrayBufferContainingAllDistinctBytes()
|
||||||
return array.buffer;
|
return array.buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/base/test/websocket_hybi/file_binary-frames");
|
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/websocket_hybi/file_binary-frames");
|
||||||
ws.binaryType = "arraybuffer";
|
ws.binaryType = "arraybuffer";
|
||||||
is(ws.binaryType, "arraybuffer", "should be equal to 'arraybuffer'");
|
is(ws.binaryType, "arraybuffer", "should be equal to 'arraybuffer'");
|
||||||
|
|
|
@ -39,7 +39,7 @@ function createArrayBufferContainingAllDistinctBytes()
|
||||||
return array.buffer;
|
return array.buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/base/test/websocket_hybi/file_binary-frames");
|
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/websocket_hybi/file_binary-frames");
|
||||||
is(ws.binaryType, "blob", "should be 'blob'");
|
is(ws.binaryType, "blob", "should be 'blob'");
|
||||||
|
|
||||||
var closeEvent;
|
var closeEvent;
|
|
@ -44,7 +44,7 @@ function createArrayBufferContainingAllDistinctBytes()
|
||||||
return array.buffer;
|
return array.buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/base/test/websocket_hybi/file_check-binary-messages");
|
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/websocket_hybi/file_check-binary-messages");
|
||||||
var closeEvent;
|
var closeEvent;
|
||||||
|
|
||||||
ws.onopen = function()
|
ws.onopen = function()
|
|
@ -35,7 +35,7 @@ var filesToCreate = [
|
||||||
];
|
];
|
||||||
|
|
||||||
SpecialPowers.createFiles(filesToCreate, function (files) {
|
SpecialPowers.createFiles(filesToCreate, function (files) {
|
||||||
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/base/test/websocket_hybi/file_check-binary-messages");
|
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/websocket_hybi/file_check-binary-messages");
|
||||||
var closeEvent;
|
var closeEvent;
|
||||||
|
|
||||||
ws.onopen = function()
|
ws.onopen = function()
|
|
@ -9,7 +9,7 @@ onmessage = function(event) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/base/test/file_websocket_hello");
|
var ws = new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_hello");
|
||||||
ws.onopen = function(e) {
|
ws.onopen = function(e) {
|
||||||
postMessage('opened');
|
postMessage('opened');
|
||||||
}
|
}
|
|
@ -2,7 +2,7 @@
|
||||||
function test1() {
|
function test1() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
try {
|
try {
|
||||||
var ws = CreateTestWS("http://mochi.test:8888/tests/dom/base/test/file_websocket");
|
var ws = CreateTestWS("http://mochi.test:8888/tests/dom/websocket/tests/file_websocket");
|
||||||
ok(false, "test1 failed");
|
ok(false, "test1 failed");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ok(true, "test1 failed");
|
ok(true, "test1 failed");
|
||||||
|
@ -20,8 +20,8 @@ function test2() {
|
||||||
var waitTest2Part1 = true;
|
var waitTest2Part1 = true;
|
||||||
var waitTest2Part2 = true;
|
var waitTest2Part2 = true;
|
||||||
|
|
||||||
var ws1 = CreateTestWS("ws://sub2.test2.example.com/tests/dom/base/test/file_websocket", "test-2.1");
|
var ws1 = CreateTestWS("ws://sub2.test2.example.com/tests/dom/websocket/tests/file_websocket", "test-2.1");
|
||||||
var ws2 = CreateTestWS("ws://sub2.test2.example.com/tests/dom/base/test/file_websocket", "test-2.2");
|
var ws2 = CreateTestWS("ws://sub2.test2.example.com/tests/dom/websocket/tests/file_websocket", "test-2.2");
|
||||||
|
|
||||||
var ws2CanConnect = false;
|
var ws2CanConnect = false;
|
||||||
|
|
||||||
|
@ -93,21 +93,21 @@ function test4() {
|
||||||
function test5() {
|
function test5() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
try {
|
try {
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "");
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "");
|
||||||
ok(false, "couldn't accept an empty string in the protocol parameter");
|
ok(false, "couldn't accept an empty string in the protocol parameter");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ok(true, "couldn't accept an empty string in the protocol parameter");
|
ok(true, "couldn't accept an empty string in the protocol parameter");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "\n");
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "\n");
|
||||||
ok(false, "couldn't accept any not printable ASCII character in the protocol parameter");
|
ok(false, "couldn't accept any not printable ASCII character in the protocol parameter");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ok(true, "couldn't accept any not printable ASCII character in the protocol parameter");
|
ok(true, "couldn't accept any not printable ASCII character in the protocol parameter");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test 5");
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test 5");
|
||||||
ok(false, "U+0020 not acceptable in protocol parameter");
|
ok(false, "U+0020 not acceptable in protocol parameter");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ok(true, "U+0020 not acceptable in protocol parameter");
|
ok(true, "U+0020 not acceptable in protocol parameter");
|
||||||
|
@ -120,7 +120,7 @@ function test5() {
|
||||||
// test6: counter and encoding check;
|
// test6: counter and encoding check;
|
||||||
function test6() {
|
function test6() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-6");
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-6");
|
||||||
var counter = 1;
|
var counter = 1;
|
||||||
|
|
||||||
ws.onopen = function() {
|
ws.onopen = function() {
|
||||||
|
@ -148,7 +148,7 @@ function test6() {
|
||||||
// test7: onmessage event origin property check
|
// test7: onmessage event origin property check
|
||||||
function test7() {
|
function test7() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var ws = CreateTestWS("ws://sub2.test2.example.org/tests/dom/base/test/file_websocket", "test-7");
|
var ws = CreateTestWS("ws://sub2.test2.example.org/tests/dom/websocket/tests/file_websocket", "test-7");
|
||||||
var gotmsg = false;
|
var gotmsg = false;
|
||||||
|
|
||||||
ws.onopen = function() {
|
ws.onopen = function() {
|
||||||
|
@ -174,7 +174,7 @@ function test7() {
|
||||||
// code or reason) in acknowledgement;
|
// code or reason) in acknowledgement;
|
||||||
function test8() {
|
function test8() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-8");
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-8");
|
||||||
|
|
||||||
ws.onopen = function() {
|
ws.onopen = function() {
|
||||||
is(ws.protocol, "test-8", "test-8 subprotocol selection");
|
is(ws.protocol, "test-8", "test-8 subprotocol selection");
|
||||||
|
@ -195,7 +195,7 @@ function test8() {
|
||||||
// test9: client closes the connection before the ws connection is established;
|
// test9: client closes the connection before the ws connection is established;
|
||||||
function test9() {
|
function test9() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var ws = CreateTestWS("ws://test2.example.org/tests/dom/base/test/file_websocket", "test-9");
|
var ws = CreateTestWS("ws://test2.example.org/tests/dom/websocket/tests/file_websocket", "test-9");
|
||||||
|
|
||||||
ws._receivedErrorEvent = false;
|
ws._receivedErrorEvent = false;
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ function test9() {
|
||||||
// test10: client sends a message before the ws connection is established;
|
// test10: client sends a message before the ws connection is established;
|
||||||
function test10() {
|
function test10() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var ws = CreateTestWS("ws://sub1.test1.example.com/tests/dom/base/test/file_websocket", "test-10");
|
var ws = CreateTestWS("ws://sub1.test1.example.com/tests/dom/websocket/tests/file_websocket", "test-10");
|
||||||
|
|
||||||
ws.onclose = function(e) {
|
ws.onclose = function(e) {
|
||||||
shouldCloseCleanly(e);
|
shouldCloseCleanly(e);
|
||||||
|
@ -243,7 +243,7 @@ function test10() {
|
||||||
// test11: a simple hello echo;
|
// test11: a simple hello echo;
|
||||||
function test11() {
|
function test11() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-11");
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-11");
|
||||||
is(ws.readyState, 0, "create bad readyState in test-11!");
|
is(ws.readyState, 0, "create bad readyState in test-11!");
|
||||||
|
|
||||||
ws.onopen = function() {
|
ws.onopen = function() {
|
||||||
|
@ -273,7 +273,7 @@ function test11() {
|
||||||
// test12: client sends a message containing unpaired surrogates
|
// test12: client sends a message containing unpaired surrogates
|
||||||
function test12() {
|
function test12() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-12");
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-12");
|
||||||
|
|
||||||
ws.onopen = function() {
|
ws.onopen = function() {
|
||||||
try {
|
try {
|
||||||
|
@ -311,7 +311,7 @@ function test13() {
|
||||||
// returned, but the protocol stack typically closes down after reporting a
|
// returned, but the protocol stack typically closes down after reporting a
|
||||||
// protocol level error - trying to resync is too dangerous
|
// protocol level error - trying to resync is too dangerous
|
||||||
|
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-13");
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-13");
|
||||||
ws._timesCalledOnError = 0;
|
ws._timesCalledOnError = 0;
|
||||||
|
|
||||||
ws.onerror = function() {
|
ws.onerror = function() {
|
||||||
|
@ -329,7 +329,7 @@ function test13() {
|
||||||
// and it keeps sending normal ws messages;
|
// and it keeps sending normal ws messages;
|
||||||
function test14() {
|
function test14() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-14");
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-14");
|
||||||
|
|
||||||
ws.onmessage = function() {
|
ws.onmessage = function() {
|
||||||
ok(false, "shouldn't received message after the server sent the close frame");
|
ok(false, "shouldn't received message after the server sent the close frame");
|
||||||
|
@ -351,7 +351,7 @@ function test15() {
|
||||||
*/
|
*/
|
||||||
resolve();
|
resolve();
|
||||||
|
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-15");
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-15");
|
||||||
ws.onclose = function(e) {
|
ws.onclose = function(e) {
|
||||||
shouldCloseNotCleanly(e);
|
shouldCloseNotCleanly(e);
|
||||||
resolve();
|
resolve();
|
||||||
|
@ -366,7 +366,7 @@ function test15() {
|
||||||
// test16: client calls close() and tries to send a message;
|
// test16: client calls close() and tries to send a message;
|
||||||
function test16() {
|
function test16() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-16");
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-16");
|
||||||
|
|
||||||
ws.onopen = function() {
|
ws.onopen = function() {
|
||||||
ws.close();
|
ws.close();
|
||||||
|
@ -392,7 +392,7 @@ function test17() {
|
||||||
var status_test17 = "not started";
|
var status_test17 = "not started";
|
||||||
|
|
||||||
var test17func = function() {
|
var test17func = function() {
|
||||||
var local_ws = new WebSocket("ws://sub1.test2.example.org/tests/dom/base/test/file_websocket", "test-17");
|
var local_ws = new WebSocket("ws://sub1.test2.example.org/tests/dom/websocket/tests/file_websocket", "test-17");
|
||||||
status_test17 = "started";
|
status_test17 = "started";
|
||||||
|
|
||||||
local_ws.onopen = function(e) {
|
local_ws.onopen = function(e) {
|
||||||
|
@ -435,7 +435,7 @@ function test17() {
|
||||||
// test18: client tries to connect to an http resource;
|
// test18: client tries to connect to an http resource;
|
||||||
function test18() {
|
function test18() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket_http_resource.txt");
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket_http_resource.txt");
|
||||||
ws.onopen = shouldNotOpen;
|
ws.onopen = shouldNotOpen;
|
||||||
ws.onerror = ignoreError;
|
ws.onerror = ignoreError;
|
||||||
ws.onclose = function(e)
|
ws.onclose = function(e)
|
||||||
|
@ -450,7 +450,7 @@ function test18() {
|
||||||
// connection;
|
// connection;
|
||||||
function test19() {
|
function test19() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-19");
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-19");
|
||||||
ws.onopen = shouldNotOpen;
|
ws.onopen = shouldNotOpen;
|
||||||
ws.onerror = ignoreError;
|
ws.onerror = ignoreError;
|
||||||
ws.onclose = function(e)
|
ws.onclose = function(e)
|
||||||
|
@ -465,7 +465,7 @@ function test19() {
|
||||||
function test20() {
|
function test20() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var test20func = function() {
|
var test20func = function() {
|
||||||
var local_ws = new WebSocket("ws://sub1.test1.example.org/tests/dom/base/test/file_websocket", "test-20");
|
var local_ws = new WebSocket("ws://sub1.test1.example.org/tests/dom/websocket/tests/file_websocket", "test-20");
|
||||||
|
|
||||||
local_ws.onerror = function() {
|
local_ws.onerror = function() {
|
||||||
ok(false, "onerror called on test " + current_test + "!");
|
ok(false, "onerror called on test " + current_test + "!");
|
||||||
|
@ -491,7 +491,7 @@ function test20() {
|
||||||
function test21() {
|
function test21() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var test21func = function() {
|
var test21func = function() {
|
||||||
var local_ws = new WebSocket("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-21");
|
var local_ws = new WebSocket("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-21");
|
||||||
var received_message = false;
|
var received_message = false;
|
||||||
|
|
||||||
local_ws.onopen = function(e) {
|
local_ws.onopen = function(e) {
|
||||||
|
@ -535,7 +535,7 @@ function test22() {
|
||||||
const pref_open = "network.websocket.timeout.open";
|
const pref_open = "network.websocket.timeout.open";
|
||||||
SpecialPowers.setIntPref(pref_open, 5);
|
SpecialPowers.setIntPref(pref_open, 5);
|
||||||
|
|
||||||
var ws = CreateTestWS("ws://sub2.test2.example.org/tests/dom/base/test/file_websocket", "test-22");
|
var ws = CreateTestWS("ws://sub2.test2.example.org/tests/dom/websocket/tests/file_websocket", "test-22");
|
||||||
|
|
||||||
ws.onopen = shouldNotOpen;
|
ws.onopen = shouldNotOpen;
|
||||||
ws.onerror = ignoreError;
|
ws.onerror = ignoreError;
|
||||||
|
@ -560,7 +560,7 @@ function test23() {
|
||||||
// test24: server rejects sub-protocol string
|
// test24: server rejects sub-protocol string
|
||||||
function test24() {
|
function test24() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-does-not-exist");
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-does-not-exist");
|
||||||
|
|
||||||
ws.onopen = shouldNotOpen;
|
ws.onopen = shouldNotOpen;
|
||||||
ws.onclose = function(e) {
|
ws.onclose = function(e) {
|
||||||
|
@ -578,7 +578,7 @@ function test25() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var prots=[];
|
var prots=[];
|
||||||
|
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
|
||||||
|
|
||||||
// This test errors because the server requires a sub-protocol, but
|
// This test errors because the server requires a sub-protocol, but
|
||||||
// the test just wants to ensure that the ctor doesn't generate an
|
// the test just wants to ensure that the ctor doesn't generate an
|
||||||
|
@ -600,7 +600,7 @@ function test26() {
|
||||||
var prots=[""];
|
var prots=[""];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
|
||||||
ok(false, "testing empty element sub protocol array");
|
ok(false, "testing empty element sub protocol array");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ok(true, "testing empty sub element protocol array");
|
ok(true, "testing empty sub element protocol array");
|
||||||
|
@ -617,7 +617,7 @@ function test27() {
|
||||||
var prots=["test27", ""];
|
var prots=["test27", ""];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
|
||||||
ok(false, "testing empty element mixed sub protocol array");
|
ok(false, "testing empty element mixed sub protocol array");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ok(true, "testing empty element mixed sub protocol array");
|
ok(true, "testing empty element mixed sub protocol array");
|
||||||
|
@ -632,7 +632,7 @@ function test28() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var prots=["test28"];
|
var prots=["test28"];
|
||||||
|
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
|
||||||
|
|
||||||
ws.onopen = function(e) {
|
ws.onopen = function(e) {
|
||||||
ok(true, "test 28 protocol array open");
|
ok(true, "test 28 protocol array open");
|
||||||
|
@ -652,7 +652,7 @@ function test29() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var prots=["test29a", "test29b"];
|
var prots=["test29a", "test29b"];
|
||||||
|
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
|
||||||
|
|
||||||
ws.onopen = function(e) {
|
ws.onopen = function(e) {
|
||||||
ok(true, "test 29 protocol array open");
|
ok(true, "test 29 protocol array open");
|
||||||
|
@ -671,7 +671,7 @@ function test29() {
|
||||||
function test30() {
|
function test30() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var prots=["test-does-not-exist"];
|
var prots=["test-does-not-exist"];
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
|
||||||
|
|
||||||
ws.onopen = shouldNotOpen;
|
ws.onopen = shouldNotOpen;
|
||||||
|
|
||||||
|
@ -690,7 +690,7 @@ function test30() {
|
||||||
function test31() {
|
function test31() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var prots=["test-does-not-exist", "test31"];
|
var prots=["test-does-not-exist", "test31"];
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
|
||||||
|
|
||||||
ws.onopen = function(e) {
|
ws.onopen = function(e) {
|
||||||
ok(true, "test 31 protocol array open");
|
ok(true, "test 31 protocol array open");
|
||||||
|
@ -711,7 +711,7 @@ function test32() {
|
||||||
var prots=["test32","test32"];
|
var prots=["test32","test32"];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
|
||||||
ok(false, "testing duplicated element sub protocol array");
|
ok(false, "testing duplicated element sub protocol array");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ok(true, "testing duplicated sub element protocol array");
|
ok(true, "testing duplicated sub element protocol array");
|
||||||
|
@ -726,7 +726,7 @@ function test33() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var prots=["test33"];
|
var prots=["test33"];
|
||||||
|
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
|
||||||
|
|
||||||
ws.onopen = function(e) {
|
ws.onopen = function(e) {
|
||||||
ok(true, "test 33 open");
|
ok(true, "test 33 open");
|
||||||
|
@ -748,7 +748,7 @@ function test34() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var prots=["test-34"];
|
var prots=["test-34"];
|
||||||
|
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
|
||||||
|
|
||||||
ws.onopen = function(e) {
|
ws.onopen = function(e) {
|
||||||
ok(true, "test 34 open");
|
ok(true, "test 34 open");
|
||||||
|
@ -769,7 +769,7 @@ function test34() {
|
||||||
// test35: test for sending custom close code and reason
|
// test35: test for sending custom close code and reason
|
||||||
function test35() {
|
function test35() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-35a");
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-35a");
|
||||||
|
|
||||||
ws.onopen = function(e) {
|
ws.onopen = function(e) {
|
||||||
ok(true, "test 35a open");
|
ok(true, "test 35a open");
|
||||||
|
@ -779,7 +779,7 @@ function test35() {
|
||||||
ws.onclose = function(e) {
|
ws.onclose = function(e) {
|
||||||
ok(true, "test 35a close");
|
ok(true, "test 35a close");
|
||||||
ok(e.wasClean, "test 35a closed cleanly");
|
ok(e.wasClean, "test 35a closed cleanly");
|
||||||
var wsb = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-35b");
|
var wsb = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-35b");
|
||||||
|
|
||||||
wsb.onopen = function(e) {
|
wsb.onopen = function(e) {
|
||||||
ok(true, "test 35b open");
|
ok(true, "test 35b open");
|
||||||
|
@ -802,7 +802,7 @@ function test36() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var prots=["test-36"];
|
var prots=["test-36"];
|
||||||
|
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
|
||||||
|
|
||||||
ws.onopen = function(e) {
|
ws.onopen = function(e) {
|
||||||
ok(true, "test 36 open");
|
ok(true, "test 36 open");
|
||||||
|
@ -829,7 +829,7 @@ function test37() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var prots=["test-37"];
|
var prots=["test-37"];
|
||||||
|
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
|
||||||
|
|
||||||
ws.onopen = function(e) {
|
ws.onopen = function(e) {
|
||||||
ok(true, "test 37 open");
|
ok(true, "test 37 open");
|
||||||
|
@ -847,7 +847,7 @@ function test37() {
|
||||||
ok(true, "test 37 close");
|
ok(true, "test 37 close");
|
||||||
ok(e.wasClean, "test 37 closed cleanly");
|
ok(e.wasClean, "test 37 closed cleanly");
|
||||||
|
|
||||||
var wsb = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-37b");
|
var wsb = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-37b");
|
||||||
|
|
||||||
wsb.onopen = function(e) {
|
wsb.onopen = function(e) {
|
||||||
// now test that a rejected close code and reason dont persist
|
// now test that a rejected close code and reason dont persist
|
||||||
|
@ -865,7 +865,7 @@ function test37() {
|
||||||
ok(true, "test 37b close");
|
ok(true, "test 37b close");
|
||||||
ok(e.wasClean, "test 37b closed cleanly");
|
ok(e.wasClean, "test 37b closed cleanly");
|
||||||
|
|
||||||
var wsc = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-37c");
|
var wsc = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-37c");
|
||||||
|
|
||||||
wsc.onopen = function(e) {
|
wsc.onopen = function(e) {
|
||||||
ok(true, "test 37c open");
|
ok(true, "test 37c open");
|
||||||
|
@ -887,7 +887,7 @@ function test38() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var prots=["test-38"];
|
var prots=["test-38"];
|
||||||
|
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
|
||||||
|
|
||||||
ws.onopen = function(e) {
|
ws.onopen = function(e) {
|
||||||
ok(true, "test 38 open");
|
ok(true, "test 38 open");
|
||||||
|
@ -908,7 +908,7 @@ function test39() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var prots=["test-39"];
|
var prots=["test-39"];
|
||||||
|
|
||||||
var ws = CreateTestWS("wss://example.com/tests/dom/base/test/file_websocket", prots);
|
var ws = CreateTestWS("wss://example.com/tests/dom/websocket/tests/file_websocket", prots);
|
||||||
status_test39 = "started";
|
status_test39 = "started";
|
||||||
|
|
||||||
ws.onopen = function(e) {
|
ws.onopen = function(e) {
|
||||||
|
@ -930,7 +930,7 @@ function test40() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var prots=["test-40"];
|
var prots=["test-40"];
|
||||||
|
|
||||||
var ws = CreateTestWS("wss://nocert.example.com/tests/dom/base/test/file_websocket", prots);
|
var ws = CreateTestWS("wss://nocert.example.com/tests/dom/websocket/tests/file_websocket", prots);
|
||||||
|
|
||||||
status_test40 = "started";
|
status_test40 = "started";
|
||||||
ws.onerror = ignoreError;
|
ws.onerror = ignoreError;
|
||||||
|
@ -952,11 +952,11 @@ function test40() {
|
||||||
// test41: HSTS
|
// test41: HSTS
|
||||||
function test41() {
|
function test41() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var ws = CreateTestWS("ws://example.com/tests/dom/base/test/file_websocket", "test-41a", 1);
|
var ws = CreateTestWS("ws://example.com/tests/dom/websocket/tests/file_websocket", "test-41a", 1);
|
||||||
|
|
||||||
ws.onopen = function(e) {
|
ws.onopen = function(e) {
|
||||||
ok(true, "test 41a open");
|
ok(true, "test 41a open");
|
||||||
is(ws.url, "ws://example.com/tests/dom/base/test/file_websocket",
|
is(ws.url, "ws://example.com/tests/dom/websocket/tests/file_websocket",
|
||||||
"test 41a initial ws should not be redirected");
|
"test 41a initial ws should not be redirected");
|
||||||
ws.close();
|
ws.close();
|
||||||
}
|
}
|
||||||
|
@ -965,7 +965,7 @@ function test41() {
|
||||||
ok(true, "test 41a close");
|
ok(true, "test 41a close");
|
||||||
|
|
||||||
// establish a hsts policy for example.com
|
// establish a hsts policy for example.com
|
||||||
var wsb = CreateTestWS("wss://example.com/tests/dom/base/test/file_websocket", "test-41b", 1);
|
var wsb = CreateTestWS("wss://example.com/tests/dom/websocket/tests/file_websocket", "test-41b", 1);
|
||||||
|
|
||||||
wsb.onopen = function(e) {
|
wsb.onopen = function(e) {
|
||||||
ok(true, "test 41b open");
|
ok(true, "test 41b open");
|
||||||
|
@ -976,11 +976,11 @@ function test41() {
|
||||||
ok(true, "test 41b close");
|
ok(true, "test 41b close");
|
||||||
|
|
||||||
// try ws:// again, it should be done over wss:// now due to hsts
|
// try ws:// again, it should be done over wss:// now due to hsts
|
||||||
var wsc = CreateTestWS("ws://example.com/tests/dom/base/test/file_websocket", "test-41c");
|
var wsc = CreateTestWS("ws://example.com/tests/dom/websocket/tests/file_websocket", "test-41c");
|
||||||
|
|
||||||
wsc.onopen = function(e) {
|
wsc.onopen = function(e) {
|
||||||
ok(true, "test 41c open");
|
ok(true, "test 41c open");
|
||||||
is(wsc.url, "wss://example.com/tests/dom/base/test/file_websocket",
|
is(wsc.url, "wss://example.com/tests/dom/websocket/tests/file_websocket",
|
||||||
"test 41c ws should be redirected by hsts to wss");
|
"test 41c ws should be redirected by hsts to wss");
|
||||||
wsc.close();
|
wsc.close();
|
||||||
}
|
}
|
||||||
|
@ -1010,7 +1010,7 @@ function test42() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
// test some utf-8 non-characters. They should be allowed in the
|
// test some utf-8 non-characters. They should be allowed in the
|
||||||
// websockets context. Test via round trip echo.
|
// websockets context. Test via round trip echo.
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-42");
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-42");
|
||||||
var data = ["U+FFFE \ufffe",
|
var data = ["U+FFFE \ufffe",
|
||||||
"U+FFFF \uffff",
|
"U+FFFF \uffff",
|
||||||
"U+10FFFF \udbff\udfff"];
|
"U+10FFFF \udbff\udfff"];
|
||||||
|
@ -1041,7 +1041,7 @@ function test43() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var prots=["test-43"];
|
var prots=["test-43"];
|
||||||
|
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", prots);
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", prots);
|
||||||
|
|
||||||
ws.onopen = function(e) {
|
ws.onopen = function(e) {
|
||||||
ok(true, "test 43 open");
|
ok(true, "test 43 open");
|
||||||
|
@ -1069,7 +1069,7 @@ function test43() {
|
||||||
// test44: Test sending/receving binary ArrayBuffer
|
// test44: Test sending/receving binary ArrayBuffer
|
||||||
function test44() {
|
function test44() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-44");
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-44");
|
||||||
is(ws.readyState, 0, "bad readyState in test-44!");
|
is(ws.readyState, 0, "bad readyState in test-44!");
|
||||||
ws.binaryType = "arraybuffer";
|
ws.binaryType = "arraybuffer";
|
||||||
|
|
||||||
|
@ -1103,7 +1103,7 @@ function test44() {
|
||||||
function test45() {
|
function test45() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
function test45Real(blobFile) {
|
function test45Real(blobFile) {
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-45");
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-45");
|
||||||
is(ws.readyState, 0, "bad readyState in test-45!");
|
is(ws.readyState, 0, "bad readyState in test-45!");
|
||||||
// ws.binaryType = "blob"; // Don't need to specify: blob is the default
|
// ws.binaryType = "blob"; // Don't need to specify: blob is the default
|
||||||
|
|
||||||
|
@ -1158,7 +1158,7 @@ function test45() {
|
||||||
// test46: Test that we don't dispatch incoming msgs once in CLOSING state
|
// test46: Test that we don't dispatch incoming msgs once in CLOSING state
|
||||||
function test46() {
|
function test46() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-46");
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-46");
|
||||||
is(ws.readyState, 0, "create bad readyState in test-46!");
|
is(ws.readyState, 0, "create bad readyState in test-46!");
|
||||||
|
|
||||||
ws.onopen = function() {
|
ws.onopen = function() {
|
||||||
|
@ -1221,7 +1221,7 @@ function test48() {
|
||||||
const pref_close = "network.websocket.timeout.close";
|
const pref_close = "network.websocket.timeout.close";
|
||||||
SpecialPowers.setIntPref(pref_close, 1);
|
SpecialPowers.setIntPref(pref_close, 1);
|
||||||
|
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-48");
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-48");
|
||||||
|
|
||||||
ws.onopen = function() {
|
ws.onopen = function() {
|
||||||
ws.close();
|
ws.close();
|
||||||
|
@ -1246,7 +1246,7 @@ function test48() {
|
||||||
function test49()
|
function test49()
|
||||||
{
|
{
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/base/test/file_websocket", "test-49");
|
var ws = CreateTestWS("ws://mochi.test:8888/tests/dom/websocket/tests/file_websocket", "test-49");
|
||||||
var gotError = 0;
|
var gotError = 0;
|
||||||
ok(ws.readyState == 0, "create bad readyState in test-49!");
|
ok(ws.readyState == 0, "create bad readyState in test-49!");
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
importScripts('../../../dom/base/test/websocket_helpers.js');
|
|
||||||
importScripts('../../../dom/base/test/websocket_tests.js');
|
|
||||||
importScripts('websocket_helpers.js');
|
importScripts('websocket_helpers.js');
|
||||||
|
importScripts('websocket_tests.js');
|
||||||
|
importScripts('websocket_worker_helpers.js');
|
||||||
|
|
||||||
var tests = [
|
var tests = [
|
||||||
test1, // client tries to connect to a http scheme location;
|
test1, // client tries to connect to a http scheme location;
|
|
@ -1,6 +1,6 @@
|
||||||
importScripts('../../../dom/base/test/websocket_helpers.js');
|
|
||||||
importScripts('../../../dom/base/test/websocket_tests.js');
|
|
||||||
importScripts('websocket_helpers.js');
|
importScripts('websocket_helpers.js');
|
||||||
|
importScripts('websocket_tests.js');
|
||||||
|
importScripts('websocket_worker_helpers.js');
|
||||||
|
|
||||||
var tests = [
|
var tests = [
|
||||||
test11, // a simple hello echo;
|
test11, // a simple hello echo;
|
|
@ -1,6 +1,6 @@
|
||||||
importScripts('../../../dom/base/test/websocket_helpers.js');
|
|
||||||
importScripts('../../../dom/base/test/websocket_tests.js');
|
|
||||||
importScripts('websocket_helpers.js');
|
importScripts('websocket_helpers.js');
|
||||||
|
importScripts('websocket_tests.js');
|
||||||
|
importScripts('websocket_worker_helpers.js');
|
||||||
|
|
||||||
var tests = [
|
var tests = [
|
||||||
test24, // server rejects sub-protocol string
|
test24, // server rejects sub-protocol string
|
|
@ -1,6 +1,6 @@
|
||||||
importScripts('../../../dom/base/test/websocket_helpers.js');
|
|
||||||
importScripts('../../../dom/base/test/websocket_tests.js');
|
|
||||||
importScripts('websocket_helpers.js');
|
importScripts('websocket_helpers.js');
|
||||||
|
importScripts('websocket_tests.js');
|
||||||
|
importScripts('websocket_worker_helpers.js');
|
||||||
|
|
||||||
var tests = [
|
var tests = [
|
||||||
test31, // ctor using valid 2 element sub-protocol array with 1 element server
|
test31, // ctor using valid 2 element sub-protocol array with 1 element server
|
|
@ -1,6 +1,6 @@
|
||||||
importScripts('../../../dom/base/test/websocket_helpers.js');
|
|
||||||
importScripts('../../../dom/base/test/websocket_tests.js');
|
|
||||||
importScripts('websocket_helpers.js');
|
importScripts('websocket_helpers.js');
|
||||||
|
importScripts('websocket_tests.js');
|
||||||
|
importScripts('websocket_worker_helpers.js');
|
||||||
|
|
||||||
var tests = [
|
var tests = [
|
||||||
test42, // non-char utf-8 sequences
|
test42, // non-char utf-8 sequences
|
|
@ -1,6 +1,6 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<script>
|
<script>
|
||||||
var worker = new Worker("https://example.com/tests/dom/workers/test/websocket_https_worker.js");
|
var worker = new Worker("https://example.com/tests/dom/websocket/tests/websocket_https_worker.js");
|
||||||
|
|
||||||
worker.onmessage = function(event) {
|
worker.onmessage = function(event) {
|
||||||
parent.postMessage(event.data, "*");
|
parent.postMessage(event.data, "*");
|
|
@ -6,7 +6,7 @@
|
||||||
if (window.location.search == "") {
|
if (window.location.search == "") {
|
||||||
window.open("window_bug1384658.html?opened", "_top", "");
|
window.open("window_bug1384658.html?opened", "_top", "");
|
||||||
} else {
|
} else {
|
||||||
var iframeURL = "http://mochi.test:8888/tests/dom/base/test/file_bug1384658.html";
|
var iframeURL = "http://mochi.test:8888/tests/dom/websocket/tests/file_bug1384658.html";
|
||||||
var iframe = document.createElement("iframe");
|
var iframe = document.createElement("iframe");
|
||||||
iframe.src = iframeURL;
|
iframe.src = iframeURL;
|
||||||
document.body.appendChild(iframe);
|
document.body.appendChild(iframe);
|
|
@ -71,21 +71,12 @@ support-files =
|
||||||
throwingOnerror_worker.js
|
throwingOnerror_worker.js
|
||||||
timeoutTracing_worker.js
|
timeoutTracing_worker.js
|
||||||
transferable_worker.js
|
transferable_worker.js
|
||||||
websocket_basic_worker.js
|
|
||||||
websocket_loadgroup_worker.js
|
|
||||||
websocket_worker1.js
|
|
||||||
websocket_worker2.js
|
|
||||||
websocket_worker3.js
|
|
||||||
websocket_worker4.js
|
|
||||||
websocket_worker5.js
|
|
||||||
websocket_helpers.js
|
|
||||||
workersDisabled_worker.js
|
workersDisabled_worker.js
|
||||||
test_worker_interfaces.js
|
test_worker_interfaces.js
|
||||||
worker_driver.js
|
worker_driver.js
|
||||||
worker_wrapper.js
|
worker_wrapper.js
|
||||||
bug1060621_worker.js
|
bug1060621_worker.js
|
||||||
bug1062920_worker.js
|
bug1062920_worker.js
|
||||||
webSocket_sharedWorker.js
|
|
||||||
bug1104064_worker.js
|
bug1104064_worker.js
|
||||||
worker_consoleAndBlobs.js
|
worker_consoleAndBlobs.js
|
||||||
bug1132395_sharedWorker.js
|
bug1132395_sharedWorker.js
|
||||||
|
@ -96,8 +87,6 @@ support-files =
|
||||||
sharedWorker_ports.js
|
sharedWorker_ports.js
|
||||||
sharedWorker_lifetime.js
|
sharedWorker_lifetime.js
|
||||||
worker_referrer.js
|
worker_referrer.js
|
||||||
websocket_https.html
|
|
||||||
websocket_https_worker.js
|
|
||||||
importScripts_3rdParty_worker.js
|
importScripts_3rdParty_worker.js
|
||||||
worker_bug1278777.js
|
worker_bug1278777.js
|
||||||
worker_setTimeoutWith0.js
|
worker_setTimeoutWith0.js
|
||||||
|
@ -106,16 +95,6 @@ support-files =
|
||||||
worker_suspended.js
|
worker_suspended.js
|
||||||
window_suspended.html
|
window_suspended.html
|
||||||
!/dom/base/test/file_bug945152.jar
|
!/dom/base/test/file_bug945152.jar
|
||||||
!/dom/base/test/file_websocket_basic_wsh.py
|
|
||||||
!/dom/base/test/file_websocket_hello_wsh.py
|
|
||||||
!/dom/base/test/file_websocket_http_resource.txt
|
|
||||||
!/dom/base/test/file_websocket_permessage_deflate_disabled_wsh.py
|
|
||||||
!/dom/base/test/file_websocket_permessage_deflate_params_wsh.py
|
|
||||||
!/dom/base/test/file_websocket_permessage_deflate_rejected_wsh.py
|
|
||||||
!/dom/base/test/file_websocket_permessage_deflate_wsh.py
|
|
||||||
!/dom/base/test/file_websocket_wsh.py
|
|
||||||
!/dom/base/test/websocket_helpers.js
|
|
||||||
!/dom/base/test/websocket_tests.js
|
|
||||||
!/dom/tests/mochitest/notification/MockServices.js
|
!/dom/tests/mochitest/notification/MockServices.js
|
||||||
!/dom/tests/mochitest/notification/NotificationTest.js
|
!/dom/tests/mochitest/notification/NotificationTest.js
|
||||||
!/dom/xhr/tests/relativeLoad_import.js
|
!/dom/xhr/tests/relativeLoad_import.js
|
||||||
|
@ -201,23 +180,6 @@ support-files =
|
||||||
[test_throwingOnerror.html]
|
[test_throwingOnerror.html]
|
||||||
[test_timeoutTracing.html]
|
[test_timeoutTracing.html]
|
||||||
[test_transferable.html]
|
[test_transferable.html]
|
||||||
[test_websocket1.html]
|
|
||||||
skip-if = toolkit == 'android' #bug 982828
|
|
||||||
[test_websocket2.html]
|
|
||||||
skip-if = toolkit == 'android' #bug 982828
|
|
||||||
[test_websocket3.html]
|
|
||||||
skip-if = toolkit == 'android' #bug 982828
|
|
||||||
[test_websocket4.html]
|
|
||||||
skip-if = toolkit == 'android' #bug 982828
|
|
||||||
[test_websocket5.html]
|
|
||||||
skip-if = toolkit == 'android' #bug 982828
|
|
||||||
[test_websocket_basic.html]
|
|
||||||
skip-if = toolkit == 'android' #bug 982828
|
|
||||||
[test_websocket_https.html]
|
|
||||||
[test_websocket_loadgroup.html]
|
|
||||||
skip-if = toolkit == 'android' #bug 982828
|
|
||||||
[test_webSocket_sharedWorker.html]
|
|
||||||
skip-if = toolkit == 'android' #bug 982828
|
|
||||||
[test_worker_interfaces.html]
|
[test_worker_interfaces.html]
|
||||||
[test_worker_interfaces_secureContext.html]
|
[test_worker_interfaces_secureContext.html]
|
||||||
scheme=https
|
scheme=https
|
||||||
|
|
Загрузка…
Ссылка в новой задаче