Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/browser/webrtc/webrtc_internals.h" | 5 #include "content/browser/webrtc/webrtc_internals.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "content/browser/webrtc/webrtc_internals_ui_observer.h" | 13 #include "content/browser/webrtc/webrtc_internals_ui_observer.h" |
| 14 #include "content/public/test/test_browser_thread.h" | 14 #include "content/public/test/test_browser_thread.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 static const char kContraints[] = "c"; | 21 static const char kContraints[] = "c"; |
| 22 static const char kRtcConfiguration[] = "r"; | 22 static const char kRtcConfiguration[] = "r"; |
| 23 static const char kUrl[] = "u"; | 23 static const char kUrl[] = "u"; |
| 24 | 24 |
| 25 class MockWebRtcInternalsProxy : public WebRTCInternalsUIObserver { | 25 class MockWebRtcInternalsProxy : public WebRTCInternalsUIObserver { |
| 26 public: | 26 public: |
| 27 MockWebRtcInternalsProxy() : loop_(nullptr) {} | 27 MockWebRtcInternalsProxy() : loop_(nullptr) {} |
| 28 explicit MockWebRtcInternalsProxy(base::RunLoop* loop) : loop_(loop) {} | 28 explicit MockWebRtcInternalsProxy(base::RunLoop* loop) : loop_(loop) {} |
| 29 | 29 |
| 30 const std::string& command() const { | 30 const std::string& command() const { return command_; } |
| 31 return command_; | |
| 32 } | |
| 33 | 31 |
| 34 base::Value* value() { | 32 base::Value* value() { return value_.get(); } |
| 35 return value_.get(); | |
| 36 } | |
| 37 | 33 |
| 38 private: | 34 private: |
| 39 void OnUpdate(const char* command, const base::Value* value) override { | 35 void OnUpdate(const char* command, const base::Value* value) override { |
| 40 command_ = command; | 36 command_ = command; |
| 41 value_.reset(value ? value->DeepCopy() : nullptr); | 37 value_.reset(value ? value->DeepCopy() : nullptr); |
| 42 if (loop_) | 38 if (loop_) |
| 43 loop_->Quit(); | 39 loop_->Quit(); |
| 44 } | 40 } |
| 45 | 41 |
| 46 std::string command_; | 42 std::string command_; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 }; | 105 }; |
| 110 | 106 |
| 111 TEST_F(WebRtcInternalsTest, AddRemoveObserver) { | 107 TEST_F(WebRtcInternalsTest, AddRemoveObserver) { |
| 112 base::RunLoop loop; | 108 base::RunLoop loop; |
| 113 MockWebRtcInternalsProxy observer(&loop); | 109 MockWebRtcInternalsProxy observer(&loop); |
| 114 WebRTCInternalsForTest webrtc_internals; | 110 WebRTCInternalsForTest webrtc_internals; |
| 115 webrtc_internals.AddObserver(&observer); | 111 webrtc_internals.AddObserver(&observer); |
| 116 | 112 |
| 117 webrtc_internals.RemoveObserver(&observer); | 113 webrtc_internals.RemoveObserver(&observer); |
| 118 // The observer should not get notified of this activity. | 114 // The observer should not get notified of this activity. |
| 119 webrtc_internals.OnAddPeerConnection( | 115 webrtc_internals.OnAddPeerConnection(0, 3, 4, kUrl, kRtcConfiguration, |
| 120 0, 3, 4, kUrl, kRtcConfiguration, kContraints); | 116 kContraints); |
| 121 | 117 |
| 122 BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE, | 118 BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE, |
| 123 loop.QuitClosure(), | 119 loop.QuitClosure(), |
| 124 base::TimeDelta::FromMilliseconds(5)); | 120 base::TimeDelta::FromMilliseconds(5)); |
| 125 loop.Run(); | 121 loop.Run(); |
| 126 | 122 |
| 127 EXPECT_EQ("", observer.command()); | 123 EXPECT_EQ("", observer.command()); |
| 128 | 124 |
| 129 webrtc_internals.OnRemovePeerConnection(3, 4); | 125 webrtc_internals.OnRemovePeerConnection(3, 4); |
| 130 } | 126 } |
| 131 | 127 |
| 132 TEST_F(WebRtcInternalsTest, SendAddPeerConnectionUpdate) { | 128 TEST_F(WebRtcInternalsTest, SendAddPeerConnectionUpdate) { |
| 133 base::RunLoop loop; | 129 base::RunLoop loop; |
| 134 MockWebRtcInternalsProxy observer(&loop); | 130 MockWebRtcInternalsProxy observer(&loop); |
| 135 WebRTCInternalsForTest webrtc_internals; | 131 WebRTCInternalsForTest webrtc_internals; |
| 136 webrtc_internals.AddObserver(&observer); | 132 webrtc_internals.AddObserver(&observer); |
| 137 webrtc_internals.OnAddPeerConnection( | 133 webrtc_internals.OnAddPeerConnection(0, 1, 2, kUrl, kRtcConfiguration, |
| 138 0, 1, 2, kUrl, kRtcConfiguration, kContraints); | 134 kContraints); |
| 139 | 135 |
| 140 loop.Run(); | 136 loop.Run(); |
| 141 | 137 |
| 142 ASSERT_EQ("addPeerConnection", observer.command()); | 138 ASSERT_EQ("addPeerConnection", observer.command()); |
| 143 | 139 |
| 144 base::DictionaryValue* dict = NULL; | 140 base::DictionaryValue* dict = NULL; |
| 145 EXPECT_TRUE(observer.value()->GetAsDictionary(&dict)); | 141 EXPECT_TRUE(observer.value()->GetAsDictionary(&dict)); |
| 146 | 142 |
| 147 VerifyInt(dict, "pid", 1); | 143 VerifyInt(dict, "pid", 1); |
| 148 VerifyInt(dict, "lid", 2); | 144 VerifyInt(dict, "lid", 2); |
| 149 VerifyString(dict, "url", kUrl); | 145 VerifyString(dict, "url", kUrl); |
| 150 VerifyString(dict, "rtcConfiguration", kRtcConfiguration); | 146 VerifyString(dict, "rtcConfiguration", kRtcConfiguration); |
| 151 VerifyString(dict, "constraints", kContraints); | 147 VerifyString(dict, "constraints", kContraints); |
| 152 | 148 |
| 153 webrtc_internals.RemoveObserver(&observer); | 149 webrtc_internals.RemoveObserver(&observer); |
| 154 webrtc_internals.OnRemovePeerConnection(1, 2); | 150 webrtc_internals.OnRemovePeerConnection(1, 2); |
| 155 } | 151 } |
| 156 | 152 |
| 157 TEST_F(WebRtcInternalsTest, SendRemovePeerConnectionUpdate) { | 153 TEST_F(WebRtcInternalsTest, SendRemovePeerConnectionUpdate) { |
| 158 base::RunLoop loop; | 154 base::RunLoop loop; |
| 159 MockWebRtcInternalsProxy observer(&loop); | 155 MockWebRtcInternalsProxy observer(&loop); |
| 160 WebRTCInternalsForTest webrtc_internals; | 156 WebRTCInternalsForTest webrtc_internals; |
| 161 webrtc_internals.AddObserver(&observer); | 157 webrtc_internals.AddObserver(&observer); |
| 162 webrtc_internals.OnAddPeerConnection( | 158 webrtc_internals.OnAddPeerConnection(0, 1, 2, kUrl, kRtcConfiguration, |
| 163 0, 1, 2, kUrl, kRtcConfiguration, kContraints); | 159 kContraints); |
| 164 webrtc_internals.OnRemovePeerConnection(1, 2); | 160 webrtc_internals.OnRemovePeerConnection(1, 2); |
| 165 | 161 |
| 166 loop.Run(); | 162 loop.Run(); |
| 167 | 163 |
| 168 ASSERT_EQ("removePeerConnection", observer.command()); | 164 ASSERT_EQ("removePeerConnection", observer.command()); |
| 169 | 165 |
| 170 base::DictionaryValue* dict = NULL; | 166 base::DictionaryValue* dict = NULL; |
| 171 EXPECT_TRUE(observer.value()->GetAsDictionary(&dict)); | 167 EXPECT_TRUE(observer.value()->GetAsDictionary(&dict)); |
| 172 | 168 |
| 173 VerifyInt(dict, "pid", 1); | 169 VerifyInt(dict, "pid", 1); |
| 174 VerifyInt(dict, "lid", 2); | 170 VerifyInt(dict, "lid", 2); |
| 175 | 171 |
| 176 webrtc_internals.RemoveObserver(&observer); | 172 webrtc_internals.RemoveObserver(&observer); |
| 177 } | 173 } |
| 178 | 174 |
| 179 TEST_F(WebRtcInternalsTest, SendUpdatePeerConnectionUpdate) { | 175 TEST_F(WebRtcInternalsTest, SendUpdatePeerConnectionUpdate) { |
| 180 base::RunLoop loop; | 176 base::RunLoop loop; |
| 181 MockWebRtcInternalsProxy observer(&loop); | 177 MockWebRtcInternalsProxy observer(&loop); |
| 182 WebRTCInternalsForTest webrtc_internals; | 178 WebRTCInternalsForTest webrtc_internals; |
| 183 webrtc_internals.AddObserver(&observer); | 179 webrtc_internals.AddObserver(&observer); |
| 184 webrtc_internals.OnAddPeerConnection( | 180 webrtc_internals.OnAddPeerConnection(0, 1, 2, kUrl, kRtcConfiguration, |
| 185 0, 1, 2, kUrl, kRtcConfiguration, kContraints); | 181 kContraints); |
| 186 | 182 |
| 187 const std::string update_type = "fakeType"; | 183 const std::string update_type = "fakeType"; |
| 188 const std::string update_value = "fakeValue"; | 184 const std::string update_value = "fakeValue"; |
| 189 webrtc_internals.OnUpdatePeerConnection( | 185 webrtc_internals.OnUpdatePeerConnection(1, 2, update_type, update_value); |
| 190 1, 2, update_type, update_value); | |
| 191 | 186 |
| 192 loop.Run(); | 187 loop.Run(); |
| 193 | 188 |
| 194 ASSERT_EQ("updatePeerConnection", observer.command()); | 189 ASSERT_EQ("updatePeerConnection", observer.command()); |
| 195 | 190 |
| 196 base::DictionaryValue* dict = NULL; | 191 base::DictionaryValue* dict = NULL; |
| 197 EXPECT_TRUE(observer.value()->GetAsDictionary(&dict)); | 192 EXPECT_TRUE(observer.value()->GetAsDictionary(&dict)); |
| 198 | 193 |
| 199 VerifyInt(dict, "pid", 1); | 194 VerifyInt(dict, "pid", 1); |
| 200 VerifyInt(dict, "lid", 2); | 195 VerifyInt(dict, "lid", 2); |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 214 MockWebRtcInternalsProxy observer(&loop); | 209 MockWebRtcInternalsProxy observer(&loop); |
| 215 WebRTCInternalsForTest webrtc_internals; | 210 WebRTCInternalsForTest webrtc_internals; |
| 216 | 211 |
| 217 // Add one observer before "getUserMedia". | 212 // Add one observer before "getUserMedia". |
| 218 webrtc_internals.AddObserver(&observer); | 213 webrtc_internals.AddObserver(&observer); |
| 219 | 214 |
| 220 const int rid = 1; | 215 const int rid = 1; |
| 221 const int pid = 2; | 216 const int pid = 2; |
| 222 const std::string audio_constraint = "aaa"; | 217 const std::string audio_constraint = "aaa"; |
| 223 const std::string video_constraint = "vvv"; | 218 const std::string video_constraint = "vvv"; |
| 224 webrtc_internals.OnGetUserMedia( | 219 webrtc_internals.OnGetUserMedia(rid, pid, kUrl, true, true, audio_constraint, |
| 225 rid, pid, kUrl, true, true, audio_constraint, video_constraint); | 220 video_constraint); |
| 226 | 221 |
| 227 loop.Run(); | 222 loop.Run(); |
| 228 | 223 |
| 229 ASSERT_EQ("addGetUserMedia", observer.command()); | 224 ASSERT_EQ("addGetUserMedia", observer.command()); |
| 230 VerifyGetUserMediaData( | 225 VerifyGetUserMediaData(observer.value(), rid, pid, kUrl, audio_constraint, |
| 231 observer.value(), rid, pid, kUrl, audio_constraint, video_constraint); | 226 video_constraint); |
| 232 | 227 |
| 233 webrtc_internals.RemoveObserver(&observer); | 228 webrtc_internals.RemoveObserver(&observer); |
| 234 } | 229 } |
| 235 | 230 |
| 236 TEST_F(WebRtcInternalsTest, SendAllUpdateWithGetUserMedia) { | 231 TEST_F(WebRtcInternalsTest, SendAllUpdateWithGetUserMedia) { |
| 237 const int rid = 1; | 232 const int rid = 1; |
| 238 const int pid = 2; | 233 const int pid = 2; |
| 239 const std::string audio_constraint = "aaa"; | 234 const std::string audio_constraint = "aaa"; |
| 240 const std::string video_constraint = "vvv"; | 235 const std::string video_constraint = "vvv"; |
| 241 WebRTCInternalsForTest webrtc_internals; | 236 WebRTCInternalsForTest webrtc_internals; |
| 242 webrtc_internals.OnGetUserMedia( | 237 webrtc_internals.OnGetUserMedia(rid, pid, kUrl, true, true, audio_constraint, |
| 243 rid, pid, kUrl, true, true, audio_constraint, video_constraint); | 238 video_constraint); |
| 244 | 239 |
| 245 MockWebRtcInternalsProxy observer; | 240 MockWebRtcInternalsProxy observer; |
| 246 // Add one observer after "getUserMedia". | 241 // Add one observer after "getUserMedia". |
| 247 webrtc_internals.AddObserver(&observer); | 242 webrtc_internals.AddObserver(&observer); |
| 248 webrtc_internals.UpdateObserver(&observer); | 243 webrtc_internals.UpdateObserver(&observer); |
| 249 | 244 |
| 250 EXPECT_EQ("addGetUserMedia", observer.command()); | 245 EXPECT_EQ("addGetUserMedia", observer.command()); |
| 251 VerifyGetUserMediaData( | 246 VerifyGetUserMediaData(observer.value(), rid, pid, kUrl, audio_constraint, |
| 252 observer.value(), rid, pid, kUrl, audio_constraint, video_constraint); | 247 video_constraint); |
| 253 | 248 |
| 254 webrtc_internals.RemoveObserver(&observer); | 249 webrtc_internals.RemoveObserver(&observer); |
| 255 } | 250 } |
| 256 | 251 |
| 257 TEST_F(WebRtcInternalsTest, SendAllUpdatesWithPeerConnectionUpdate) { | 252 TEST_F(WebRtcInternalsTest, SendAllUpdatesWithPeerConnectionUpdate) { |
| 258 const int rid = 0, pid = 1, lid = 2; | 253 const int rid = 0, pid = 1, lid = 2; |
| 259 const std::string update_type = "fakeType"; | 254 const std::string update_type = "fakeType"; |
| 260 const std::string update_value = "fakeValue"; | 255 const std::string update_value = "fakeValue"; |
| 261 | 256 |
| 262 WebRTCInternalsForTest webrtc_internals; | 257 WebRTCInternalsForTest webrtc_internals; |
| 263 | 258 |
| 264 webrtc_internals.OnAddPeerConnection( | |
| 265 rid, pid, lid, kUrl, kRtcConfiguration, kContraints); | |
| 266 webrtc_internals.OnUpdatePeerConnection( | |
| 267 pid, lid, update_type, update_value); | |
| 268 | |
| 269 MockWebRtcInternalsProxy observer; | 259 MockWebRtcInternalsProxy observer; |
| 270 webrtc_internals.AddObserver(&observer); | 260 webrtc_internals.AddObserver(&observer); |
| 271 | 261 |
| 262 webrtc_internals.OnAddPeerConnection(rid, pid, lid, kUrl, kRtcConfiguration, | |
| 263 kContraints); | |
| 264 webrtc_internals.OnUpdatePeerConnection(pid, lid, update_type, update_value); | |
| 265 | |
| 272 webrtc_internals.UpdateObserver(&observer); | 266 webrtc_internals.UpdateObserver(&observer); |
| 273 | 267 |
| 274 EXPECT_EQ("updateAllPeerConnections", observer.command()); | 268 EXPECT_EQ("updateAllPeerConnections", observer.command()); |
| 275 ASSERT_TRUE(observer.value()); | 269 ASSERT_TRUE(observer.value()); |
| 276 | 270 |
| 277 base::ListValue* list = NULL; | 271 base::ListValue* list = NULL; |
| 278 EXPECT_TRUE(observer.value()->GetAsList(&list)); | 272 EXPECT_TRUE(observer.value()->GetAsList(&list)); |
| 279 EXPECT_EQ(1U, list->GetSize()); | 273 EXPECT_EQ(1U, list->GetSize()); |
| 280 | 274 |
| 281 base::DictionaryValue* dict = NULL; | 275 base::DictionaryValue* dict = NULL; |
| 282 EXPECT_TRUE((*list->begin())->GetAsDictionary(&dict)); | 276 EXPECT_TRUE((*list->begin())->GetAsDictionary(&dict)); |
| 283 | 277 |
| 284 VerifyInt(dict, "rid", rid); | 278 VerifyInt(dict, "rid", rid); |
| 285 VerifyInt(dict, "pid", pid); | 279 VerifyInt(dict, "pid", pid); |
| 286 VerifyInt(dict, "lid", lid); | 280 VerifyInt(dict, "lid", lid); |
| 287 VerifyString(dict, "url", kUrl); | 281 VerifyString(dict, "url", kUrl); |
| 288 VerifyString(dict, "rtcConfiguration", kRtcConfiguration); | 282 VerifyString(dict, "rtcConfiguration", kRtcConfiguration); |
| 289 VerifyString(dict, "constraints", kContraints); | 283 VerifyString(dict, "constraints", kContraints); |
| 290 | 284 |
| 291 base::ListValue* log = NULL; | 285 base::ListValue* log = NULL; |
| 292 EXPECT_TRUE(dict->GetList("log", &log)); | 286 ASSERT_TRUE(dict->GetList("log", &log)); |
| 293 EXPECT_EQ(1U, log->GetSize()); | 287 EXPECT_EQ(1U, log->GetSize()); |
| 294 | 288 |
| 295 EXPECT_TRUE((*log->begin())->GetAsDictionary(&dict)); | 289 EXPECT_TRUE((*log->begin())->GetAsDictionary(&dict)); |
| 296 VerifyString(dict, "type", update_type); | 290 VerifyString(dict, "type", update_type); |
| 297 VerifyString(dict, "value", update_value); | 291 VerifyString(dict, "value", update_value); |
| 298 std::string time; | 292 std::string time; |
| 299 EXPECT_TRUE(dict->GetString("time", &time)); | 293 EXPECT_TRUE(dict->GetString("time", &time)); |
| 300 EXPECT_FALSE(time.empty()); | 294 EXPECT_FALSE(time.empty()); |
| 301 } | 295 } |
| 302 | 296 |
| 303 TEST_F(WebRtcInternalsTest, OnAddStats) { | 297 TEST_F(WebRtcInternalsTest, OnAddStats) { |
| 304 const int rid = 0, pid = 1, lid = 2; | 298 const int rid = 0, pid = 1, lid = 2; |
| 305 base::RunLoop loop; | 299 base::RunLoop loop; |
| 306 MockWebRtcInternalsProxy observer(&loop); | 300 MockWebRtcInternalsProxy observer(&loop); |
| 307 WebRTCInternalsForTest webrtc_internals; | 301 WebRTCInternalsForTest webrtc_internals; |
| 308 webrtc_internals.AddObserver(&observer); | 302 webrtc_internals.AddObserver(&observer); |
| 309 webrtc_internals.OnAddPeerConnection( | 303 webrtc_internals.OnAddPeerConnection(rid, pid, lid, kUrl, kRtcConfiguration, |
| 310 rid, pid, lid, kUrl, kRtcConfiguration, kContraints); | 304 kContraints); |
| 311 | 305 |
| 312 base::ListValue list; | 306 base::ListValue list; |
| 313 list.AppendString("xxx"); | 307 list.AppendString("xxx"); |
| 314 list.AppendString("yyy"); | 308 list.AppendString("yyy"); |
| 315 webrtc_internals.OnAddStats(pid, lid, list); | 309 webrtc_internals.OnAddStats(pid, lid, list); |
| 316 | 310 |
| 317 loop.Run(); | 311 loop.Run(); |
| 318 | 312 |
| 319 EXPECT_EQ("addStats", observer.command()); | 313 EXPECT_EQ("addStats", observer.command()); |
| 320 ASSERT_TRUE(observer.value()); | 314 ASSERT_TRUE(observer.value()); |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 337 webrtc_internals.FileSelectionCanceled(nullptr); | 331 webrtc_internals.FileSelectionCanceled(nullptr); |
| 338 | 332 |
| 339 loop.Run(); | 333 loop.Run(); |
| 340 | 334 |
| 341 EXPECT_EQ("audioDebugRecordingsFileSelectionCancelled", observer.command()); | 335 EXPECT_EQ("audioDebugRecordingsFileSelectionCancelled", observer.command()); |
| 342 EXPECT_EQ(nullptr, observer.value()); | 336 EXPECT_EQ(nullptr, observer.value()); |
| 343 } | 337 } |
| 344 | 338 |
| 345 TEST_F(WebRtcInternalsTest, PowerSaveBlock) { | 339 TEST_F(WebRtcInternalsTest, PowerSaveBlock) { |
| 346 int kRenderProcessId = 1; | 340 int kRenderProcessId = 1; |
| 347 int pid = 1; | 341 const int pid = 1; |
| 348 int lid[] = {1, 2, 3}; | 342 const int lid[] = {1, 2, 3}; |
| 349 | 343 |
| 350 WebRTCInternalsForTest webrtc_internals; | 344 WebRTCInternalsForTest webrtc_internals; |
| 351 | 345 |
| 352 // Add a few peer connections. | 346 // Add a few peer connections. |
| 353 EXPECT_EQ(0, webrtc_internals.num_open_connections()); | 347 EXPECT_EQ(0, webrtc_internals.num_open_connections()); |
| 354 EXPECT_FALSE(webrtc_internals.IsPowerSavingBlocked()); | 348 EXPECT_FALSE(webrtc_internals.IsPowerSavingBlocked()); |
| 355 webrtc_internals.OnAddPeerConnection(kRenderProcessId, pid, lid[0], kUrl, | 349 webrtc_internals.OnAddPeerConnection(kRenderProcessId, pid, lid[0], kUrl, |
| 356 kRtcConfiguration, kContraints); | 350 kRtcConfiguration, kContraints); |
| 357 EXPECT_EQ(1, webrtc_internals.num_open_connections()); | 351 EXPECT_EQ(1, webrtc_internals.num_open_connections()); |
| 358 EXPECT_TRUE(webrtc_internals.IsPowerSavingBlocked()); | 352 EXPECT_TRUE(webrtc_internals.IsPowerSavingBlocked()); |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 384 // Remove the remaining peer connections. | 378 // Remove the remaining peer connections. |
| 385 webrtc_internals.OnRemovePeerConnection(pid, lid[1]); | 379 webrtc_internals.OnRemovePeerConnection(pid, lid[1]); |
| 386 EXPECT_EQ(0, webrtc_internals.num_open_connections()); | 380 EXPECT_EQ(0, webrtc_internals.num_open_connections()); |
| 387 EXPECT_FALSE(webrtc_internals.IsPowerSavingBlocked()); | 381 EXPECT_FALSE(webrtc_internals.IsPowerSavingBlocked()); |
| 388 | 382 |
| 389 webrtc_internals.OnRemovePeerConnection(pid, lid[0]); | 383 webrtc_internals.OnRemovePeerConnection(pid, lid[0]); |
| 390 EXPECT_EQ(0, webrtc_internals.num_open_connections()); | 384 EXPECT_EQ(0, webrtc_internals.num_open_connections()); |
| 391 EXPECT_FALSE(webrtc_internals.IsPowerSavingBlocked()); | 385 EXPECT_FALSE(webrtc_internals.IsPowerSavingBlocked()); |
| 392 } | 386 } |
| 393 | 387 |
| 394 } // namespace content | 388 } // namespace content |
|
Henrik Grunell
2017/03/03 12:40:09
Would it make sense to add a test case for when th
tommi (sloooow) - chröme
2017/03/03 14:15:14
Good idea, done.
Henrik Grunell
2017/03/06 11:49:24
Great!
| |
| OLD | NEW |