Bug 1571567 - Fix no-fallthrough errors in /dom. r=smaug
authorJared Wein <jwein@mozilla.com>
Thu, 08 Aug 2019 15:18:45 +0000
changeset 486948 e54f2402aa4933caa3e2f66cb8fc2905e4510883
parent 486947 eb557d4ba927128f71ab1e4a5f747b1e65cc4178
child 486949 cade7a6a7948ce63f089fedbb696132fcc7a148e
push id92059
push usermbanner@mozilla.com
push dateThu, 08 Aug 2019 16:29:33 +0000
treeherderautoland@381a12355930 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1571567
milestone70.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 1571567 - Fix no-fallthrough errors in /dom. r=smaug Differential Revision: https://phabricator.services.mozilla.com/D40874
dom/base/test/iframe_bug976673.html
dom/base/test/unit/head_xml.js
dom/browser-element/BrowserElementChildPreload.js
dom/media/webaudio/test/test_ScriptProcessorCollected1.html
dom/notification/NotificationStorage.jsm
dom/plugins/test/mochitest/test_npruntime_npninvoke.html
dom/tests/mochitest/localstorage/interOriginTest.js
dom/tests/mochitest/localstorage/interOriginTest2.js
dom/tests/mochitest/localstorage/test_localStorageQuotaPrivateBrowsing_perwindowpb.html
dom/tests/mochitest/sessionstorage/interOriginTest.js
dom/tests/mochitest/storageevent/interOriginTest2.js
--- a/dom/base/test/iframe_bug976673.html
+++ b/dom/base/test/iframe_bug976673.html
@@ -10,16 +10,17 @@
   <script>
     var input = document.getElementById("input");
     window.addEventListener("message", function (aEvent) {
         switch (aEvent.data) {
           case "init":
             input.blur();
             input.value = "";
             input.focus();
+          // fall through
           case "check":
             aEvent.source.postMessage("input-value: " + input.value, "*");
             break;
         }
       });
   </script>
 </body>
 </html>
