Backed out changeset 14d7b6dbe0fb (bug 1314827) to be able to back out something else
authorPhil Ringnalda <philringnalda@gmail.com>
Thu, 03 Nov 2016 22:59:49 -0700
changeset 347702 c9308740eeb796ca1b534751c94ed5b2cb51e1fb
parent 347701 43b69e748e78b45983a5d8df6c0f9a77ccfed026
child 347703 561b87e98adacbd47769a71a0e6c72c5dcf66a9d
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1314827
milestone52.0a1
backs out14d7b6dbe0fb90073b24c2a21bb7180913714225
Backed out changeset 14d7b6dbe0fb (bug 1314827) to be able to back out something else MozReview-Commit-ID: 39mFOtrNixM
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
new file mode 100644
--- /dev/null
+++ b/dom/base/test/TestGetURL.cpp
@@ -0,0 +1,87 @@
+/* -*- 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/gtest/TestNativeXMLHttpRequest.cpp
rename to dom/base/test/TestNativeXMLHttpRequest.cpp
--- a/dom/base/test/gtest/TestNativeXMLHttpRequest.cpp
+++ b/dom/base/test/TestNativeXMLHttpRequest.cpp
@@ -1,58 +1,100 @@
 /* -*- 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 "gtest/gtest.h"
+#include "TestHarness.h"
 
-#include "nsContentUtils.h"
 #include "nsIDOMDocument.h"
 #include "nsIPrincipal.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIXMLHttpRequest.h"
 
-#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_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)
 
-TEST(NativeXMLHttpRequest, Test)
+#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()
 {
   nsresult rv;
 
   nsCOMPtr<nsIXMLHttpRequest> xhr =
     do_CreateInstance(NS_XMLHTTPREQUEST_CONTRACTID, &rv);
-  ASSERT_TRUE(NS_SUCCEEDED(rv)) << "Couldn't create nsIXMLHttpRequest instance";
+  TEST_ENSURE_SUCCESS(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);
-  ASSERT_TRUE(NS_SUCCEEDED(rv)) << "Couldn't get script security manager";
+  TEST_ENSURE_SUCCESS(rv, "Couldn't get script security manager!");
 
   nsCOMPtr<nsIPrincipal> systemPrincipal;
   rv = secman->GetSystemPrincipal(getter_AddRefs(systemPrincipal));
-  ASSERT_TRUE(NS_SUCCEEDED(rv)) << "Couldn't get system principal";
+  TEST_ENSURE_SUCCESS(rv, "Couldn't get system principal!");
 
   rv = xhr->Init(systemPrincipal, nullptr, nullptr, nullptr);
-  ASSERT_TRUE(NS_SUCCEEDED(rv)) << "Couldn't initialize the XHR";
+  TEST_ENSURE_SUCCESS(rv, "Couldn't initialize the XHR!");
 
   rv = xhr->Open(getString, testURL, false, empty, empty);
-  ASSERT_TRUE(NS_SUCCEEDED(rv)) << "Open failed";
+  TEST_ENSURE_SUCCESS(rv, "Open failed!");
 
   rv = xhr->Send(nullptr);
-  ASSERT_TRUE(NS_SUCCEEDED(rv)) << "Send failed";
+  TEST_ENSURE_SUCCESS(rv, "Send failed!");
 
   nsAutoString response;
   rv = xhr->GetResponseText(response);
-  ASSERT_TRUE(NS_SUCCEEDED(rv)) << "GetResponse failed";
-  ASSERT_TRUE(response.EqualsLiteral(TEST_URL_CONTENT)) <<
-    "Response text does not match";
+  TEST_ENSURE_SUCCESS(rv, "GetResponse failed!");
+
+  if (!response.EqualsLiteral(TEST_URL_CONTENT)) {
+    fail("Response text does not match!");
+    return NS_ERROR_FAILURE;
+  }
 
   nsCOMPtr<nsIDOMDocument> dom;
   rv = xhr->GetResponseXML(getter_AddRefs(dom));
-  ASSERT_TRUE(NS_SUCCEEDED(rv)) << "GetResponseXML failed";
-  ASSERT_TRUE(dom) << "No DOM document constructed";
+  TEST_ENSURE_SUCCESS(rv, "GetResponseXML failed!");
+
+  if (!dom) {
+    fail("No DOM document constructed!");
+    return NS_ERROR_FAILURE;
+  }
+
+  passed("Native XMLHttpRequest");
+  return NS_OK;
 }
+
+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/gtest/TestPlainTextSerializer.cpp
rename to dom/base/test/TestPlainTextSerializer.cpp
--- a/dom/base/test/gtest/TestPlainTextSerializer.cpp
+++ b/dom/base/test/TestPlainTextSerializer.cpp
@@ -1,31 +1,33 @@
 /* -*- 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 "gtest/gtest.h"
+#include "TestHarness.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
-TEST(PlainTextSerializer, ASCIIWithFlowedDelSp)
+nsresult
+TestASCIIWithFlowedDelSp()
 {
   nsString test;
   nsString result;
 
   test.AssignLiteral("<html><body>"
                      "Firefox Firefox Firefox Firefox "
                      "Firefox Firefox Firefox Firefox "
                      "Firefox Firefox Firefox Firefox"
@@ -37,22 +39,29 @@ TEST(PlainTextSerializer, ASCIIWithFlowe
                               nsIDocumentEncoder::OutputFormatFlowed |
                               nsIDocumentEncoder::OutputFormatDelSp);
 
   // create result case
   result.AssignLiteral("Firefox Firefox Firefox Firefox "
                        "Firefox Firefox Firefox Firefox "
                        "Firefox  \r\nFirefox Firefox Firefox\r\n");
 
-  ASSERT_TRUE(test.Equals(result)) <<
-    "Wrong HTML to ASCII text serialization with format=flowed; delsp=yes";
+  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;
 }
 
 // Test for CJK with format=flowed; delsp=yes
-TEST(PlainTextSerializer, CJKWithFlowedDelSp)
+nsresult
+TestCJKWithFlowedDelSp()
 {
   nsString test;
   nsString result;
 
   test.AssignLiteral("<html><body>");
   for (uint32_t i = 0; i < 40; i++) {
     // Insert Kanji (U+5341)
     test.Append(0x5341);
@@ -70,22 +79,29 @@ TEST(PlainTextSerializer, CJKWithFlowedD
     result.Append(0x5341);
   }
   result.AppendLiteral(" \r\n");
   for (uint32_t i = 0; i < 4; i++) {
     result.Append(0x5341);
   }
   result.AppendLiteral("\r\n");
 
-  ASSERT_TRUE(test.Equals(result)) <<
-    "Wrong HTML to CJK text serialization with format=flowed; delsp=yes";
+  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;
 }
 
 // Test for CJK with DisallowLineBreaking
-TEST(PlainTextSerializer, CJKWithDisallowLineBreaking)
+nsresult
+TestCJKWithDisallowLineBreaking()
 {
   nsString test;
   nsString result;
 
   test.AssignLiteral("<html><body>");
   for (uint32_t i = 0; i < 400; i++) {
     // Insert Kanji (U+5341)
     test.Append(0x5341);
@@ -99,22 +115,29 @@ TEST(PlainTextSerializer, CJKWithDisallo
                               nsIDocumentEncoder::OutputDisallowLineBreaking);
 
   // create result case
   for (uint32_t i = 0; i < 400; i++) {
     result.Append(0x5341);
   }
   result.AppendLiteral("\r\n");
 
-  ASSERT_TRUE(test.Equals(result)) <<
-    "Wrong HTML to CJK text serialization with OutputDisallowLineBreaking";
+  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;
 }
 
 // Test for ASCII with format=flowed; and quoted lines in preformatted span.
-TEST(PlainTextSerializer, PreformatFlowedQuotes)
+nsresult
+TestPreformatFlowedQuotes()
 {
   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>"
@@ -129,103 +152,175 @@ TEST(PlainTextSerializer, PreformatFlowe
                               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;
+  }
 
-  ASSERT_TRUE(test.Equals(result)) <<
-    "Wrong HTML to ASCII text serialization with format=flowed; and quoted "
-    "lines";
+  passed("HTML to ASCII text serialization with format=flowed; and quoted lines");
+
+  return NS_OK;
 }
 
-TEST(PlainTextSerializer, PrettyPrintedHtml)
+nsresult
+TestPrettyPrintedHtml()
 {
   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);
-  ASSERT_TRUE(test.EqualsLiteral("first" NS_LINEBREAK "second" NS_LINEBREAK)) <<
-    "Wrong prettyprinted html to text serialization";
+  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;
 }
 
-TEST(PlainTextSerializer, PreElement)
+nsresult
+TestPreElement()
 {
   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);
-  ASSERT_TRUE(test.EqualsLiteral("  first" NS_LINEBREAK
-                                 "  second" NS_LINEBREAK NS_LINEBREAK)) <<
-    "Wrong prettyprinted html to text serialization";
+  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;
 }
 
-TEST(PlainTextSerializer, BlockElement)
+nsresult
+TestBlockElement()
 {
   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);
-  ASSERT_TRUE(test.EqualsLiteral("first" NS_LINEBREAK "second" NS_LINEBREAK)) <<
-    "Wrong prettyprinted html to text serialization";
+  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;
 }
 
-TEST(PlainTextSerializer, PreWrapElementForThunderbird)
+nsresult
+TestPreWrapElementForThunderbird()
 {
   // 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"
-  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";
+  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;
 }
 
-TEST(PlainTextSerializer, Simple)
+nsresult
+TestPlainTextSerializer()
 {
   nsString test;
   test.AppendLiteral("<html><base>base</base><head><span>span</span></head>"
                      "<body>body</body></html>");
   ConvertBufToPlainText(test, 0);
-  ASSERT_TRUE(test.EqualsLiteral("basespanbody")) <<
-    "Wrong html to text serialization";
+  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;
 }
 
+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,18 +1,16 @@
 # -*- 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,16 +4,22 @@
 # 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,35 +27,38 @@ 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]