Bug 1577819, part 4 - Add some basic validity checks for the type. r=Ehsan
authorAndrew McCreight <continuation@gmail.com>
Fri, 30 Aug 2019 21:52:42 +0000
changeset 490948 98059acdf5be3f6b91a14e5700403432dd998ab8
parent 490947 a9ac86bbe8d0bdec01fecf09827514a780142e57
child 490949 bf6c6df8d211178292928a2194c560b22b168ba3
push id36515
push userdluca@mozilla.com
push dateSat, 31 Aug 2019 09:47:12 +0000
treeherdermozilla-central@56db66978b42 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersEhsan
bugs1577819
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 1577819, part 4 - Add some basic validity checks for the type. r=Ehsan The test for procinfo doesn't check if the process type is reasonable. With Fission, this test now asserts, so add a failure annotation. I'll fix it up for Fission in another bug. Differential Revision: https://phabricator.services.mozilla.com/D44214
widget/tests/browser/browser.ini
widget/tests/browser/browser_test_procinfo.js
--- a/widget/tests/browser/browser.ini
+++ b/widget/tests/browser/browser.ini
@@ -4,9 +4,10 @@ prefs=
 
 support-files =
   dummy.html
 
 [browser_test_clipboardcache.js]
 tags = clipboard
 skip-if = os == 'android'
 [browser_test_procinfo.js]
+fail-if = fission
 skip-if = os == "android"
--- a/widget/tests/browser/browser_test_procinfo.js
+++ b/widget/tests/browser/browser_test_procinfo.js
@@ -15,22 +15,39 @@ add_task(async function test_proc_info()
     { gBrowser, url: DUMMY_URL },
     async function(browser) {
       let cpuThreads = 0;
       let cpuUser = 0;
       for (let z = 0; z < 10; z++) {
         let parentProc = await ChromeUtils.requestProcInfo();
         cpuUser += parentProc.cpuUser;
 
+        Assert.equal(
+          parentProc.type,
+          "browser",
+          "Parent proc type should be browser"
+        );
+
         for (var x = 0; x < parentProc.threads.length; x++) {
           cpuThreads += parentProc.threads[x].cpuUser;
         }
 
         for (var i = 0; i < parentProc.children.length; i++) {
           let childProc = parentProc.children[i];
+          Assert.notEqual(
+            childProc.type,
+            "browser",
+            "Child proc type should not be browser"
+          );
+          Assert.notEqual(
+            childProc.type,
+            "unknown",
+            "Child proc type should be known"
+          );
+
           for (var y = 0; y < childProc.threads.length; y++) {
             cpuThreads += childProc.threads[y].cpuUser;
           }
           cpuUser += childProc.cpuUser;
         }
       }
       // see https://bugzilla.mozilla.org/show_bug.cgi?id=1529023
       if (!MAC) {