Bug 1545226 - Enable gtests r=valentin
authorKershaw Chang <kershaw@mozilla.com>
Wed, 08 May 2019 20:56:51 +0000
changeset 532002 fda5c9d5c01ed7e5d52a55a66607fc238518c66a
parent 532001 8e2e62921fad44be81b7026d0ca7f76bbca423db
child 532003 9ba1d1d1f4442047a0cc53cc8e006c0bc2c2d7f7
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin
bugs1545226
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1545226 - Enable gtests r=valentin This patch fixes some build issues on Android and also enables some gtests. Differential Revision: https://phabricator.services.mozilla.com/D30386
netwerk/test/gtest/TestMozURL.cpp
netwerk/test/gtest/TestServerTimingHeader.cpp
netwerk/test/gtest/moz.build
--- a/netwerk/test/gtest/TestMozURL.cpp
+++ b/netwerk/test/gtest/TestMozURL.cpp
@@ -1,17 +1,21 @@
 #include "gtest/gtest.h"
 #include "gtest/MozGTestBench.h"  // For MOZ_GTEST_BENCH
 
 #include <regex>
 #include "json/json.h"
+#include "json/reader.h"
 #include "mozilla/net/MozURL.h"
 #include "nsCOMPtr.h"
 #include "nsDirectoryServiceDefs.h"
+#include "nsNetUtil.h"
 #include "nsIFile.h"
+#include "nsIURI.h"
+#include "nsStreamUtils.h"
 
 using namespace mozilla;
 using namespace mozilla::net;
 
 TEST(TestMozURL, Getters)
 {
   nsAutoCString href("http://user:pass@example.com/path?query#ref");
   RefPtr<MozURL> url;
--- a/netwerk/test/gtest/TestServerTimingHeader.cpp
+++ b/netwerk/test/gtest/TestServerTimingHeader.cpp
@@ -1,15 +1,18 @@
 #include "gtest/gtest.h"
 
 #include "mozilla/Unused.h"
 #include "mozilla/net/nsServerTiming.h"
 #include <string>
 #include <vector>
 
+using namespace mozilla;
+using namespace mozilla::net;
+
 void testServerTimingHeader(
     const char* headerValue,
     std::vector<std::vector<std::string>> expectedResults) {
   nsAutoCString header(headerValue);
   ServerTimingParser parser(header);
   parser.Parse();
 
   nsTArray<nsCOMPtr<nsIServerTiming>> results =
--- a/netwerk/test/gtest/moz.build
+++ b/netwerk/test/gtest/moz.build
@@ -5,39 +5,39 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 UNIFIED_SOURCES += [
     'TestBufferedInputStream.cpp',
     'TestHeaders.cpp',
     'TestHttpAuthUtils.cpp',
     'TestIsValidIp.cpp',
     'TestMIMEInputStream.cpp',
+    'TestMozURL.cpp',
     'TestProtocolProxyService.cpp',
     'TestReadStreamToString.cpp',
+    'TestServerTimingHeader.cpp',
     'TestStandardURL.cpp',
 ]
 
 # skip the test on windows10-aarch64
 if not(CONFIG['OS_TARGET'] == 'WINNT' and CONFIG['CPU_ARCH'] == 'aarch64'):
     UNIFIED_SOURCES += [
         'TestPACMan.cpp',
         'TestPartiallySeekableInputStream.cpp',
         'TestURIMutator.cpp',
     ]
 
-if CONFIG['OS_TARGET'] != 'Android':
-    UNIFIED_SOURCES += [
-        'TestMozURL.cpp',
-        'TestServerTimingHeader.cpp',
-    ]
-
 TEST_HARNESS_FILES.gtest += [
     'urltestdata.json',
 ]
 
+USE_LIBS += [
+    'jsoncpp',
+]
+
 TEST_DIRS += [
     'parse-ftp',
 ]
 
 LOCAL_INCLUDES += [
     '/netwerk/base',
     '/toolkit/components/jsoncpp/include',
     '/xpcom/tests/gtest',