Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Side by Side Diff: third_party/WebKit/Source/core/page/EventSourceParserTest.cpp

Issue 1717863002: EventSourceParserTest: fix invalid cast in GC finalizer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/page/EventSourceParser.h" 5 #include "core/page/EventSourceParser.h"
6 6
7 #include "core/page/EventSource.h" 7 #include "core/page/EventSource.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "wtf/text/CharacterNames.h" 9 #include "wtf/text/CharacterNames.h"
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } 52 }
53 void onReconnectionTimeSet(unsigned long long reconnectionTime) override 53 void onReconnectionTimeSet(unsigned long long reconnectionTime) override
54 { 54 {
55 m_events.append(EventOrReconnectionTimeSetting(reconnectionTime)); 55 m_events.append(EventOrReconnectionTimeSetting(reconnectionTime));
56 } 56 }
57 57
58 private: 58 private:
59 Vector<EventOrReconnectionTimeSetting> m_events; 59 Vector<EventOrReconnectionTimeSetting> m_events;
60 }; 60 };
61 61
62 class StoppingClient : public GarbageCollectedFinalized<Client>, public EventSou rceParser::Client { 62 class StoppingClient : public GarbageCollectedFinalized<StoppingClient>, public EventSourceParser::Client {
63 USING_GARBAGE_COLLECTED_MIXIN(StoppingClient); 63 USING_GARBAGE_COLLECTED_MIXIN(StoppingClient);
64 public: 64 public:
65 ~StoppingClient() override {} 65 ~StoppingClient() override {}
66 const Vector<EventOrReconnectionTimeSetting>& events() const { return m_even ts; } 66 const Vector<EventOrReconnectionTimeSetting>& events() const { return m_even ts; }
67 void setParser(EventSourceParser* parser) { m_parser = parser; } 67 void setParser(EventSourceParser* parser) { m_parser = parser; }
68 void onMessageEvent(const AtomicString& event, const String& data, const Ato micString& id) override 68 void onMessageEvent(const AtomicString& event, const String& data, const Ato micString& id) override
69 { 69 {
70 m_parser->stop(); 70 m_parser->stop();
71 m_events.append(EventOrReconnectionTimeSetting(event, data, id)); 71 m_events.append(EventOrReconnectionTimeSetting(event, data, id));
72 } 72 }
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 ASSERT_EQ(1u, events.size()); 398 ASSERT_EQ(1u, events.size());
399 ASSERT_EQ(EventOrReconnectionTimeSetting::Type::Event, events[0].type); 399 ASSERT_EQ(EventOrReconnectionTimeSetting::Type::Event, events[0].type);
400 EXPECT_EQ("message", events[0].event); 400 EXPECT_EQ("message", events[0].event);
401 EXPECT_EQ("hello", events[0].data); 401 EXPECT_EQ("hello", events[0].data);
402 EXPECT_EQ("99", parser->lastEventId()); 402 EXPECT_EQ("99", parser->lastEventId());
403 } 403 }
404 404
405 } // namespace 405 } // namespace
406 406
407 } // namespace blink 407 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698