Bug 1314827 - gtestify dom/base/test/*.cpp. r=baku.
☠☠ backed out by c9308740eeb7 ☠ ☠
authorNicholas Nethercote <nnethercote@mozilla.com>
Fri, 04 Nov 2016 14:36:23 +1100
changeset 366108 14d7b6dbe0fb90073b24c2a21bb7180913714225
parent 366107 2cc5970a749cf0ff1b6e9bfeef02559632cecd41
child 366109 fa1f25d45d8e3f6b15e2d8ea8ef98ee9b339f2c0
push id1369
push userjlorenzo@mozilla.com
push dateMon, 27 Feb 2017 14:59:41 +0000
treeherdermozilla-release@d75a1dba431f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1314827
milestone52.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 1314827 - gtestify dom/base/test/*.cpp. r=baku. The commit removes TestGetURL.cpp which wasn't doing anything useful anyway because it required an argument but wasn't being passed one, and so it was just aborting immediately with a usage message.
dom/base/test/TestGetURL.cpp
dom/base/test/TestNativeXMLHttpRequest.cpp
dom/base/test/TestPlainTextSerializer.cpp
dom/base/test/gtest/TestNativeXMLHttpRequest.cpp
dom/base/test/gtest/TestPlainTextSerializer.cpp
dom/base/test/gtest/moz.build
dom/base/test/moz.build
testing/cppunittest.ini
deleted file mode 100644
--- a/dom/base/test/TestGetURL.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "TestHarness.h"
-
-#include "nsIPrincipal.h"
-#include "nsIScriptSecurityManager.h"
-#include "nsIXMLHttpRequest.h"
-
-
-#define TEST_ENSURE_BASE(_test, _msg)       \
-  PR_BEGIN_MACRO                            \
-    if (_test) {                            \
-      fail(_msg);                           \
-      return NS_ERROR_FAILURE;              \
-    }                                       \
-  PR_END_MACRO
-
-#define TEST_ENSURE_SUCCESS(_rv, _msg)      \
-  TEST_ENSURE_BASE(NS_FAILED(_rv), _msg)
-
-#define TEST_ENSURE_FAILED(_rv, _msg)       \
-  TEST_ENSURE_BASE(NS_SUCCEEDED(_rv), _msg)
-
-nsresult TestGetURL(const nsCString& aURL)
-{
-  nsresult rv;
-
-  nsCOMPtr<nsIXMLHttpRequest> xhr =
-    do_CreateInstance(NS_XMLHTTPREQUEST_CONTRACTID, &rv);
-  TEST_ENSURE_SUCCESS(rv, "Couldn't create nsIXMLHttpRequest instance!");
-
-  NS_NAMED_LITERAL_CSTRING(getString, "GET");
-  const nsAString& empty = EmptyString();
-  
-  nsCOMPtr<nsIScriptSecurityManager> secman =
-    do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv);
-  TEST_ENSURE_SUCCESS(rv, "Couldn't get script security manager!");
-
-  nsCOMPtr<nsIPrincipal> systemPrincipal;
-  rv = secman->GetSystemPrincipal(getter_AddRefs(systemPrincipal));
-  TEST_ENSURE_SUCCESS(rv, "Couldn't get system principal!");
-
-  rv = xhr->Init(systemPrincipal, nullptr, nullptr, nullptr);
-  TEST_ENSURE_SUCCESS(rv, "Couldn't initialize the XHR!");
-
-  rv = xhr->Open(getString, aURL, false, empty, empty);
-  TEST_ENSURE_SUCCESS(rv, "OpenRequest failed!");
-
-  rv = xhr->Send(nullptr);
-  TEST_ENSURE_SUCCESS(rv, "Send failed!");
-
-  nsAutoString response;
-  rv = xhr->GetResponseText(response);
-  TEST_ENSURE_SUCCESS(rv, "GetResponse failed!");
-
-  nsAutoCString responseUTF8 = NS_ConvertUTF16toUTF8(response);
-  printf("#BEGIN\n");
-  printf("%s", responseUTF8.get());
-  printf("\n#EOF\n");
-
-  return NS_OK;
-}
-
-int main(int argc, char** argv)
-{
-  if (argc <  2) {
-    printf("Usage: TestGetURL <url>\n");
-    exit(0);
-  }
-
-  ScopedXPCOM xpcom("XMLHttpRequest");
-  if (xpcom.failed())
-    return 1;
-
-  nsAutoCString targetURL(argv[1]);
-
-  int retval = 0;
-  if (NS_FAILED(TestGetURL(targetURL))) {
-    retval = 1;
-  }
-
-  return retval;
-}
rename from dom/base/test/TestNativeXMLHttpRequest.cpp
rename to dom/base/test/gtest/TestNativeXMLHttpRequest.cpp
--- a/dom/base/test/TestNativeXMLHttpRequest.cpp
+++ b/dom/base/test/gtest/TestNativeXMLHttpRequest.cpp
@@ -1,100 +1,58 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "TestHarness.h"
+#include "gtest/gtest.h"
 
+#include "nsContentUtils.h"
 #include "nsIDOMDocument.h"
 #include "nsIPrincipal.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIXMLHttpRequest.h"
 
-
-#define TEST_ENSURE_BASE(_test, _msg)       \
-  PR_BEGIN_MACRO                            \
-    if (_test) {                            \
-      fail(_msg);                           \
-      return NS_ERROR_FAILURE;              \
-    }                                       \
-  PR_END_MACRO
-
-#define TEST_ENSURE_SUCCESS(_rv, _msg)      \
-  TEST_ENSURE_BASE(NS_FAILED(_rv), _msg)
+#define TEST_URL_PREFIX  "data:text/xml,"
+#define TEST_URL_CONTENT "<foo><bar></bar></foo>"
+#define TEST_URL         TEST_URL_PREFIX TEST_URL_CONTENT
 
-#define TEST_ENSURE_FAILED(_rv, _msg)       \
-  TEST_ENSURE_BASE(NS_SUCCEEDED(_rv), _msg)
-
-#define TEST_URL_PREFIX                     \
-  "data:text/xml,"
-#define TEST_URL_CONTENT                    \
-  "<foo><bar></bar></foo>"
-
-#define TEST_URL                            \
-  TEST_URL_PREFIX TEST_URL_CONTENT
-
-nsresult TestNativeXMLHttpRequest()
+TEST(NativeXMLHttpRequest, Test)
 {
   nsresult rv;
 
   nsCOMPtr<nsIXMLHttpRequest> xhr =
     do_CreateInstance(NS_XMLHTTPREQUEST_CONTRACTID, &rv);
-  TEST_ENSURE_SUCCESS(rv, "Couldn't create nsIXMLHttpRequest instance!");
+  ASSERT_TRUE(NS_SUCCEEDED(rv)) << "Couldn't create nsIXMLHttpRequest instance";
 
   NS_NAMED_LITERAL_CSTRING(getString, "GET");
   NS_NAMED_LITERAL_CSTRING(testURL, TEST_URL);
   const nsAString& empty = EmptyString();
 
   nsCOMPtr<nsIScriptSecurityManager> secman =
     do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv);
-  TEST_ENSURE_SUCCESS(rv, "Couldn't get script security manager!");
+  ASSERT_TRUE(NS_SUCCEEDED(rv)) << "Couldn't get script security manager";
 
   nsCOMPtr<nsIPrincipal> systemPrincipal;
   rv = secman->GetSystemPrincipal(getter_AddRefs(systemPrincipal));
-  TEST_ENSURE_SUCCESS(rv, "Couldn't get system principal!");
+  ASSERT_TRUE(NS_SUCCEEDED(rv)) << "Couldn't get system principal";
 
   rv = xhr->Init(systemPrincipal, nullptr, nullptr, nullptr);
-  TEST_ENSURE_SUCCESS(rv, "Couldn't initialize the XHR!");
+  ASSERT_TRUE(NS_SUCCEEDED(rv)) << "Couldn't initialize the XHR";
 
   rv = xhr->Open(getString, testURL, false, empty, empty);
-  TEST_ENSURE_SUCCESS(rv, "Open failed!");
+  ASSERT_TRUE(NS_SUCCEEDED(rv)) << "Open failed";
 
   rv = xhr->Send(nullptr);
-  TEST_ENSURE_SUCCESS(rv, "Send failed!");
+  ASSERT_TRUE(NS_SUCCEEDED(rv)) << "Send failed";
 
   nsAutoString response;
   rv = xhr->GetResponseText(response);
-  TEST_ENSURE_SUCCESS(rv, "GetResponse failed!");
-
-  if (!response.EqualsLiteral(TEST_URL_CONTENT)) {
-    fail("Response text does not match!");
-    return NS_ERROR_FAILURE;
-  }
+  ASSERT_TRUE(NS_SUCCEEDED(rv)) << "GetResponse failed";
+  ASSERT_TRUE(response.EqualsLiteral(TEST_URL_CONTENT)) <<
+    "Response text does not match";
 
   nsCOMPtr<nsIDOMDocument> dom;
   rv = xhr->GetResponseXML(getter_AddRefs(dom));
-  TEST_ENSURE_SUCCESS(rv, "GetResponseXML failed!");
-
-  if (!dom) {
-    fail("No DOM document constructed!");
-    return NS_ERROR_FAILURE;
-  }
-
-  passed("Native XMLHttpRequest");
-  return NS_OK;
+  ASSERT_TRUE(NS_SUCCEEDED(rv)) << "GetResponseXML failed";
+  ASSERT_TRUE(dom) << "No DOM document constructed";
 }
-
-int main(int argc, char** argv)
-{
-  ScopedXPCOM xpcom("XMLHttpRequest");
-  if (xpcom.failed())
-    return 1;
-
-  int retval = 0;
-  if (NS_FAILED(TestNativeXMLHttpRequest())) {
-    retval = 1;
-  }
-
-  return retval;
-}
rename from dom/base/test/TestPlainTextSerializer.cpp
rename to dom/base/test/gtest/TestPlainTextSerializer.cpp
--- a/dom/base/test/TestPlainTextSerializer.cpp
+++ b/dom/base/test/gtest/TestPlainTextSerializer.cpp
@@ -1,33 +1,31 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "TestHarness.h"
+#include "gtest/gtest.h"
 
 #include "nsServiceManagerUtils.h"
 #include "nsStringGlue.h"
 #include "nsIDocumentEncoder.h"
 #include "nsCRT.h"
 #include "nsIParserUtils.h"
 
 void
 ConvertBufToPlainText(nsString &aConBuf, int aFlag)
 {
-  nsCOMPtr<nsIParserUtils> utils =
-    do_GetService(NS_PARSERUTILS_CONTRACTID);
+  nsCOMPtr<nsIParserUtils> utils = do_GetService(NS_PARSERUTILS_CONTRACTID);
   utils->ConvertToPlainText(aConBuf, aFlag, 72, aConBuf);
 }
 
 // Test for ASCII with format=flowed; delsp=yes
-nsresult
-TestASCIIWithFlowedDelSp()
+TEST(PlainTextSerializer, ASCIIWithFlowedDelSp)
 {
   nsString test;
   nsString result;
 
   test.AssignLiteral("<html><body>"
                      "Firefox Firefox Firefox Firefox "
                      "Firefox Firefox Firefox Firefox "
                      "Firefox Firefox Firefox Firefox"
@@ -39,29 +37,22 @@ TestASCIIWithFlowedDelSp()
                               nsIDocumentEncoder::OutputFormatFlowed |
                               nsIDocumentEncoder::OutputFormatDelSp);
 
   // create result case
   result.AssignLiteral("Firefox Firefox Firefox Firefox "
                        "Firefox Firefox Firefox Firefox "
                        "Firefox  \r\nFirefox Firefox Firefox\r\n");
 
-  if (!test.Equals(result)) {
-    fail("Wrong HTML to ASCII text serialization with format=flowed; delsp=yes");
-    return NS_ERROR_FAILURE;
-  }
-
-  passed("HTML to ASCII text serialization with format=flowed; delsp=yes");
-
-  return NS_OK;
+  ASSERT_TRUE(test.Equals(result)) <<
+    "Wrong HTML to ASCII text serialization with format=flowed; delsp=yes";
 }
 
 // Test for CJK with format=flowed; delsp=yes
-nsresult
-TestCJKWithFlowedDelSp()
+TEST(PlainTextSerializer, CJKWithFlowedDelSp)
 {
   nsString test;
   nsString result;
 
   test.AssignLiteral("<html><body>");
   for (uint32_t i = 0; i < 40; i++) {
     // Insert Kanji (U+5341)
     test.Append(0x5341);
@@ -79,29 +70,22 @@ TestCJKWithFlowedDelSp()
     result.Append(0x5341);
   }
   result.AppendLiteral(" \r\n");
   for (uint32_t i = 0; i < 4; i++) {
     result.Append(0x5341);
   }
   result.AppendLiteral("\r\n");
 
-  if (!test.Equals(result)) {
-    fail("Wrong HTML to CJK text serialization with format=flowed; delsp=yes");
-    return NS_ERROR_FAILURE;
-  }
-
-  passed("HTML to CJK text serialization with format=flowed; delsp=yes");
-
-  return NS_OK;
+  ASSERT_TRUE(test.Equals(result)) <<
+    "Wrong HTML to CJK text serialization with format=flowed; delsp=yes";
 }
 
 // Test for CJK with DisallowLineBreaking
-nsresult
-TestCJKWithDisallowLineBreaking()
+TEST(PlainTextSerializer, CJKWithDisallowLineBreaking)
 {
   nsString test;
   nsString result;
 
   test.AssignLiteral("<html><body>");
   for (uint32_t i = 0; i < 400; i++) {
     // Insert Kanji (U+5341)
     test.Append(0x5341);
@@ -115,29 +99,22 @@ TestCJKWithDisallowLineBreaking()
                               nsIDocumentEncoder::OutputDisallowLineBreaking);
 
   // create result case
   for (uint32_t i = 0; i < 400; i++) {
     result.Append(0x5341);
   }
   result.AppendLiteral("\r\n");
 
-  if (!test.Equals(result)) {
-    fail("Wrong HTML to CJK text serialization with OutputDisallowLineBreaking");
-    return NS_ERROR_FAILURE;
-  }
-
-  passed("HTML to CJK text serialization with OutputDisallowLineBreaking");
-
-  return NS_OK;
+  ASSERT_TRUE(test.Equals(result)) <<
+    "Wrong HTML to CJK text serialization with OutputDisallowLineBreaking";
 }
 
 // Test for ASCII with format=flowed; and quoted lines in preformatted span.
-nsresult
-TestPreformatFlowedQuotes()
+TEST(PlainTextSerializer, PreformatFlowedQuotes)
 {
   nsString test;
   nsString result;
 
   test.AssignLiteral("<html><body>"
                      "<span style=\"white-space: pre-wrap;\">"
                      "&gt; Firefox Firefox Firefox Firefox <br>"
                      "&gt; Firefox Firefox Firefox Firefox<br>"
@@ -152,175 +129,103 @@ TestPreformatFlowedQuotes()
                               nsIDocumentEncoder::OutputFormatFlowed);
 
   // create result case
   result.AssignLiteral("> Firefox Firefox Firefox Firefox \r\n"
                        "> Firefox Firefox Firefox Firefox\r\n"
                        ">\r\n"
                        ">> Firefox Firefox Firefox Firefox \r\n"
                        ">> Firefox Firefox Firefox Firefox\r\n");
-  if (!test.Equals(result)) {
-    fail("Wrong HTML to ASCII text serialization with format=flowed; and quoted lines");
-    return NS_ERROR_FAILURE;
-  }
 
-  passed("HTML to ASCII text serialization with format=flowed; and quoted lines");
-
-  return NS_OK;
+  ASSERT_TRUE(test.Equals(result)) <<
+    "Wrong HTML to ASCII text serialization with format=flowed; and quoted "
+    "lines";
 }
 
-nsresult
-TestPrettyPrintedHtml()
+TEST(PlainTextSerializer, PrettyPrintedHtml)
 {
   nsString test;
   test.AppendLiteral(
     "<html>" NS_LINEBREAK
     "<body>" NS_LINEBREAK
     "  first<br>" NS_LINEBREAK
     "  second<br>" NS_LINEBREAK
     "</body>" NS_LINEBREAK "</html>");
 
   ConvertBufToPlainText(test, 0);
-  if (!test.EqualsLiteral("first" NS_LINEBREAK "second" NS_LINEBREAK)) {
-    fail("Wrong prettyprinted html to text serialization");
-    return NS_ERROR_FAILURE;
-  }
-
-  passed("prettyprinted HTML to text serialization test");
-  return NS_OK;
+  ASSERT_TRUE(test.EqualsLiteral("first" NS_LINEBREAK "second" NS_LINEBREAK)) <<
+    "Wrong prettyprinted html to text serialization";
 }
 
-nsresult
-TestPreElement()
+TEST(PlainTextSerializer, PreElement)
 {
   nsString test;
   test.AppendLiteral(
     "<html>" NS_LINEBREAK
     "<body>" NS_LINEBREAK
     "<pre>" NS_LINEBREAK
     "  first" NS_LINEBREAK
     "  second" NS_LINEBREAK
     "</pre>" NS_LINEBREAK
     "</body>" NS_LINEBREAK "</html>");
 
   ConvertBufToPlainText(test, 0);
-  if (!test.EqualsLiteral("  first" NS_LINEBREAK "  second" NS_LINEBREAK NS_LINEBREAK)) {
-    fail("Wrong prettyprinted html to text serialization");
-    return NS_ERROR_FAILURE;
-  }
-
-  passed("prettyprinted HTML to text serialization test");
-  return NS_OK;
+  ASSERT_TRUE(test.EqualsLiteral("  first" NS_LINEBREAK
+                                 "  second" NS_LINEBREAK NS_LINEBREAK)) <<
+    "Wrong prettyprinted html to text serialization";
 }
 
-nsresult
-TestBlockElement()
+TEST(PlainTextSerializer, BlockElement)
 {
   nsString test;
   test.AppendLiteral(
     "<html>" NS_LINEBREAK
     "<body>" NS_LINEBREAK
     "<div>" NS_LINEBREAK
     "  first" NS_LINEBREAK
     "</div>" NS_LINEBREAK
     "<div>" NS_LINEBREAK
     "  second" NS_LINEBREAK
     "</div>" NS_LINEBREAK
     "</body>" NS_LINEBREAK "</html>");
 
   ConvertBufToPlainText(test, 0);
-  if (!test.EqualsLiteral("first" NS_LINEBREAK "second" NS_LINEBREAK)) {
-    fail("Wrong prettyprinted html to text serialization");
-    return NS_ERROR_FAILURE;
-  }
-
-  passed("prettyprinted HTML to text serialization test");
-  return NS_OK;
+  ASSERT_TRUE(test.EqualsLiteral("first" NS_LINEBREAK "second" NS_LINEBREAK)) <<
+    "Wrong prettyprinted html to text serialization";
 }
 
-nsresult
-TestPreWrapElementForThunderbird()
+TEST(PlainTextSerializer, PreWrapElementForThunderbird)
 {
   // This test examines the magic pre-wrap setup that Thunderbird relies on.
   nsString test;
   test.AppendLiteral(
     "<html>" NS_LINEBREAK
     "<body style=\"white-space: pre-wrap; width: 10ch;\">" NS_LINEBREAK
     "<pre>" NS_LINEBREAK
     "  first line is too long" NS_LINEBREAK
     "  second line is even loooonger  " NS_LINEBREAK
     "</pre>" NS_LINEBREAK
     "</body>" NS_LINEBREAK "</html>");
 
   ConvertBufToPlainText(test, nsIDocumentEncoder::OutputWrap);
   // "\n\n  first\nline is\ntoo long\n  second\nline is\neven\nloooonger\n\n\n"
-  if (!test.EqualsLiteral(NS_LINEBREAK NS_LINEBREAK
-                          "  first" NS_LINEBREAK
-                          "line is" NS_LINEBREAK
-                          "too long" NS_LINEBREAK
-                          "  second" NS_LINEBREAK
-                          "line is" NS_LINEBREAK
-                          "even" NS_LINEBREAK
-                          "loooonger" NS_LINEBREAK
-                          NS_LINEBREAK NS_LINEBREAK)) {
-    fail("Wrong prettyprinted html to text serialization");
-    return NS_ERROR_FAILURE;
-  }
-
-  passed("prettyprinted HTML to text serialization test");
-  return NS_OK;
+  ASSERT_TRUE(test.EqualsLiteral(NS_LINEBREAK NS_LINEBREAK
+                                 "  first" NS_LINEBREAK
+                                 "line is" NS_LINEBREAK
+                                 "too long" NS_LINEBREAK
+                                 "  second" NS_LINEBREAK
+                                 "line is" NS_LINEBREAK
+                                 "even" NS_LINEBREAK
+                                 "loooonger" NS_LINEBREAK
+                                 NS_LINEBREAK NS_LINEBREAK)) <<
+    "Wrong prettyprinted html to text serialization";
 }
 
-nsresult
-TestPlainTextSerializer()
+TEST(PlainTextSerializer, Simple)
 {
   nsString test;
   test.AppendLiteral("<html><base>base</base><head><span>span</span></head>"
                      "<body>body</body></html>");
   ConvertBufToPlainText(test, 0);
-  if (!test.EqualsLiteral("basespanbody")) {
-    fail("Wrong html to text serialization");
-    return NS_ERROR_FAILURE;
-  }
-
-  passed("HTML to text serialization test");
-
-  nsresult rv = TestASCIIWithFlowedDelSp();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = TestCJKWithFlowedDelSp();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = TestPrettyPrintedHtml();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = TestPreElement();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = TestBlockElement();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = TestPreWrapElementForThunderbird();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = TestCJKWithDisallowLineBreaking();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = TestPreformatFlowedQuotes();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // Add new tests here...
-  return NS_OK;
+  ASSERT_TRUE(test.EqualsLiteral("basespanbody")) <<
+    "Wrong html to text serialization";
 }
 
-int main(int argc, char** argv)
-{
-  ScopedXPCOM xpcom("PlainTextSerializer");
-  if (xpcom.failed())
-    return 1;
-
-  int retval = 0;
-  if (NS_FAILED(TestPlainTextSerializer())) {
-    retval = 1;
-  }
-
-  return retval;
-}
--- a/dom/base/test/gtest/moz.build
+++ b/dom/base/test/gtest/moz.build
@@ -1,16 +1,18 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, you can obtain one at http://mozilla.org/MPL/2.0/.
 
 UNIFIED_SOURCES += [
+    'TestNativeXMLHttpRequest.cpp',
     'TestParserDialogOptions.cpp',
+    'TestPlainTextSerializer.cpp',
 ]
 
 LOCAL_INCLUDES += [
     '/dom/base'
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
--- a/dom/base/test/moz.build
+++ b/dom/base/test/moz.build
@@ -4,22 +4,16 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 XPCSHELL_TESTS_MANIFESTS += [
     'unit/xpcshell.ini',
     'unit_ipc/xpcshell.ini',
 ]
 
-GeckoCppUnitTests([
-    'TestGetURL',
-    'TestNativeXMLHttpRequest',
-    'TestPlainTextSerializer',
-])
-
 MOCHITEST_MANIFESTS += [
     'mochitest.ini',
     'websocket_hybi/mochitest.ini',
 ]
 
 MOCHITEST_CHROME_MANIFESTS += [
     'chrome.ini',
     'chrome/chrome.ini',
--- a/testing/cppunittest.ini
+++ b/testing/cppunittest.ini
@@ -27,38 +27,35 @@ skip-if = os == 'b2g' || (os == 'android
 skip-if = os != 'win'
 [TestEndian]
 [TestEnumeratedArray]
 [TestEnumSet]
 [TestEnumTypeTraits]
 [TestFastBernoulliTrial]
 [TestFloatingPoint]
 [TestFunction]
-[TestGetURL]
 [TestIntegerPrintfMacros]
 [TestIntegerRange]
 [TestIsCertBuiltInRoot]
 [TestJSONWriter]
 [TestJemalloc]
 [TestLinkedList]
 [TestMacroArgs]
 [TestMacroForEach]
 [TestMathAlgorithms]
 [TestMaybe]
-[TestNativeXMLHttpRequest]
 skip-if = os == 'b2g' || os == 'android'  #Bug 919642
 [TestNsRefPtr]
 [TestNtPathToDosPath]
 skip-if = os != 'win'
 [TestObserverArray]
 [TestObserverService]
 [TestPLDHash]
 skip-if = os == 'b2g'  #Bug 1038197
 [TestPair]
-[TestPlainTextSerializer]
 skip-if = os == 'b2g' || os == 'android'  #Bug 919599
 [TestPoisonArea]
 skip-if = os == 'android' # Bug 1147630
 [TestRefPtr]
 [TestRollingMean]
 [TestScopeExit]
 [TestSegmentedVector]
 [TestSHA1]