Bug 1119503 - Part 3: Change test_aboutmemory*.xul in order to not expect a newline at the very end of the copied text. r=njn, a=lmandel
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 18 Jan 2015 08:28:13 -0500
changeset 249619 5225cddf3c3a6a1fd3ef671485f0c66a700e71bd
parent 249618 8af1c37a245c2b47b912dd7cd257c6a83e11c981
child 249620 26f84760fadf23fd7d165275e3d377c1e56b61ef
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn, lmandel
bugs1119503
milestone37.0a2
Bug 1119503 - Part 3: Change test_aboutmemory*.xul in order to not expect a newline at the very end of the copied text. r=njn, a=lmandel After the patches in this bug, we only inject a newline at block element boundaries. In order to get these tests to pass, we just compare the trimmed version of the actual and expected tests.
toolkit/components/aboutmemory/tests/test_aboutmemory.xul
toolkit/components/aboutmemory/tests/test_aboutmemory2.xul
toolkit/components/aboutmemory/tests/test_aboutmemory3.xul
toolkit/components/aboutmemory/tests/test_aboutmemory4.xul
--- a/toolkit/components/aboutmemory/tests/test_aboutmemory.xul
+++ b/toolkit/components/aboutmemory/tests/test_aboutmemory.xul
@@ -562,17 +562,17 @@ End of 5th\n\
       let measureButton = doc.getElementById("measureButton");
       let verbose = doc.getElementById("verbose");
       verbose.checked = aVerbose;
       measureButton.click();
 
       SimpleTest.waitForClipboard(
         function(aActual) {
           mostRecentActual = aActual;
-          return aActual === aExpected;
+          return aActual.trim() === aExpected.trim();
         },
         function() {
           synthesizeKey("A", {accelKey: true});
           synthesizeKey("C", {accelKey: true});
         },
         aNext,
         function() {
           ok(false, "pasted text doesn't match for " + aFrameId);
--- a/toolkit/components/aboutmemory/tests/test_aboutmemory2.xul
+++ b/toolkit/components/aboutmemory/tests/test_aboutmemory2.xul
@@ -101,17 +101,17 @@
     }
 
     SimpleTest.executeSoon(function() {
       let mostRecentActual;
       document.getElementById("amFrame").focus();
       SimpleTest.waitForClipboard(
         function(aActual) {
           mostRecentActual = aActual;
-          return aActual === aExpected;
+          return aActual.trim() === aExpected.trim();
         },
         function() {
           synthesizeKey("A", {accelKey: true});
           synthesizeKey("C", {accelKey: true});
         },
         aNext,
         function() {
           ok(false, "pasted text doesn't match");
--- a/toolkit/components/aboutmemory/tests/test_aboutmemory3.xul
+++ b/toolkit/components/aboutmemory/tests/test_aboutmemory3.xul
@@ -101,17 +101,17 @@
       function copyPasteAndCheck() {
         // Copy and paste frame contents, and filter out non-deterministic
         // differences.
         synthesizeKey("A", {accelKey: true});
         synthesizeKey("C", {accelKey: true});
         let actual = SpecialPowers.getClipboardData("text/unicode");
         actual = actual.replace(/\(pid \d+\)/g, "(pid NNN)");
 
-        if (actual === aExpected) {
+        if (actual.trim() === aExpected.trim()) {
           SimpleTest.ok(true, "Clipboard has the expected contents");
           aNext();
         } else {
           numFailures++;
           if (numFailures === maxFailures) {
             ok(false, "pasted text doesn't match");
             dump("******EXPECTED******\n");
             dump(aExpected);
--- a/toolkit/components/aboutmemory/tests/test_aboutmemory4.xul
+++ b/toolkit/components/aboutmemory/tests/test_aboutmemory4.xul
@@ -49,17 +49,17 @@
     function copyPasteAndCheck() {
       // Copy and paste frame contents, and filter out non-deterministic
       // differences.
       synthesizeKey("A", {accelKey: true});
       synthesizeKey("C", {accelKey: true});
       let actual = SpecialPowers.getClipboardData("text/unicode");
       actual = actual.replace(/\(pid \d+\)/, "(pid NNN)");
 
-      if (actual === aExpected) {
+      if (actual.trim() === aExpected.trim()) {
         SimpleTest.ok(true, "Clipboard has the expected contents");
         aNext();
       } else {
         numFailures++;
         if (numFailures === maxFailures) {
           ok(false, "pasted text doesn't match");
           dump("******EXPECTED******\n");
           dump(aExpected);