| Index: content/browser/webrtc/webrtc_internals_unittest.cc
|
| diff --git a/content/browser/webrtc/webrtc_internals_unittest.cc b/content/browser/webrtc/webrtc_internals_unittest.cc
|
| index cfea70f19a68475a8613b5fef87dd42224424cb2..5e9c52eb4884e15b9ded7b52d7e468faa10c1740 100644
|
| --- a/content/browser/webrtc/webrtc_internals_unittest.cc
|
| +++ b/content/browser/webrtc/webrtc_internals_unittest.cc
|
| @@ -27,13 +27,9 @@ class MockWebRtcInternalsProxy : public WebRTCInternalsUIObserver {
|
| MockWebRtcInternalsProxy() : loop_(nullptr) {}
|
| explicit MockWebRtcInternalsProxy(base::RunLoop* loop) : loop_(loop) {}
|
|
|
| - const std::string& command() const {
|
| - return command_;
|
| - }
|
| + const std::string& command() const { return command_; }
|
|
|
| - base::Value* value() {
|
| - return value_.get();
|
| - }
|
| + base::Value* value() { return value_.get(); }
|
|
|
| private:
|
| void OnUpdate(const char* command, const base::Value* value) override {
|
| @@ -116,12 +112,12 @@ TEST_F(WebRtcInternalsTest, AddRemoveObserver) {
|
|
|
| webrtc_internals.RemoveObserver(&observer);
|
| // The observer should not get notified of this activity.
|
| - webrtc_internals.OnAddPeerConnection(
|
| - 0, 3, 4, kUrl, kRtcConfiguration, kContraints);
|
| + webrtc_internals.OnAddPeerConnection(0, 3, 4, kUrl, kRtcConfiguration,
|
| + kContraints);
|
|
|
| BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE,
|
| - loop.QuitClosure(),
|
| - base::TimeDelta::FromMilliseconds(5));
|
| + loop.QuitClosure(),
|
| + base::TimeDelta::FromMilliseconds(5));
|
| loop.Run();
|
|
|
| EXPECT_EQ("", observer.command());
|
| @@ -134,8 +130,8 @@ TEST_F(WebRtcInternalsTest, SendAddPeerConnectionUpdate) {
|
| MockWebRtcInternalsProxy observer(&loop);
|
| WebRTCInternalsForTest webrtc_internals;
|
| webrtc_internals.AddObserver(&observer);
|
| - webrtc_internals.OnAddPeerConnection(
|
| - 0, 1, 2, kUrl, kRtcConfiguration, kContraints);
|
| + webrtc_internals.OnAddPeerConnection(0, 1, 2, kUrl, kRtcConfiguration,
|
| + kContraints);
|
|
|
| loop.Run();
|
|
|
| @@ -159,8 +155,8 @@ TEST_F(WebRtcInternalsTest, SendRemovePeerConnectionUpdate) {
|
| MockWebRtcInternalsProxy observer(&loop);
|
| WebRTCInternalsForTest webrtc_internals;
|
| webrtc_internals.AddObserver(&observer);
|
| - webrtc_internals.OnAddPeerConnection(
|
| - 0, 1, 2, kUrl, kRtcConfiguration, kContraints);
|
| + webrtc_internals.OnAddPeerConnection(0, 1, 2, kUrl, kRtcConfiguration,
|
| + kContraints);
|
| webrtc_internals.OnRemovePeerConnection(1, 2);
|
|
|
| loop.Run();
|
| @@ -181,13 +177,12 @@ TEST_F(WebRtcInternalsTest, SendUpdatePeerConnectionUpdate) {
|
| MockWebRtcInternalsProxy observer(&loop);
|
| WebRTCInternalsForTest webrtc_internals;
|
| webrtc_internals.AddObserver(&observer);
|
| - webrtc_internals.OnAddPeerConnection(
|
| - 0, 1, 2, kUrl, kRtcConfiguration, kContraints);
|
| + webrtc_internals.OnAddPeerConnection(0, 1, 2, kUrl, kRtcConfiguration,
|
| + kContraints);
|
|
|
| const std::string update_type = "fakeType";
|
| const std::string update_value = "fakeValue";
|
| - webrtc_internals.OnUpdatePeerConnection(
|
| - 1, 2, update_type, update_value);
|
| + webrtc_internals.OnUpdatePeerConnection(1, 2, update_type, update_value);
|
|
|
| loop.Run();
|
|
|
| @@ -221,14 +216,14 @@ TEST_F(WebRtcInternalsTest, AddGetUserMedia) {
|
| const int pid = 2;
|
| const std::string audio_constraint = "aaa";
|
| const std::string video_constraint = "vvv";
|
| - webrtc_internals.OnGetUserMedia(
|
| - rid, pid, kUrl, true, true, audio_constraint, video_constraint);
|
| + webrtc_internals.OnGetUserMedia(rid, pid, kUrl, true, true, audio_constraint,
|
| + video_constraint);
|
|
|
| loop.Run();
|
|
|
| ASSERT_EQ("addGetUserMedia", observer.command());
|
| - VerifyGetUserMediaData(
|
| - observer.value(), rid, pid, kUrl, audio_constraint, video_constraint);
|
| + VerifyGetUserMediaData(observer.value(), rid, pid, kUrl, audio_constraint,
|
| + video_constraint);
|
|
|
| webrtc_internals.RemoveObserver(&observer);
|
| }
|
| @@ -239,8 +234,8 @@ TEST_F(WebRtcInternalsTest, SendAllUpdateWithGetUserMedia) {
|
| const std::string audio_constraint = "aaa";
|
| const std::string video_constraint = "vvv";
|
| WebRTCInternalsForTest webrtc_internals;
|
| - webrtc_internals.OnGetUserMedia(
|
| - rid, pid, kUrl, true, true, audio_constraint, video_constraint);
|
| + webrtc_internals.OnGetUserMedia(rid, pid, kUrl, true, true, audio_constraint,
|
| + video_constraint);
|
|
|
| MockWebRtcInternalsProxy observer;
|
| // Add one observer after "getUserMedia".
|
| @@ -248,8 +243,8 @@ TEST_F(WebRtcInternalsTest, SendAllUpdateWithGetUserMedia) {
|
| webrtc_internals.UpdateObserver(&observer);
|
|
|
| EXPECT_EQ("addGetUserMedia", observer.command());
|
| - VerifyGetUserMediaData(
|
| - observer.value(), rid, pid, kUrl, audio_constraint, video_constraint);
|
| + VerifyGetUserMediaData(observer.value(), rid, pid, kUrl, audio_constraint,
|
| + video_constraint);
|
|
|
| webrtc_internals.RemoveObserver(&observer);
|
| }
|
| @@ -261,14 +256,13 @@ TEST_F(WebRtcInternalsTest, SendAllUpdatesWithPeerConnectionUpdate) {
|
|
|
| WebRTCInternalsForTest webrtc_internals;
|
|
|
| - webrtc_internals.OnAddPeerConnection(
|
| - rid, pid, lid, kUrl, kRtcConfiguration, kContraints);
|
| - webrtc_internals.OnUpdatePeerConnection(
|
| - pid, lid, update_type, update_value);
|
| -
|
| MockWebRtcInternalsProxy observer;
|
| webrtc_internals.AddObserver(&observer);
|
|
|
| + webrtc_internals.OnAddPeerConnection(rid, pid, lid, kUrl, kRtcConfiguration,
|
| + kContraints);
|
| + webrtc_internals.OnUpdatePeerConnection(pid, lid, update_type, update_value);
|
| +
|
| webrtc_internals.UpdateObserver(&observer);
|
|
|
| EXPECT_EQ("updateAllPeerConnections", observer.command());
|
| @@ -289,7 +283,7 @@ TEST_F(WebRtcInternalsTest, SendAllUpdatesWithPeerConnectionUpdate) {
|
| VerifyString(dict, "constraints", kContraints);
|
|
|
| base::ListValue* log = NULL;
|
| - EXPECT_TRUE(dict->GetList("log", &log));
|
| + ASSERT_TRUE(dict->GetList("log", &log));
|
| EXPECT_EQ(1U, log->GetSize());
|
|
|
| EXPECT_TRUE((*log->begin())->GetAsDictionary(&dict));
|
| @@ -306,8 +300,8 @@ TEST_F(WebRtcInternalsTest, OnAddStats) {
|
| MockWebRtcInternalsProxy observer(&loop);
|
| WebRTCInternalsForTest webrtc_internals;
|
| webrtc_internals.AddObserver(&observer);
|
| - webrtc_internals.OnAddPeerConnection(
|
| - rid, pid, lid, kUrl, kRtcConfiguration, kContraints);
|
| + webrtc_internals.OnAddPeerConnection(rid, pid, lid, kUrl, kRtcConfiguration,
|
| + kContraints);
|
|
|
| base::ListValue list;
|
| list.AppendString("xxx");
|
| @@ -344,8 +338,8 @@ TEST_F(WebRtcInternalsTest, AudioDebugRecordingsFileSelectionCanceled) {
|
|
|
| TEST_F(WebRtcInternalsTest, PowerSaveBlock) {
|
| int kRenderProcessId = 1;
|
| - int pid = 1;
|
| - int lid[] = {1, 2, 3};
|
| + const int pid = 1;
|
| + const int lid[] = {1, 2, 3};
|
|
|
| WebRTCInternalsForTest webrtc_internals;
|
|
|
|
|