Reenabled the RtcEventLog unittests

For some reason the RtcEventLog unit tests were not building and
running. This CL adds these tests to the rtc_unittests target.
They are only built if protobuf support is enabled.

BUG=webrtc:6379
R=stefan@webrtc.org, terelius@webrtc.org

Review URL: https://codereview.webrtc.org/2344383002 .

Cr-Original-Commit-Position: refs/heads/master@{#14295}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: e9cac751396d140e968192e763f540bd917cb551
diff --git a/BUILD.gn b/BUILD.gn
index b28bef8..47b757a 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -551,6 +551,10 @@
       "//testing/gtest",
     ]
 
+    if (rtc_enable_protobuf) {
+      deps += [ "call:rtc_event_log_tests" ]
+    }
+
     if (is_android) {
       deps += [ "//testing/android/native_test:native_test_support" ]
       shard_timeout = 900
diff --git a/call/BUILD.gn b/call/BUILD.gn
index 9b2fe9e..05a3192 100644
--- a/call/BUILD.gn
+++ b/call/BUILD.gn
@@ -56,4 +56,24 @@
       suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
   }
+  rtc_source_set("rtc_event_log_tests") {
+    testonly = true
+    sources = [
+      "rtc_event_log_unittest.cc",
+      "rtc_event_log_unittest_helper.cc",
+    ]
+    deps = [
+      "..:rtc_event_log",
+      "..:rtc_event_log_parser",
+      "../modules/rtp_rtcp",
+      "../system_wrappers:metrics_default",
+      "//testing/gmock",
+      "//testing/gtest",
+    ]
+    if (is_clang) {
+      # Suppress warnings from the Chromium Clang plugin.
+      # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
+    }
+  }
 }
diff --git a/call/rtc_event_log_unittest.cc b/call/rtc_event_log_unittest.cc
index e8f0ccf..34e993c 100644
--- a/call/rtc_event_log_unittest.cc
+++ b/call/rtc_event_log_unittest.cc
@@ -8,8 +8,6 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#ifdef ENABLE_RTC_EVENT_LOG
-
 #include <map>
 #include <memory>
 #include <string>
@@ -459,6 +457,5 @@
   // Clean up temporary file - can be pretty slow.
   remove(temp_filename.c_str());
 }
-}  // namespace webrtc
 
-#endif  // ENABLE_RTC_EVENT_LOG
+}  // namespace webrtc
diff --git a/call/rtc_event_log_unittest_helper.cc b/call/rtc_event_log_unittest_helper.cc
index 194414f..d7092b8 100644
--- a/call/rtc_event_log_unittest_helper.cc
+++ b/call/rtc_event_log_unittest_helper.cc
@@ -8,8 +8,6 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
-#ifdef ENABLE_RTC_EVENT_LOG
-
 #include "webrtc/call/rtc_event_log_unittest_helper.h"
 
 #include <string.h>
@@ -405,5 +403,3 @@
 }
 
 }  // namespace webrtc
-
-#endif  // ENABLE_RTC_EVENT_LOG