Update web-platform-tests to revision 12d3e15e5ecae695e1216c358d613705fbff6b68

This commit is contained in:
Ms2ger 2015-07-27 13:50:32 +02:00
parent 78455ec033
commit 5b2ca4d132
424 changed files with 4377 additions and 8656 deletions

View file

@ -354,7 +354,33 @@ function requestViaObject(url) {
return createRequestViaElement("object", {"data": url}, document.body);
}
/**
* Creates a new WebSocket pointing to {@code url} and sends a message string
* "echo". The {@code message} and {@code error} events are triggering the
* returned promise resolve/reject events.
* @param {string} url The URL for WebSocket to connect to.
* @return {Promise} The promise for success/error events.
*/
function requestViaWebSocket(url) {
return new Promise(function(resolve, reject) {
var websocket = new WebSocket(url);
websocket.addEventListener("message", function(e) {
resolve(JSON.parse(e.data));
});
websocket.addEventListener("open", function(e) {
websocket.send("echo");
});
websocket.addEventListener("error", function(e) {
reject(e)
});
});
}
// SanityChecker does nothing in release mode. See sanity-checker.js for debug
// mode.
function SanityChecker() {}
SanityChecker.prototype.checkScenario = function() {};
SanityChecker.prototype.setFailTimeout = function(test, timeout) {};