Summary: | Adding mock class to test RTCDataChannelHandler | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Thiago de Barros Lacerda <thiago.lacerda> | ||||||
Component: | WebCore Misc. | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue, eric.carlson, glenn, gyuyoung.kim, hta, jer.noble, rakuco, tommyw | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 124288 | ||||||||
Attachments: |
|
Description
Thiago de Barros Lacerda
2013-10-23 06:42:31 PDT
Created attachment 214955 [details]
Patch
Comment on attachment 214955 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=214955&action=review > Source/WebCore/ChangeLog:11 > + No new tests needed. I would say "Existing tests updated" instead. > Source/WebCore/ChangeLog:16 > + * platform/mock/RTCDataChannelHandlerMock.cpp: Copied from Source/WebCore/platform/mock/RTCNotifiersMock.cpp. > + * platform/mock/RTCDataChannelHandlerMock.h: Copied from Source/WebCore/platform/mock/RTCNotifiersMock.h. Are these "Copied from" comments correct? > Source/WebCore/platform/mock/RTCDataChannelHandlerMock.h:51 > + String label() OVERRIDE { return m_label; } > + bool ordered() OVERRIDE { return m_ordered; } > + unsigned short maxRetransmitTime() OVERRIDE { return m_maxRetransmitTime; } > + unsigned short maxRetransmits() OVERRIDE { return m_maxRetransmits; } > + String protocol() OVERRIDE { return m_protocol; } > + bool negotiated() OVERRIDE { return m_negotiated; } > + unsigned short id() OVERRIDE { return m_id; } > + unsigned long bufferedAmount() OVERRIDE { return 0; } These should all be virtual. > Source/WebCore/platform/mock/RTCDataChannelHandlerMock.h:66 > + String m_label; > + bool m_ordered; > + unsigned short m_maxRetransmitTime; > + unsigned short m_maxRetransmits; > + String m_protocol; > + bool m_negotiated; > + unsigned short m_id; Nit: it may be slightly more space efficient to have the "short" and "bool" members last. (In reply to comment #2) > (From update of attachment 214955 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=214955&action=review > > > Source/WebCore/ChangeLog:11 > > + No new tests needed. > > I would say "Existing tests updated" instead. > > > Source/WebCore/ChangeLog:16 > > + * platform/mock/RTCDataChannelHandlerMock.cpp: Copied from Source/WebCore/platform/mock/RTCNotifiersMock.cpp. > > + * platform/mock/RTCDataChannelHandlerMock.h: Copied from Source/WebCore/platform/mock/RTCNotifiersMock.h. > > Are these "Copied from" comments correct? Git thinks that I copied them, maybe because of its similarity check. But I didn't not copy. Should I remove them? > > > Source/WebCore/platform/mock/RTCDataChannelHandlerMock.h:51 > > + String label() OVERRIDE { return m_label; } > > + bool ordered() OVERRIDE { return m_ordered; } > > + unsigned short maxRetransmitTime() OVERRIDE { return m_maxRetransmitTime; } > > + unsigned short maxRetransmits() OVERRIDE { return m_maxRetransmits; } > > + String protocol() OVERRIDE { return m_protocol; } > > + bool negotiated() OVERRIDE { return m_negotiated; } > > + unsigned short id() OVERRIDE { return m_id; } > > + unsigned long bufferedAmount() OVERRIDE { return 0; } > > These should all be virtual. Why? The class is final, so no class can use it as superclass and override its methods. > > > Source/WebCore/platform/mock/RTCDataChannelHandlerMock.h:66 > > + String m_label; > > + bool m_ordered; > > + unsigned short m_maxRetransmitTime; > > + unsigned short m_maxRetransmits; > > + String m_protocol; > > + bool m_negotiated; > > + unsigned short m_id; > > Nit: it may be slightly more space efficient to have the "short" and "bool" members last. OK (In reply to comment #3) > (In reply to comment #2) > > (From update of attachment 214955 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=214955&action=review > > > > > Source/WebCore/ChangeLog:11 > > > + No new tests needed. > > > > I would say "Existing tests updated" instead. > > > > > Source/WebCore/ChangeLog:16 > > > + * platform/mock/RTCDataChannelHandlerMock.cpp: Copied from Source/WebCore/platform/mock/RTCNotifiersMock.cpp. > > > + * platform/mock/RTCDataChannelHandlerMock.h: Copied from Source/WebCore/platform/mock/RTCNotifiersMock.h. > > > > Are these "Copied from" comments correct? > > Git thinks that I copied them, maybe because of its similarity check. But I didn't not copy. Should I remove them? > > I would remove the comments because they are incorrect. > > > Source/WebCore/platform/mock/RTCDataChannelHandlerMock.h:51 > > > + String label() OVERRIDE { return m_label; } > > > + bool ordered() OVERRIDE { return m_ordered; } > > > + unsigned short maxRetransmitTime() OVERRIDE { return m_maxRetransmitTime; } > > > + unsigned short maxRetransmits() OVERRIDE { return m_maxRetransmits; } > > > + String protocol() OVERRIDE { return m_protocol; } > > > + bool negotiated() OVERRIDE { return m_negotiated; } > > > + unsigned short id() OVERRIDE { return m_id; } > > > + unsigned long bufferedAmount() OVERRIDE { return 0; } > > > > These should all be virtual. > > Why? The class is final, so no class can use it as superclass and override its methods. > Oops :-O (In reply to comment #4) > (In reply to comment #3) > > (In reply to comment #2) > > > (From update of attachment 214955 [details] [details] [details]) > > > View in context: https://bugs.webkit.org/attachment.cgi?id=214955&action=review > > > > > > > Source/WebCore/ChangeLog:11 > > > > + No new tests needed. > > > > > > I would say "Existing tests updated" instead. > > > > > > > Source/WebCore/ChangeLog:16 > > > > + * platform/mock/RTCDataChannelHandlerMock.cpp: Copied from Source/WebCore/platform/mock/RTCNotifiersMock.cpp. > > > > + * platform/mock/RTCDataChannelHandlerMock.h: Copied from Source/WebCore/platform/mock/RTCNotifiersMock.h. > > > > > > Are these "Copied from" comments correct? > > > > Git thinks that I copied them, maybe because of its similarity check. But I didn't not copy. Should I remove them? > > > > > I would remove the comments because they are incorrect. > > > > > Source/WebCore/platform/mock/RTCDataChannelHandlerMock.h:51 > > > > + String label() OVERRIDE { return m_label; } > > > > + bool ordered() OVERRIDE { return m_ordered; } > > > > + unsigned short maxRetransmitTime() OVERRIDE { return m_maxRetransmitTime; } > > > > + unsigned short maxRetransmits() OVERRIDE { return m_maxRetransmits; } > > > > + String protocol() OVERRIDE { return m_protocol; } > > > > + bool negotiated() OVERRIDE { return m_negotiated; } > > > > + unsigned short id() OVERRIDE { return m_id; } > > > > + unsigned long bufferedAmount() OVERRIDE { return 0; } > > > > > > These should all be virtual. > > > > Why? The class is final, so no class can use it as superclass and override its methods. > > > > Oops :-O By looking at the webkit source, I could notice that they put the virtual keyword anyway, maybe is it a style? Should I add virtual? (In reply to comment #5) > By looking at the webkit source, I could notice that they put the virtual keyword anyway, maybe is it a style? Should I add virtual? I think so. It is slightly pedantic, but I think it makes it more obvious and it what is typically done in WebKit. (In reply to comment #6) > (In reply to comment #5) > > By looking at the webkit source, I could notice that they put the virtual keyword anyway, maybe is it a style? Should I add virtual? > > I think so. It is slightly pedantic, but I think it makes it more obvious and it what is typically done in WebKit. np :) Created attachment 214998 [details]
Patch
Comment on attachment 214998 [details] Patch Clearing flags on attachment: 214998 Committed r157892: <http://trac.webkit.org/changeset/157892> All reviewed patches have been landed. Closing bug. |