Reland "Reland "Remove our stream << overloads from non-test build targets.""

This is a reland of d7ee72041f882c023c73e27a7436c626c4e43604

Original change's description:
> Reland "Remove our stream << overloads from non-test build targets."
>
> This is a reland of c841d18d257ba8e4ed7d77d105e3c46006bb1e7e
>
> Original change's description:
> > Remove our stream << overloads from non-test build targets.
> >
> > Most are removed entirely, but RtcErrorType, RtpTransceiverDirection, IPAddress and
> > SocketAddress are kept behind gtest's #ifdef UNIT_TEST.
> >
> > Bug: webrtc:8982
> > Change-Id: I36db19891e7d25aeacb08b9a08aa2b4004765e70
> > Reviewed-on: https://webrtc-review.googlesource.com/64143
> > Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
> > Reviewed-by: Benjamin Wright <benwright@webrtc.org>
> > Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Reviewed-by: Åsa Persson <asapersson@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#22916}
>
>
> Bug: webrtc:8982
> Change-Id: Ibe08c6270e5e693eb661a6ce9e8f074b34ef8123
> Reviewed-on: https://webrtc-review.googlesource.com/71161
> Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
> Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#22949}

TBR=deadbeef@webrtc.org,kwiberg@webrtc.org,asapersson@webrtc.org,jonasolsson@webrtc.org,benwright@webrtc.org

Bug: webrtc:8982
Change-Id: I29247d1c28e99af36ef228d8c75b4adecbd7b199
Reviewed-on: https://webrtc-review.googlesource.com/72681
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23092}
diff --git a/rtc_base/socketaddress.h b/rtc_base/socketaddress.h
index d58eed8..90919c2 100644
--- a/rtc_base/socketaddress.h
+++ b/rtc_base/socketaddress.h
@@ -13,6 +13,9 @@
 
 #include <iosfwd>
 #include <string>
+#ifdef UNIT_TEST
+#include <ostream>  // no-presubmit-check TODO(webrtc:8982)
+#endif              // UNIT_TEST
 #include <vector>
 #include "rtc_base/basictypes.h"
 #include "rtc_base/ipaddress.h"
@@ -126,7 +129,12 @@
   // Parses hostname:port and [hostname]:port.
   bool FromString(const std::string& str);
 
-  friend std::ostream& operator<<(std::ostream& os, const SocketAddress& addr);
+#ifdef UNIT_TEST
+  inline std::ostream& operator<<(  // no-presubmit-check TODO(webrtc:8982)
+      std::ostream& os) {           // no-presubmit-check TODO(webrtc:8982)
+    return os << HostAsURIString() << ":" << port();
+  }
+#endif  // UNIT_TEST
 
   // Determines whether this represents a missing / any IP address.
   // That is, 0.0.0.0 or ::.