Commit 0a49245b authored by Henrik Boström's avatar Henrik Boström Committed by Commit Bot

Added RTCErrorEvent and RTCErrorEventInit.

They're currently not wired up to be used anywhere, but they are
constructable from JavaScript and can be used for real in future CLs.

Intent to Implement & Ship:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/TsJA1XX7mTE

Bug: 821806
Change-Id: I463e3e322908c9b67b7032891193ec77b368aa20
Reviewed-on: https://chromium-review.googlesource.com/c/1424951
Commit-Queue: Henrik Boström <hbos@chromium.org>
Reviewed-by: default avatarPhilip Jägenstedt <foolip@chromium.org>
Reviewed-by: default avatarHarald Alvestrand <hta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629129}
parent 82fedcbc
......@@ -231,6 +231,7 @@ modules_idl_files =
"peerconnection/rtc_dtmf_sender.idl",
"peerconnection/rtc_dtmf_tone_change_event.idl",
"peerconnection/rtc_error.idl",
"peerconnection/rtc_error_event.idl",
"peerconnection/rtc_ice_candidate.idl",
"peerconnection/rtc_ice_transport.idl",
"peerconnection/rtc_legacy_stats_report.idl",
......@@ -633,6 +634,7 @@ modules_dictionary_idl_files =
"peerconnection/rtc_data_channel_init.idl",
"peerconnection/rtc_dtls_fingerprint.idl",
"peerconnection/rtc_dtmf_tone_change_event_init.idl",
"peerconnection/rtc_error_event_init.idl",
"peerconnection/rtc_error_init.idl",
"peerconnection/rtc_ice_candidate_init.idl",
"peerconnection/rtc_ice_candidate_pair.idl",
......
......@@ -61,6 +61,8 @@ blink_modules_sources("peerconnection") {
"rtc_dtmf_tone_change_event.h",
"rtc_error.cc",
"rtc_error.h",
"rtc_error_event.cc",
"rtc_error_event.h",
"rtc_error_util.cc",
"rtc_error_util.h",
"rtc_ice_candidate.cc",
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/renderer/modules/peerconnection/rtc_error_event.h"
#include "third_party/blink/renderer/platform/heap/heap.h"
namespace blink {
// static
RTCErrorEvent* RTCErrorEvent::Create(const AtomicString& type,
const RTCErrorEventInit* event_init_dict) {
return MakeGarbageCollected<RTCErrorEvent>(type, event_init_dict);
}
RTCErrorEvent::RTCErrorEvent(const AtomicString& type,
const RTCErrorEventInit* event_init_dict)
: Event(type, event_init_dict), error_(event_init_dict->error()) {
DCHECK(event_init_dict);
}
RTCError* RTCErrorEvent::error() const {
return error_;
}
void RTCErrorEvent::Trace(blink::Visitor* visitor) {
visitor->Trace(error_);
Event::Trace(visitor);
}
} // namespace blink
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_ERROR_EVENT_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_ERROR_EVENT_H_
#include "third_party/blink/renderer/modules/event_modules.h"
#include "third_party/blink/renderer/modules/peerconnection/rtc_error.h"
#include "third_party/blink/renderer/modules/peerconnection/rtc_error_event_init.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/heap/member.h"
#include "third_party/blink/renderer/platform/heap/visitor.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"
namespace blink {
class RTCErrorEvent final : public Event {
DEFINE_WRAPPERTYPEINFO();
public:
static RTCErrorEvent* Create(const AtomicString& type,
const RTCErrorEventInit* event_init_dict);
RTCErrorEvent(const AtomicString& type,
const RTCErrorEventInit* event_init_dict);
RTCError* error() const;
void Trace(blink::Visitor*) override;
private:
Member<RTCError> error_;
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_PEERCONNECTION_RTC_ERROR_EVENT_H_
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://w3c.github.io/webrtc-pc/#dom-rtcerrorevent
[
Exposed=Window,
Constructor(DOMString type, RTCErrorEventInit eventInitDict)
] interface RTCErrorEvent : Event {
readonly attribute RTCError error;
};
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://w3c.github.io/webrtc-pc/#dom-rtcerroreventinit
dictionary RTCErrorEventInit : EventInit {
required RTCError error;
};
......@@ -628,7 +628,7 @@ enum RTCErrorDetailType {
};
[Exposed=Window,
Constructor(DOMString type, RTCErrorEventInit eventInitDict)]
Constructor(DOMString type, optional RTCErrorEventInit eventInitDict)]
interface RTCErrorEvent : Event {
readonly attribute RTCError? error;
};
......
This is a testharness.js-based test.
Found 494 tests; 372 PASS, 122 FAIL, 0 TIMEOUT, 0 NOTRUN.
Found 494 tests; 378 PASS, 116 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS idl_test setup
PASS Test driver for asyncInitCertificate
FAIL Test driver for asyncInitTransports assert_unreached: Failed to run asyncInitTransports: ReferenceError: RTCSctpTransport is not defined Reached unreachable code
......@@ -492,15 +492,15 @@ FAIL RTCStatsEvent interface: existence and properties of interface prototype ob
FAIL RTCStatsEvent interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "RTCStatsEvent" expected property "RTCStatsEvent" missing
FAIL RTCStatsEvent interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "RTCStatsEvent" expected property "RTCStatsEvent" missing
FAIL RTCStatsEvent interface: attribute report assert_own_property: self does not have own property "RTCStatsEvent" expected property "RTCStatsEvent" missing
FAIL RTCErrorEvent interface: existence and properties of interface object assert_own_property: self does not have own property "RTCErrorEvent" expected property "RTCErrorEvent" missing
FAIL RTCErrorEvent interface object length assert_own_property: self does not have own property "RTCErrorEvent" expected property "RTCErrorEvent" missing
FAIL RTCErrorEvent interface object name assert_own_property: self does not have own property "RTCErrorEvent" expected property "RTCErrorEvent" missing
FAIL RTCErrorEvent interface: existence and properties of interface prototype object assert_own_property: self does not have own property "RTCErrorEvent" expected property "RTCErrorEvent" missing
FAIL RTCErrorEvent interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "RTCErrorEvent" expected property "RTCErrorEvent" missing
FAIL RTCErrorEvent interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "RTCErrorEvent" expected property "RTCErrorEvent" missing
FAIL RTCErrorEvent interface: attribute error assert_own_property: self does not have own property "RTCErrorEvent" expected property "RTCErrorEvent" missing
FAIL RTCErrorEvent must be primary interface of new RTCErrorEvent('error') assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: RTCErrorEvent is not defined"
FAIL Stringification of new RTCErrorEvent('error') assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: RTCErrorEvent is not defined"
FAIL RTCErrorEvent interface: new RTCErrorEvent('error') must inherit property "error" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: RTCErrorEvent is not defined"
PASS RTCErrorEvent interface: existence and properties of interface object
FAIL RTCErrorEvent interface object length assert_equals: wrong value for RTCErrorEvent.length expected 1 but got 2
PASS RTCErrorEvent interface object name
PASS RTCErrorEvent interface: existence and properties of interface prototype object
PASS RTCErrorEvent interface: existence and properties of interface prototype object's "constructor" property
PASS RTCErrorEvent interface: existence and properties of interface prototype object's @@unscopables property
PASS RTCErrorEvent interface: attribute error
FAIL RTCErrorEvent must be primary interface of new RTCErrorEvent('error') assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Failed to construct 'RTCErrorEvent': 2 arguments required, but only 1 present."
FAIL Stringification of new RTCErrorEvent('error') assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Failed to construct 'RTCErrorEvent': 2 arguments required, but only 1 present."
FAIL RTCErrorEvent interface: new RTCErrorEvent('error') must inherit property "error" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Failed to construct 'RTCErrorEvent': 2 arguments required, but only 1 present."
Harness: the test ran to completion.
......@@ -4872,6 +4872,10 @@ interface RTCError : DOMException
getter sdpLineNumber
getter sentAlert
method constructor
interface RTCErrorEvent : Event
attribute @@toStringTag
getter error
method constructor
interface RTCIceCandidate
attribute @@toStringTag
getter address
......
This is a testharness.js-based test.
Found 494 tests; 335 PASS, 159 FAIL, 0 TIMEOUT, 0 NOTRUN.
Found 494 tests; 341 PASS, 153 FAIL, 0 TIMEOUT, 0 NOTRUN.
PASS idl_test setup
PASS Test driver for asyncInitCertificate
FAIL Test driver for asyncInitTransports assert_unreached: Failed to run asyncInitTransports: ReferenceError: RTCSctpTransport is not defined Reached unreachable code
......@@ -492,15 +492,15 @@ FAIL RTCStatsEvent interface: existence and properties of interface prototype ob
FAIL RTCStatsEvent interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "RTCStatsEvent" expected property "RTCStatsEvent" missing
FAIL RTCStatsEvent interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "RTCStatsEvent" expected property "RTCStatsEvent" missing
FAIL RTCStatsEvent interface: attribute report assert_own_property: self does not have own property "RTCStatsEvent" expected property "RTCStatsEvent" missing
FAIL RTCErrorEvent interface: existence and properties of interface object assert_own_property: self does not have own property "RTCErrorEvent" expected property "RTCErrorEvent" missing
FAIL RTCErrorEvent interface object length assert_own_property: self does not have own property "RTCErrorEvent" expected property "RTCErrorEvent" missing
FAIL RTCErrorEvent interface object name assert_own_property: self does not have own property "RTCErrorEvent" expected property "RTCErrorEvent" missing
FAIL RTCErrorEvent interface: existence and properties of interface prototype object assert_own_property: self does not have own property "RTCErrorEvent" expected property "RTCErrorEvent" missing
FAIL RTCErrorEvent interface: existence and properties of interface prototype object's "constructor" property assert_own_property: self does not have own property "RTCErrorEvent" expected property "RTCErrorEvent" missing
FAIL RTCErrorEvent interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "RTCErrorEvent" expected property "RTCErrorEvent" missing
FAIL RTCErrorEvent interface: attribute error assert_own_property: self does not have own property "RTCErrorEvent" expected property "RTCErrorEvent" missing
FAIL RTCErrorEvent must be primary interface of new RTCErrorEvent('error') assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: RTCErrorEvent is not defined"
FAIL Stringification of new RTCErrorEvent('error') assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: RTCErrorEvent is not defined"
FAIL RTCErrorEvent interface: new RTCErrorEvent('error') must inherit property "error" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: RTCErrorEvent is not defined"
PASS RTCErrorEvent interface: existence and properties of interface object
FAIL RTCErrorEvent interface object length assert_equals: wrong value for RTCErrorEvent.length expected 1 but got 2
PASS RTCErrorEvent interface object name
PASS RTCErrorEvent interface: existence and properties of interface prototype object
PASS RTCErrorEvent interface: existence and properties of interface prototype object's "constructor" property
PASS RTCErrorEvent interface: existence and properties of interface prototype object's @@unscopables property
PASS RTCErrorEvent interface: attribute error
FAIL RTCErrorEvent must be primary interface of new RTCErrorEvent('error') assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Failed to construct 'RTCErrorEvent': 2 arguments required, but only 1 present."
FAIL Stringification of new RTCErrorEvent('error') assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Failed to construct 'RTCErrorEvent': 2 arguments required, but only 1 present."
FAIL RTCErrorEvent interface: new RTCErrorEvent('error') must inherit property "error" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: Failed to construct 'RTCErrorEvent': 2 arguments required, but only 1 present."
Harness: the test ran to completion.
......@@ -5628,6 +5628,10 @@ interface RTCError : DOMException
getter sdpLineNumber
getter sentAlert
method constructor
interface RTCErrorEvent : Event
attribute @@toStringTag
getter error
method constructor
interface RTCIceCandidate
attribute @@toStringTag
getter address
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment