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

Side by Side Diff: Source/core/page/NetworkStateNotifierTest.cpp

Issue 310353003: Oilpan: Replace RefPtrs and raw pointers to Node and its subclasses in core/frame and core/page wit… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/page/DragController.cpp ('k') | 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 /* 1 /*
2 * Copyright (c) 2014, Google Inc. All rights reserved. 2 * Copyright (c) 2014, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 void addObserverOnNotification(StateObserver* observer, StateObserver* obser verToAdd) 125 void addObserverOnNotification(StateObserver* observer, StateObserver* obser verToAdd)
126 { 126 {
127 observer->setNotificationCallback(bind(&NetworkStateNotifier::addObserve r, &m_notifier, observerToAdd, executionContext())); 127 observer->setNotificationCallback(bind(&NetworkStateNotifier::addObserve r, &m_notifier, observerToAdd, executionContext()));
128 } 128 }
129 129
130 void removeObserverOnNotification(StateObserver* observer, StateObserver* ob serverToRemove) 130 void removeObserverOnNotification(StateObserver* observer, StateObserver* ob serverToRemove)
131 { 131 {
132 observer->setNotificationCallback(bind(&NetworkStateNotifier::removeObse rver, &m_notifier, observerToRemove, executionContext())); 132 observer->setNotificationCallback(bind(&NetworkStateNotifier::removeObse rver, &m_notifier, observerToRemove, executionContext()));
133 } 133 }
134 134
135 RefPtr<Document> m_document; 135 RefPtrWillBePersistent<Document> m_document;
136 RefPtr<Document> m_document2; 136 RefPtrWillBePersistent<Document> m_document2;
137 NetworkStateNotifier m_notifier; 137 NetworkStateNotifier m_notifier;
138 }; 138 };
139 139
140 TEST_F(NetworkStateNotifierTest, AddObserver) 140 TEST_F(NetworkStateNotifierTest, AddObserver)
141 { 141 {
142 StateObserver observer; 142 StateObserver observer;
143 m_notifier.addObserver(&observer, executionContext()); 143 m_notifier.addObserver(&observer, executionContext());
144 EXPECT_EQ(observer.observedType(), blink::ConnectionTypeNone); 144 EXPECT_EQ(observer.observedType(), blink::ConnectionTypeNone);
145 145
146 setType(blink::ConnectionTypeBluetooth); 146 setType(blink::ConnectionTypeBluetooth);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 m_notifier.addObserver(&observer2, executionContext2()); 271 m_notifier.addObserver(&observer2, executionContext2());
272 m_notifier.removeObserver(&observer1, executionContext()); 272 m_notifier.removeObserver(&observer1, executionContext());
273 m_notifier.removeObserver(&observer2, executionContext2()); 273 m_notifier.removeObserver(&observer2, executionContext2());
274 274
275 setType(blink::ConnectionTypeBluetooth); 275 setType(blink::ConnectionTypeBluetooth);
276 EXPECT_EQ(observer1.observedType(), blink::ConnectionTypeNone); 276 EXPECT_EQ(observer1.observedType(), blink::ConnectionTypeNone);
277 EXPECT_EQ(observer2.observedType(), blink::ConnectionTypeNone); 277 EXPECT_EQ(observer2.observedType(), blink::ConnectionTypeNone);
278 } 278 }
279 279
280 } // namespace WebCore 280 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/DragController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698