--- a/dom/base/test/unit/head_xml.js
+++ b/dom/base/test/unit/head_xml.js
@@ -98,16 +98,17 @@ function do_compare_attrs(e1, e2) {
 }
 
 function do_check_equiv(dom1, dom2) {
   Assert.equal(dom1.nodeType, dom2.nodeType);
   switch (dom1.nodeType) {
     case Node.PROCESSING_INSTRUCTION_NODE:
       Assert.equal(dom1.target, dom2.target);
       Assert.equal(dom1.data, dom2.data);
+    // fall through
     case Node.TEXT_NODE:
     case Node.CDATA_SECTION_NODE:
     case Node.COMMENT_NODE:
       Assert.equal(dom1.data, dom2.data);
       break;
     case Node.ELEMENT_NODE:
       Assert.equal(dom1.namespaceURI, dom2.namespaceURI);
       Assert.equal(dom1.localName, dom2.localName);
--- a/dom/browser-element/BrowserElementChildPreload.js
+++ b/dom/browser-element/BrowserElementChildPreload.js
@@ -1166,16 +1166,17 @@ BrowserElementChild.prototype = {
         } catch (e) {}
         sendAsyncMsg("loadend", { backgroundColor: bgColor });
 
         switch (status) {
           case Cr.NS_OK:
           case Cr.NS_BINDING_ABORTED:
           // Ignoring NS_BINDING_ABORTED, which is set when loading page is
           // stopped.
+          // fall through
           case Cr.NS_ERROR_PARSED_DATA_CACHED:
             return;
 
           // TODO See nsDocShell::DisplayLoadError to see what extra
           // information we should be annotating this first block of errors
           // with. Bug 1107091.
           case Cr.NS_ERROR_UNKNOWN_PROTOCOL:
             sendAsyncMsg("error", { type: "unknownProtocolFound" });
--- a/dom/media/webaudio/test/test_ScriptProcessorCollected1.html
+++ b/dom/media/webaudio/test/test_ScriptProcessorCollected1.html
@@ -42,16 +42,17 @@ var processCount = 0;
 testProcessor.onaudioprocess = function(event) {
   ++processCount;
   switch (processCount) {
   case 1:
     // Switch to listening to referenceProcessor;
     referenceProcessor.onaudioprocess = event.target.onaudioprocess;
     referenceProcessor = null;
     event.target.onaudioprocess = null;
+    break;
   case 2:
     // There are no references to testProcessor and so GC can begin.
     SpecialPowers.forceGC();
     break;
   case 3:
     // Another GC should not be required after testProcessor would have
     // received another audioprocess event.
     SpecialPowers.forceCC();
--- a/dom/notification/NotificationStorage.jsm
+++ b/dom/notification/NotificationStorage.jsm
@@ -175,16 +175,17 @@ NotificationStorage.prototype = {
 
       case kMessageNotificationGetAllKo:
         delete this._requests[message.data.requestID];
         try {
           request.callback.done();
         } catch (e) {
           debug("Error calling callback done: " + e);
         }
+        break;
       case kMessageNotificationSaveKo:
       case kMessageNotificationDeleteKo:
         if (DEBUG) {
           debug(
             "Error received when treating: '" +
               message.name +
               "': " +
               message.data.errorMsg
--- a/dom/plugins/test/mochitest/test_npruntime_npninvoke.html
+++ b/dom/plugins/test/mochitest/test_npruntime_npninvoke.html
@@ -123,16 +123,17 @@
           break;
         case 4:
           result = plugin.npnInvokeTest(test[0][0], test[0][1], test[0][2],
               test[0][3]);
           break;
         case 5:
           result = plugin.npnInvokeTest(test[0][0], test[0][1], test[0][2],
               test[0][3], test[0][4]);
+          break;
         case 6:
           result = plugin.npnInvokeTest(test[0][0], test[0][1], test[0][2],
               test[0][3], test[0][4], test[0][5]);
           break;
         case 7:
           result = plugin.npnInvokeTest(test[0][0], test[0][1], test[0][2],
               test[0][3], test[0][4], test[0][5], test[0][6]);
           break;
--- a/dom/tests/mochitest/localstorage/interOriginTest.js
+++ b/dom/tests/mochitest/localstorage/interOriginTest.js
@@ -11,19 +11,18 @@ window.addEventListener("message", onMes
 function onMessageReceived(event) {
   switch (event.data) {
     // Indication of the frame onload event
     case "frame loaded":
       if (--slaveLoadsPending) {
         break;
       }
 
-    // Just fall through...
-
     // Indication of successfully finished step of a test
+    // fall through
     case "perf":
       if (event.data == "perf") {
         doStep();
       }
 
       slave.postMessage("step", slaveOrigin);
       break;
 
--- a/dom/tests/mochitest/localstorage/interOriginTest2.js
+++ b/dom/tests/mochitest/localstorage/interOriginTest2.js
@@ -17,19 +17,18 @@ window.addEventListener("message", onMes
 function onMessageReceived(event) {
   switch (event.data) {
     // Indication of the frame onload event
     case "frame loaded":
       if (--frameLoadsPending) {
         break;
       }
 
+    // Indication of successfully finished step of a test
     // Just fall through...
-
-    // Indication of successfully finished step of a test
     case "perf":
       if (callMasterFrame) {
         masterFrame.postMessage("step", masterFrameOrigin);
       } else {
         slaveFrame.postMessage("step", slaveFrameOrigin);
       }
       callMasterFrame = !callMasterFrame;
       break;
--- a/dom/tests/mochitest/localstorage/test_localStorageQuotaPrivateBrowsing_perwindowpb.html
+++ b/dom/tests/mochitest/localstorage/test_localStorageQuotaPrivateBrowsing_perwindowpb.html
@@ -137,18 +137,18 @@ function doNextTest(aWindow) {
 
 function onMessageReceived(event, aWindow) {
   info("Message received: " + event.data);
   switch (event.data) {
     // Indication of the frame onload event
     case "frame loaded":
       if (--slaveLoadsPending)
         break;
-      // Just fall through...
     // Indication of successfully finished step of a test
+    // Just fall through...
     case "perf":
       // postMessage should send to the slaveOrigin. However with the addition of private
       // browsing flags in origin attributes this will cause postMessage to fail. The origin of this
       // window has false privatebrowsing, while the recipient is in a private window.
       // To fix this issue and preserve the integrity of the test a * is passed to get around origin equality.
       slave.postMessage("step", "*");
       break;
     // Indication of all test parts finish (from any of the frames)
--- a/dom/tests/mochitest/sessionstorage/interOriginTest.js
+++ b/dom/tests/mochitest/sessionstorage/interOriginTest.js
@@ -12,19 +12,18 @@ function onMessageReceived(event) {
   //alert("master got event: "+event.data);
   switch (event.data) {
     // Indication of the frame onload event
     case "frame loaded":
       if (--slaveLoadsPending) {
         break;
       }
 
+    // Indication of successfully finished step of a test
     // Just fall through...
-
-    // Indication of successfully finished step of a test
     case "perf":
       // We called doStep before the frame was load
       if (event.data == "perf") {
         doStep();
       }
 
       slave.postMessage("step", slaveOrigin);
       break;
--- a/dom/tests/mochitest/storageevent/interOriginTest2.js
+++ b/dom/tests/mochitest/storageevent/interOriginTest2.js
@@ -16,19 +16,18 @@ window.addEventListener("message", onMes
 function onMessageReceived(event) {
   switch (event.data) {
     // Indication of the frame onload event
     case "frame loaded":
       if (--frameLoadsPending) {
         break;
       }
 
+    // Indication of successfully finished step of a test
     // Just fall through...
-
-    // Indication of successfully finished step of a test
     case "perf":
       if (callMasterFrame) {
         masterFrame.postMessage("step", "*");
       } else if (slaveFrame) {
         slaveFrame.postMessage("step", "*");
       } else if (masterFrame.slaveFrame) {
         masterFrame.slaveFrame.postMessage("step", "*");
       }