Title: [278512] trunk
Revision
278512
Author
[email protected]
Date
2021-06-04 17:16:56 -0700 (Fri, 04 Jun 2021)

Log Message

Web Inspector: Uncaught Exception: undefined is not an object (evaluating 'InspectorBackend.Enum.Page.ResourceType')
https://bugs.webkit.org/show_bug.cgi?id=226664

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackendClass.prototype.get Enum):
Use the list of all registered domains, not just the active domains, as only commands/events
are able to be filtered by target type.

LayoutTests:

* inspector/protocol/enum.html: Added.
* inspector/protocol/enum-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (278511 => 278512)


--- trunk/LayoutTests/ChangeLog	2021-06-04 23:57:39 UTC (rev 278511)
+++ trunk/LayoutTests/ChangeLog	2021-06-05 00:16:56 UTC (rev 278512)
@@ -1,3 +1,13 @@
+2021-06-04  Devin Rousso  <[email protected]>
+
+        Web Inspector: Uncaught Exception: undefined is not an object (evaluating 'InspectorBackend.Enum.Page.ResourceType')
+        https://bugs.webkit.org/show_bug.cgi?id=226664
+
+        Reviewed by Joseph Pecoraro.
+
+        * inspector/protocol/enum.html: Added.
+        * inspector/protocol/enum-expected.txt: Added.
+
 2021-06-04  Brady Eidson  <[email protected]>
 
         Enforce a quota in window.sessionStorage

Added: trunk/LayoutTests/inspector/protocol/enum-expected.txt (0 => 278512)


--- trunk/LayoutTests/inspector/protocol/enum-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/inspector/protocol/enum-expected.txt	2021-06-05 00:16:56 UTC (rev 278512)
@@ -0,0 +1,7 @@
+Tests to validate being able to still get enum values for domains that aren't active.
+
+
+== Running test suite: Protocol.Enum
+-- Running test case: Protocol.Enum.NotMatchingDebuggableType
+PASS: Should have a 'ServiceWorker' domain to get protocol enums.
+

Added: trunk/LayoutTests/inspector/protocol/enum.html (0 => 278512)


--- trunk/LayoutTests/inspector/protocol/enum.html	                        (rev 0)
+++ trunk/LayoutTests/inspector/protocol/enum.html	2021-06-05 00:16:56 UTC (rev 278512)
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script>
+function test()
+{
+    let suite = InspectorTest.createSyncSuite("Protocol.Enum");
+
+    suite.addTestCase({
+        name: "Protocol.Enum.NotMatchingDebuggableType",
+        description: "Check that protocol domains that do not match the current debuggable type still exist in `InspectorBackend.Enum`.",
+        test() {
+            InspectorTest.assert(WI.sharedApp.debuggableType !== WI.DebuggableType.ServiceWorker, `Should not be a '${WI.DebuggableType.ServiceWorker}' debuggable.`);
+            InspectorTest.expectTrue(InspectorBackend.Enum.ServiceWorker, "Should have a 'ServiceWorker' domain to get protocol enums.");
+        },
+    });
+
+    suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body _onload_="runTest()">
+    <p>Tests to validate being able to still get enum values for domains that aren't active.</p>
+</body>
+</html>

Modified: trunk/Source/WebInspectorUI/ChangeLog (278511 => 278512)


--- trunk/Source/WebInspectorUI/ChangeLog	2021-06-04 23:57:39 UTC (rev 278511)
+++ trunk/Source/WebInspectorUI/ChangeLog	2021-06-05 00:16:56 UTC (rev 278512)
@@ -1,3 +1,15 @@
+2021-06-04  Devin Rousso  <[email protected]>
+
+        Web Inspector: Uncaught Exception: undefined is not an object (evaluating 'InspectorBackend.Enum.Page.ResourceType')
+        https://bugs.webkit.org/show_bug.cgi?id=226664
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Protocol/InspectorBackend.js:
+        (InspectorBackendClass.prototype.get Enum):
+        Use the list of all registered domains, not just the active domains, as only commands/events
+        are able to be filtered by target type.
+
 2021-05-15  Said Abou-Hallawa  <[email protected]>
 
         Implement CanvasRenderingContext2D.createConicGradient

Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js (278511 => 278512)


--- trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js	2021-06-04 23:57:39 UTC (rev 278511)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/InspectorBackend.js	2021-06-05 00:16:56 UTC (rev 278512)
@@ -63,7 +63,8 @@
     // Domain/Command/Event feature checking should use one of the `has*` functions below.
     get Enum()
     {
-        return this._activeDomains;
+        // Enums should not be conditionally enabled by debuggable and/or target type.
+        return this._registeredDomains;
     }
 
     // It's still possible to set this flag on InspectorBackend to just
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to