Bug 1546202 - Part 4: Allow Blackboxing before text is loaded. r=jlast
authorLogan Smyth <loganfsmyth@gmail.com>
Tue, 23 Apr 2019 16:51:58 +0000
changeset 470527 ed79e89eea8d82a8a7d4c3e3a673f036d9532f81
parent 470526 800d67478a31025bf0c61a6d41af87ece51c75cb
child 470528 55ac8a74ae588ba1ea7760c53512ad4fc42b51d0
push id35906
push useraciure@mozilla.com
push dateTue, 23 Apr 2019 22:14:56 +0000
treeherdermozilla-central@0ce3633f8b80 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlast
bugs1546202
milestone68.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 1546202 - Part 4: Allow Blackboxing before text is loaded. r=jlast Depends on D28410 Differential Revision: https://phabricator.services.mozilla.com/D28411
devtools/client/debugger/src/components/Editor/tests/__snapshots__/Footer.spec.js.snap
devtools/client/debugger/src/components/PrimaryPanes/tests/SourcesTreeItem.spec.js
devtools/client/debugger/src/utils/source.js
--- a/devtools/client/debugger/src/components/Editor/tests/__snapshots__/Footer.spec.js.snap
+++ b/devtools/client/debugger/src/components/Editor/tests/__snapshots__/Footer.spec.js.snap
@@ -1,17 +1,33 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
 exports[`SourceFooter Component default case should render 1`] = `
 <div
   className="source-footer"
 >
   <div
     className="source-footer-start"
-  />
+  >
+    <div
+      className="commands"
+    >
+      <button
+        aria-label="Blackbox source"
+        className="action black-box"
+        key="black-box"
+        onClick={[Function]}
+        title="Blackbox source"
+      >
+        <AccessibleImage
+          className="blackBox"
+        />
+      </button>
+    </div>
+  </div>
   <div
     className="source-footer-end"
   >
     <div
       className="cursor-position"
       title="(Line 1, column 1)"
     >
       (1, 1)
@@ -27,17 +43,33 @@ exports[`SourceFooter Component default 
 `;
 
 exports[`SourceFooter Component move cursor should render new cursor position 1`] = `
 <div
   className="source-footer"
 >
   <div
     className="source-footer-start"
-  />
+  >
+    <div
+      className="commands"
+    >
+      <button
+        aria-label="Blackbox source"
+        className="action black-box"
+        key="black-box"
+        onClick={[Function]}
+        title="Blackbox source"
+      >
+        <AccessibleImage
+          className="blackBox"
+        />
+      </button>
+    </div>
+  </div>
   <div
     className="source-footer-end"
   >
     <div
       className="cursor-position"
       title="(Line 6, column 11)"
     >
       (6, 11)
--- a/devtools/client/debugger/src/components/PrimaryPanes/tests/SourcesTreeItem.spec.js
+++ b/devtools/client/debugger/src/components/PrimaryPanes/tests/SourcesTreeItem.spec.js
@@ -82,17 +82,17 @@ describe("SourceTreeItem", () => {
           click: expect.any(Function),
           disabled: false,
           id: "node-menu-copy-source",
           label: "Copy source URI"
         },
         {
           accesskey: "B",
           click: expect.any(Function),
-          disabled: true,
+          disabled: false,
           id: "node-menu-blackbox",
           label: "Blackbox source"
         }
       ];
       const mockEvent = {
         preventDefault: jest.fn(),
         stopPropagation: jest.fn()
       };
@@ -121,17 +121,17 @@ describe("SourceTreeItem", () => {
           click: expect.any(Function),
           disabled: false,
           id: "node-menu-copy-source",
           label: "Copy source URI"
         },
         {
           accesskey: "B",
           click: expect.any(Function),
-          disabled: true,
+          disabled: false,
           id: "node-menu-blackbox",
           label: "Blackbox source"
         }
       ];
       const mockEvent = {
         preventDefault: jest.fn(),
         stopPropagation: jest.fn()
       };
--- a/devtools/client/debugger/src/utils/source.js
+++ b/devtools/client/debugger/src/utils/source.js
@@ -54,17 +54,17 @@ function trimUrlQuery(url: string): stri
   return url.slice(0, q);
 }
 
 export function shouldBlackbox(source: ?Source) {
   if (!source) {
     return false;
   }
 
-  if (!isLoaded(source) || !source.url) {
+  if (!source.url) {
     return false;
   }
 
   if (isOriginalId(source.id) && !features.originalBlackbox) {
     return false;
   }
 
   return true;