Title: [207444] trunk
Revision
207444
Author
joep...@webkit.org
Date
2016-10-17 17:36:12 -0700 (Mon, 17 Oct 2016)

Log Message

Web Inspector: Add toggles for debugger pauses at console.assert failures
https://bugs.webkit.org/show_bug.cgi?id=139542
<rdar://problem/19281600>

Reviewed by Timothy Hatcher.

Source/_javascript_Core:

* inspector/agents/InspectorDebuggerAgent.h:
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::disable):
(Inspector::InspectorDebuggerAgent::setPauseOnAssertions):
Toggle pause on assertions state. Default is disabled,
and disable it when frontends disconnect.

(Inspector::InspectorDebuggerAgent::handleConsoleAssert):
Instead of using the PauseOnAllExceptions state, use this
new state specific to assertions.

* inspector/protocol/Debugger.json:
New protocol method to toggle pausing on assertions.

Source/WebInspectorUI:

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.prototype.get assertionsBreakpoint):
(WebInspector.DebuggerManager.prototype.isBreakpointRemovable):
(WebInspector.DebuggerManager.prototype._breakpointDisabledStateDidChange):
New breakpoint and toggling behavior.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel):
(WebInspector.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement):
(WebInspector.DebuggerSidebarPanel.prototype._compareTopLevelTreeElements.isSpecialBreakpoint):
(WebInspector.DebuggerSidebarPanel.prototype._compareTopLevelTreeElements):
New breakpoint tree element behavior.

(WebInspector.DebuggerSidebarPanel.prototype.saveStateToCookie):
(WebInspector.DebuggerSidebarPanel.prototype.restoreStateFromCookie):
Sidebar restoration if it was selected.

* UserInterface/Images/Assertion.svg: Added.
* UserInterface/Images/gtk/Assertion.svg: Added.
* UserInterface/Views/BreakpointTreeElement.css:
(.breakpoint-assertion-icon .icon):
New sidebar icon for the global breakpoint.

LayoutTests:

* inspector/debugger/pause-on-assert.html:
* inspector/debugger/pause-reason.html:
These tests need to enable pause on assertions.

* inspector/debugger/setPauseOnAssertions-expected.txt: Added.
* inspector/debugger/setPauseOnAssertions.html: Added.
Specific tests for the new protocol method.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (207443 => 207444)


--- trunk/LayoutTests/ChangeLog	2016-10-18 00:28:34 UTC (rev 207443)
+++ trunk/LayoutTests/ChangeLog	2016-10-18 00:36:12 UTC (rev 207444)
@@ -1,3 +1,19 @@
+2016-10-17  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Add toggles for debugger pauses at console.assert failures
+        https://bugs.webkit.org/show_bug.cgi?id=139542
+        <rdar://problem/19281600>
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/debugger/pause-on-assert.html:
+        * inspector/debugger/pause-reason.html:
+        These tests need to enable pause on assertions.
+
+        * inspector/debugger/setPauseOnAssertions-expected.txt: Added.
+        * inspector/debugger/setPauseOnAssertions.html: Added.
+        Specific tests for the new protocol method.
+
 2016-10-17  Ryan Haddad  <ryanhad...@apple.com>
 
         Marking platform/ios-simulator/ios/plugin/youtube-flash-plugin-iframe.html as flaky on ios-simulator debug.

Modified: trunk/LayoutTests/inspector/debugger/pause-on-assert.html (207443 => 207444)


--- trunk/LayoutTests/inspector/debugger/pause-on-assert.html	2016-10-18 00:28:34 UTC (rev 207443)
+++ trunk/LayoutTests/inspector/debugger/pause-on-assert.html	2016-10-18 00:36:12 UTC (rev 207444)
@@ -8,6 +8,7 @@
     InspectorProtocol.sendCommand("Debugger.enable", {});
     InspectorProtocol.sendCommand("Debugger.setBreakpointsActive", {active: true});
     InspectorProtocol.sendCommand("Debugger.setPauseOnExceptions", {state: "all"}, InspectorProtocol.checkForError);
+    InspectorProtocol.sendCommand("Debugger.setPauseOnAssertions", {enabled: true}, InspectorProtocol.checkForError);
 
     var step = null;
     var steps = [

Modified: trunk/LayoutTests/inspector/debugger/pause-reason.html (207443 => 207444)


--- trunk/LayoutTests/inspector/debugger/pause-reason.html	2016-10-18 00:28:34 UTC (rev 207443)
+++ trunk/LayoutTests/inspector/debugger/pause-reason.html	2016-10-18 00:36:12 UTC (rev 207444)
@@ -47,6 +47,7 @@
     }
 
     WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
+    WebInspector.debuggerManager.assertionsBreakpoint.disabled = false;
 
     WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, function(event) {
         var scriptObject = event.data.script;

Added: trunk/LayoutTests/inspector/debugger/setPauseOnAssertions-expected.txt (0 => 207444)


--- trunk/LayoutTests/inspector/debugger/setPauseOnAssertions-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/inspector/debugger/setPauseOnAssertions-expected.txt	2016-10-18 00:36:12 UTC (rev 207444)
@@ -0,0 +1,12 @@
+CONSOLE MESSAGE: line 8: Failing assertion
+CONSOLE MESSAGE: line 8: Failing assertion
+Debugger.setPauseOnAssertions
+
+
+== Running test suite: Debugger.setPauseOnAssertions
+-- Running test case: Debugger.setPauseOnAssertions.Disabled
+PASS: Should not pause.
+
+-- Running test case: Debugger.setPauseOnAssertions.Enabled
+PASS: Should paused.
+

Added: trunk/LayoutTests/inspector/debugger/setPauseOnAssertions.html (0 => 207444)


--- trunk/LayoutTests/inspector/debugger/setPauseOnAssertions.html	                        (rev 0)
+++ trunk/LayoutTests/inspector/debugger/setPauseOnAssertions.html	2016-10-18 00:36:12 UTC (rev 207444)
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script>
+function triggerAssertions() {
+    console.assert(true, "Passing assertion");
+    console.assert(false, "Failing assertion");
+}
+
+function test()
+{
+    // Pause on all exceptions should not affect pausing on assertions.
+    WebInspector.debuggerManager.allExceptionsBreakpoint.disabled = false;
+
+    let suite = InspectorTest.createAsyncSuite("Debugger.setPauseOnAssertions");
+
+    suite.addTestCase({
+        name: "Debugger.setPauseOnAssertions.Disabled",
+        description: "Do not pause on assertions when disabled.",
+        test(resolve, reject) {
+            WebInspector.debuggerManager.assertionsBreakpoint.disabled = true;
+
+            let listener = WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.Paused, (event) => {
+                InspectorTest.fail("Should not have paused.");
+                reject();
+            });
+
+            InspectorTest.evaluateInPage("triggerAssertions()", () => {
+                InspectorTest.pass("Should not pause.");
+                WebInspector.debuggerManager.removeEventListener(WebInspector.DebuggerManager.Event.Paused, listener);
+                resolve();
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: "Debugger.setPauseOnAssertions.Enabled",
+        description: "Pause on assertions when enabled.",
+        test(resolve, reject) {
+            WebInspector.debuggerManager.assertionsBreakpoint.disabled = false;
+
+            let didPause = false;
+            let listener = WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.Paused, (event) => {
+                InspectorTest.pass("Should paused.");
+                WebInspector.debuggerManager.resume();
+                didPause = true;
+            });
+
+            InspectorTest.evaluateInPage("triggerAssertions()", () => {
+                if (!didPause)
+                    InspectorTest.fail("Should have paused.");
+                resolve();
+            });
+        }
+    });
+
+    suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body _onload_="runTest()">
+<p>Debugger.setPauseOnAssertions</p>
+</body>
+</html>

Modified: trunk/Source/_javascript_Core/ChangeLog (207443 => 207444)


--- trunk/Source/_javascript_Core/ChangeLog	2016-10-18 00:28:34 UTC (rev 207443)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-10-18 00:36:12 UTC (rev 207444)
@@ -1,3 +1,25 @@
+2016-10-17  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Add toggles for debugger pauses at console.assert failures
+        https://bugs.webkit.org/show_bug.cgi?id=139542
+        <rdar://problem/19281600>
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/agents/InspectorDebuggerAgent.h:
+        * inspector/agents/InspectorDebuggerAgent.cpp:
+        (Inspector::InspectorDebuggerAgent::disable):
+        (Inspector::InspectorDebuggerAgent::setPauseOnAssertions):
+        Toggle pause on assertions state. Default is disabled,
+        and disable it when frontends disconnect.
+
+        (Inspector::InspectorDebuggerAgent::handleConsoleAssert):
+        Instead of using the PauseOnAllExceptions state, use this
+        new state specific to assertions.
+
+        * inspector/protocol/Debugger.json:
+        New protocol method to toggle pausing on assertions.
+
 2016-10-17  Yusuke Suzuki  <utatane....@gmail.com>
 
         [DOMJIT][JSC] Add Option::useDOMJIT

Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp (207443 => 207444)


--- trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp	2016-10-18 00:28:34 UTC (rev 207443)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp	2016-10-18 00:36:12 UTC (rev 207444)
@@ -113,6 +113,8 @@
     if (m_listener)
         m_listener->debuggerWasDisabled();
 
+    m_pauseOnAssertionFailures = false;
+
     m_enabled = false;
 }
 
@@ -193,7 +195,7 @@
 
 void InspectorDebuggerAgent::handleConsoleAssert(const String& message)
 {
-    if (m_scriptDebugServer.pauseOnExceptionsState() != JSC::Debugger::DontPauseOnExceptions)
+    if (m_pauseOnAssertionFailures)
         breakProgram(DebuggerFrontendDispatcher::Reason::Assert, buildAssertPauseReason(message));
 }
 
@@ -628,6 +630,11 @@
         errorString = ASCIILiteral("Internal error. Could not change pause on exceptions state");
 }
 
+void InspectorDebuggerAgent::setPauseOnAssertions(ErrorString&, bool enabled)
+{
+    m_pauseOnAssertionFailures = enabled;
+}
+
 void InspectorDebuggerAgent::evaluateOnCallFrame(ErrorString& errorString, const String& callFrameId, const String& _expression_, const String* const objectGroup, const bool* const includeCommandLineAPI, const bool* const doNotPauseOnExceptionsAndMuteConsole, const bool* const returnByValue, const bool* generatePreview, const bool* saveResult, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Inspector::Protocol::OptOutput<bool>* wasThrown, Inspector::Protocol::OptOutput<int>* savedResultIndex)
 {
     if (m_currentCallStack.hasNoValue()) {

Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.h (207443 => 207444)


--- trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.h	2016-10-18 00:28:34 UTC (rev 207443)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.h	2016-10-18 00:36:12 UTC (rev 207444)
@@ -77,6 +77,7 @@
     void stepInto(ErrorString&) final;
     void stepOut(ErrorString&) final;
     void setPauseOnExceptions(ErrorString&, const String& pauseState) final;
+    void setPauseOnAssertions(ErrorString&, bool enabled) final;
     void evaluateOnCallFrame(ErrorString&, const String& callFrameId, const String& _expression_, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Inspector::Protocol::OptOutput<bool>* wasThrown, Inspector::Protocol::OptOutput<int>* savedResultIndex) final;
     void setOverlayMessage(ErrorString&, const String*) override;
 
@@ -168,6 +169,7 @@
     bool m_javaScriptPauseScheduled { false };
     bool m_hasExceptionValue { false };
     bool m_didPauseStopwatch { false };
+    bool m_pauseOnAssertionFailures { false };
 };
 
 } // namespace Inspector

Modified: trunk/Source/_javascript_Core/inspector/protocol/Debugger.json (207443 => 207444)


--- trunk/Source/_javascript_Core/inspector/protocol/Debugger.json	2016-10-18 00:28:34 UTC (rev 207443)
+++ trunk/Source/_javascript_Core/inspector/protocol/Debugger.json	2016-10-18 00:36:12 UTC (rev 207444)
@@ -237,12 +237,19 @@
         },
         {
             "name": "setPauseOnExceptions",
+            "description": "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is <code>none</code>.",
             "parameters": [
                 { "name": "state", "type": "string", "enum": ["none", "uncaught", "all"], "description": "Pause on exceptions mode." }
-            ],
-            "description": "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is <code>none</code>."
+            ]
         },
         {
+            "name": "setPauseOnAssertions",
+            "description": "Set pause on assertions state. Assertions are console.assert assertions.",
+            "parameters": [
+                { "name": "enabled", "type": "boolean" }
+            ]
+        },
+        {
             "name": "evaluateOnCallFrame",
             "parameters": [
                 { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier to evaluate on." },

Modified: trunk/Source/WebInspectorUI/ChangeLog (207443 => 207444)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-10-18 00:28:34 UTC (rev 207443)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-10-18 00:36:12 UTC (rev 207444)
@@ -1,3 +1,35 @@
+2016-10-17  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Add toggles for debugger pauses at console.assert failures
+        https://bugs.webkit.org/show_bug.cgi?id=139542
+        <rdar://problem/19281600>
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Controllers/DebuggerManager.js:
+        (WebInspector.DebuggerManager.prototype.get assertionsBreakpoint):
+        (WebInspector.DebuggerManager.prototype.isBreakpointRemovable):
+        (WebInspector.DebuggerManager.prototype._breakpointDisabledStateDidChange):
+        New breakpoint and toggling behavior.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        * UserInterface/Views/DebuggerSidebarPanel.js:
+        (WebInspector.DebuggerSidebarPanel):
+        (WebInspector.DebuggerSidebarPanel.prototype._breakpointTreeOutlineDeleteTreeElement):
+        (WebInspector.DebuggerSidebarPanel.prototype._compareTopLevelTreeElements.isSpecialBreakpoint):
+        (WebInspector.DebuggerSidebarPanel.prototype._compareTopLevelTreeElements):
+        New breakpoint tree element behavior.
+
+        (WebInspector.DebuggerSidebarPanel.prototype.saveStateToCookie):
+        (WebInspector.DebuggerSidebarPanel.prototype.restoreStateFromCookie):
+        Sidebar restoration if it was selected.
+
+        * UserInterface/Images/Assertion.svg: Added.
+        * UserInterface/Images/gtk/Assertion.svg: Added.
+        * UserInterface/Views/BreakpointTreeElement.css:
+        (.breakpoint-assertion-icon .icon):
+        New sidebar icon for the global breakpoint.
+
 2016-10-15  Joseph Pecoraro  <pecor...@apple.com>
 
         Web Inspector: Cleanup parts of DebuggerManager

Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (207443 => 207444)


--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2016-10-18 00:28:34 UTC (rev 207443)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2016-10-18 00:36:12 UTC (rev 207444)
@@ -69,7 +69,6 @@
 localizedStrings["All Exceptions"] = "All Exceptions";
 localizedStrings["All Resources"] = "All Resources";
 localizedStrings["All Storage"] = "All Storage";
-localizedStrings["All Uncaught Exceptions"] = "All Uncaught Exceptions";
 localizedStrings["Alternates"] = "Alternates";
 localizedStrings["An error occurred trying to load the resource."] = "An error occurred trying to load the resource.";
 localizedStrings["An error occurred trying to read the “%s” table."] = "An error occurred trying to read the “%s” table.";
@@ -91,6 +90,7 @@
 localizedStrings["Assertion"] = "Assertion";
 localizedStrings["Assertion Failed"] = "Assertion Failed";
 localizedStrings["Assertion Failed: %s"] = "Assertion Failed: %s";
+localizedStrings["Assertion Failures"] = "Assertion Failures";
 localizedStrings["Assertion with message: %s"] = "Assertion with message: %s";
 localizedStrings["Assertive"] = "Assertive";
 localizedStrings["Attach"] = "Attach";
@@ -784,6 +784,7 @@
 localizedStrings["Type Issue"] = "Type Issue";
 localizedStrings["Type information for variable: %s"] = "Type information for variable: %s";
 localizedStrings["Unable to determine path to property from root"] = "Unable to determine path to property from root";
+localizedStrings["Uncaught Exceptions"] = "Uncaught Exceptions";
 localizedStrings["Unchanged"] = "Unchanged";
 localizedStrings["Uncomment All Properties"] = "Uncomment All Properties";
 localizedStrings["Unique"] = "Unique";

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js (207443 => 207444)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js	2016-10-18 00:28:34 UTC (rev 207443)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js	2016-10-18 00:36:12 UTC (rev 207444)
@@ -47,6 +47,7 @@
 
         this._allExceptionsBreakpointEnabledSetting = new WebInspector.Setting("break-on-all-exceptions", false);
         this._allUncaughtExceptionsBreakpointEnabledSetting = new WebInspector.Setting("break-on-all-uncaught-exceptions", false);
+        this._assertionsBreakpointEnabledSetting = new WebInspector.Setting("break-on-assertions", false);
 
         let specialBreakpointLocation = new WebInspector.SourceCodeLocation(null, Infinity, Infinity);
 
@@ -54,6 +55,9 @@
         this._allExceptionsBreakpoint.resolved = true;
 
         this._allUncaughtExceptionsBreakpoint = new WebInspector.Breakpoint(specialBreakpointLocation, !this._allUncaughtExceptionsBreakpointEnabledSetting.value);
+        
+        this._assertionsBreakpoint = new WebInspector.Breakpoint(specialBreakpointLocation, !this._assertionsBreakpointEnabledSetting.value);
+        this._assertionsBreakpoint.resolved = true;
 
         this._breakpoints = [];
         this._breakpointContentIdentifierMap = new Map;
@@ -85,6 +89,10 @@
 
         this._updateBreakOnExceptionsState();
 
+        // COMPATIBILITY (iOS 10): DebuggerAgent.setPauseOnAssertions did not exist yet.
+        if (DebuggerAgent.setPauseOnAssertions)
+            DebuggerAgent.setPauseOnAssertions(this._assertionsBreakpointEnabledSetting.value);
+
         this._ignoreBreakpointDisplayLocationDidChangeEvent = false;
 
         function restoreBreakpointsSoon() {
@@ -146,6 +154,11 @@
         return this._allUncaughtExceptionsBreakpoint;
     }
 
+    get assertionsBreakpoint()
+    {
+        return this._assertionsBreakpoint;
+    }
+
     get breakpoints()
     {
         return this._breakpoints;
@@ -186,7 +199,9 @@
 
     isBreakpointRemovable(breakpoint)
     {
-        return breakpoint !== this._allExceptionsBreakpoint && breakpoint !== this._allUncaughtExceptionsBreakpoint;
+        return breakpoint !== this._allExceptionsBreakpoint
+            && breakpoint !== this._allUncaughtExceptionsBreakpoint
+            && breakpoint !== this._assertionsBreakpoint;
     }
 
     isBreakpointEditable(breakpoint)
@@ -849,6 +864,14 @@
             return;
         }
 
+        if (breakpoint === this._assertionsBreakpoint) {
+            if (!breakpoint.disabled && !this.breakpointsDisabledTemporarily)
+                this.breakpointsEnabled = true;
+            this._assertionsBreakpointEnabledSetting.value = !breakpoint.disabled;
+            DebuggerAgent.setPauseOnAssertions(this._assertionsBreakpointEnabledSetting.value);
+            return;
+        }
+
         if (breakpoint.disabled)
             this._removeBreakpoint(breakpoint);
         else

Added: trunk/Source/WebInspectorUI/UserInterface/Images/Assertion.svg (0 => 207444)


--- trunk/Source/WebInspectorUI/UserInterface/Images/Assertion.svg	                        (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/Assertion.svg	2016-10-18 00:36:12 UTC (rev 207444)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright © 2016 Apple Inc. All rights reserved. -->
+<svg xmlns="http://www.w3.org/2000/svg" id="root" version="1.1" viewBox="0 0 16 16">
+    <path fill="rgb(148, 183, 219)" d="M 13 1 L 3 1 C 1.898438 1 1 1.898438 1 3 L 1 13 C 1 14.101562 1.898438 15 3 15 L 13 15 C 14.101562 15 15 14.101562 15 13 L 15 3 C 15 1.898438 14.101562 1 13 1 Z"/>
+    <path fill="rgb(106, 136, 170)" d="M 13 1 L 3 1 C 1.898438 1 1 1.898438 1 3 L 1 13 C 1 14.101562 1.898438 15 3 15 L 13 15 C 14.101562 15 15 14.101562 15 13 L 15 3 C 15 1.898438 14.101562 1 13 1 M 13 2 C 13.550781 2 14 2.449219 14 3 L 14 13 C 14 13.550781 13.550781 14 13 14 L 3 14 C 2.449219 14 2 13.550781 2 13 L 2 3 C 2 2.449219 2.449219 2 3 2 L 13 2"/>
+    <path fill="rgb(113, 146, 184)" d="M 2.61147641 12.75 L 5.96029528 12.75 L 6.8114662 10.628418 L 8.70346974 10.628418 L 9.53482191 12.75 L 13.3777814 12.75 L 9.50565303 2.80078125 L 6.48360478 2.80078125 L 2.61147641 12.75 Z M 2.61147641 12.75"/>
+    <path fill="white" d="M 4.07373047 11.75 L 7.16748047 3.80078125 L 8.82177734 3.80078125 L 11.9155273 11.75 L 10.2182617 11.75 L 9.39111328 9.62841797 L 6.10400391 9.62841797 L 5.27685547 11.75 L 4.07373047 11.75 Z M 6.51220703 8.5703125 L 8.98291016 8.5703125 L 7.74755859 5.40136719 L 6.51220703 8.5703125 Z M 6.51220703 8.5703125"/>
+</svg>

Added: trunk/Source/WebInspectorUI/UserInterface/Images/gtk/Assertion.svg (0 => 207444)


--- trunk/Source/WebInspectorUI/UserInterface/Images/gtk/Assertion.svg	                        (rev 0)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/gtk/Assertion.svg	2016-10-18 00:36:12 UTC (rev 207444)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed under the Creative Commons Attribution-Share Alike 3.0 United States License (http://creativecommons.org/licenses/by-sa/3.0/) -->
+<svg xmlns="http://www.w3.org/2000/svg" id="root" version="1.1" viewBox="0 0 16 16">
+ <defs>
+  <linearGradient id="d" x1="491.22" x2="491.22" y1="506.65" y2="732.05" gradientUnits="userSpaceOnUse" gradientTransform="matrix(.093294 0 0 .093294 -35.871 -43.769)">
+   <stop stop-color="#204a87" offset="0"/>
+   <stop stop-color="#bdd2e9" offset="1"/>
+  </linearGradient>
+  <radialGradient id="b" cx="301" cy="51.5" r="19.5" gradientUnits="userSpaceOnUse" gradientTransform="matrix(.97063 1.9684e-8 0 .28611 -291.16 -14.63)">
+   <stop stop-color="#fff" offset="0"/>
+   <stop stop-color="#fff" stop-opacity="0" offset="1"/>
+  </radialGradient>
+  <radialGradient id="a" cx="24.446" cy="35.878" r="20.531" gradientUnits="userSpaceOnUse" gradientTransform="matrix(.85696 3.2529e-7 -1.253e-7 .33010 -12.949 .77181)">
+   <stop stop-color="#fff" offset="0"/>
+   <stop stop-color="#cbdbed" offset="1"/>
+  </radialGradient>
+  <linearGradient id="c" x1="321.57" x2="311.65" y1="145.52" y2="118.5" gradientUnits="userSpaceOnUse" gradientTransform="matrix(.55569 0 0 .55568 -169.27 -70.906)">
+   <stop stop-color="#204a87" offset="0"/>
+   <stop stop-color="#bdd2e9" offset="1"/>
+  </linearGradient>
+ </defs>
+ <rect width="15.004" height="15.003" x=".49815" y=".49833" fill="url(#a)" fill-rule="evenodd" stroke="url(#c)" stroke-miterlimit="10" rx="1.5143" ry="1.5143" stroke-linejoin="bevel"/>
+ <rect width="12.997" height="13" x="1.5014" y="1.5016" fill="none" stroke="#fff" stroke-miterlimit="10" ry=".50810" stroke-linejoin="bevel" rx=".50812"/>
+ <rect width="14" height="14" x="1.0017" y="1.0016" fill="url(#b)" fill-rule="evenodd" rx="1.9062" ry="1.9062"/>
+ <path fill="#fff" d="m7.1374 4.8508c-0.03291 0.00406-0.06499 0.014755-0.09375 0.03125-0.01131 0.00947-0.02178 0.019939-0.03125 0.03125-0.01327 0.019236-0.02382 0.040343-0.03125 0.0625-0.01131 0.00947-0.02178 0.019939-0.03125 0.03125l-3 8a0.25002 0.25002 0 0 0 0 0.0625 0.25002 0.25002 0 0 0 0 0.0625 0.25002 0.25002 0 0 0 0 0.0625 0.25002 0.25002 0 0 0 0.03125 0.03125 0.25002 0.25002 0 0 0 0.09375 0.09375 0.25002 0.25002 0 0 0 0.125 0.03125h1.375a0.25002 0.25002 0 0 0 0.03125 0 0.25002 0.25002 0 0 0 0.03125 0 0.25002 0.25002 0 0 0 0.09375 -0.0625 0.25002 0.25002 0 0 0 0.03125 -0.03125 0.25002 0.25002 0 0 0 0.03125 -0.0625l0.75-1.9375h2.5938l0.75 1.9375a0.25002 0.25002 0 0 0 0 0.03125 0.25002 0.25002 0 0 0 0.0625 0.0625 0.25002 0.25002 0 0 0 0.0625 0.03125 0.25002 0.25002 0 0 0 0.09375 0.03125h1.4688a0.25002 0.25002 0 0 0 0.03125 0 0.25002 0.25002 0 0 0 0.0625 -0.03125 0.25002 0.25002 0 0 0 0.0625 -0.03125 0.25002 0.25002 0 0 0 0.03125 -0.03125 0.25002 0.2500
 2 0 0 0 0.0625 -0.125 0.25002 0.25002 0 0 0 0 -0.03125 0.25002 0.25002 0 0 0 0 -0.0625 0.25002 0.25002 0 0 0 0 -0.03125l-3-8a0.25002 0.25002 0 0 0 -0.03125 -0.03125 0.25002 0.25002 0 0 0 -0.03125 -0.03125 0.25002 0.25002 0 0 0 0 -0.03125 0.25002 0.25002 0 0 0 -0.03125 -0.03125 0.25002 0.25002 0 0 0 -0.0625 -0.03125 0.25002 0.25002 0 0 0 -0.03125 0 0.25002 0.25002 0 0 0 -0.0625 0h-1.375c-0.02072-0.00261-0.04178-0.00261-0.0625 0zm0.6875 2.6562 0.6875 1.9375h-1.3438l0.65625-1.9375z" display="block"/>
+ <path fill="url(#d)" d="m7.1892 3.8205c-0.03291 0.00406-0.06499 0.014755-0.09375 0.03125-0.01131 0.00947-0.02178 0.019939-0.03125 0.03125-0.01327 0.019236-0.02382 0.040343-0.03125 0.0625-0.01131 0.00947-0.02178 0.019939-0.03125 0.03125l-3 8a0.25002 0.25002 0 0 0 0 0.0625 0.25002 0.25002 0 0 0 0 0.0625 0.25002 0.25002 0 0 0 0 0.0625 0.25002 0.25002 0 0 0 0.03125 0.03125 0.25002 0.25002 0 0 0 0.09375 0.09375 0.25002 0.25002 0 0 0 0.125 0.03125h1.375a0.25002 0.25002 0 0 0 0.03125 0 0.25002 0.25002 0 0 0 0.03125 0 0.25002 0.25002 0 0 0 0.09375 -0.0625 0.25002 0.25002 0 0 0 0.03125 -0.03125 0.25002 0.25002 0 0 0 0.03125 -0.0625l0.75-1.9375h2.5938l0.75 1.9375a0.25002 0.25002 0 0 0 0 0.03125 0.25002 0.25002 0 0 0 0.0625 0.0625 0.25002 0.25002 0 0 0 0.0625 0.03125 0.25002 0.25002 0 0 0 0.09375 0.03125h1.4688a0.25002 0.25002 0 0 0 0.03125 0 0.25002 0.25002 0 0 0 0.0625 -0.03125 0.25002 0.25002 0 0 0 0.0625 -0.03125 0.25002 0.25002 0 0 0 0.03125 -0.03125 0.25002 0.2
 5002 0 0 0 0.0625 -0.125 0.25002 0.25002 0 0 0 0 -0.03125 0.25002 0.25002 0 0 0 0 -0.0625 0.25002 0.25002 0 0 0 0 -0.03125l-3.0003-8.0002a0.25002 0.25002 0 0 0 -0.03125 -0.03125 0.25002 0.25002 0 0 0 -0.03125 -0.03125 0.25002 0.25002 0 0 0 0 -0.03125 0.25002 0.25002 0 0 0 -0.03125 -0.03125 0.25002 0.25002 0 0 0 -0.0625 -0.03125 0.25002 0.25002 0 0 0 -0.03125 0 0.25002 0.25002 0 0 0 -0.0625 0h-1.375c-0.02072-0.00261-0.04178-0.00261-0.0625 0zm0.6875 2.6562 0.6875 1.9375h-1.3438l0.65625-1.9375z" display="block"/>
+</svg>

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.css (207443 => 207444)


--- trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.css	2016-10-18 00:28:34 UTC (rev 207443)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.css	2016-10-18 00:36:12 UTC (rev 207444)
@@ -50,6 +50,10 @@
     content: url(../Images/Exception.svg);
 }
 
+.breakpoint-assertion-icon .icon {
+    content: url(../Images/Assertion.svg);
+}
+
 .breakpoint-paused-icon .icon {
     content: url(../Images/PausedBreakpoint.svg);
 }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js (207443 => 207444)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js	2016-10-18 00:28:34 UTC (rev 207443)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js	2016-10-18 00:36:12 UTC (rev 207444)
@@ -107,9 +107,11 @@
         this.element.classList.add(WebInspector.DebuggerSidebarPanel.OffsetSectionsStyleClassName);
 
         this._allExceptionsBreakpointTreeElement = new WebInspector.BreakpointTreeElement(WebInspector.debuggerManager.allExceptionsBreakpoint, WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName, WebInspector.UIString("All Exceptions"));
-        this._allUncaughtExceptionsBreakpointTreeElement = new WebInspector.BreakpointTreeElement(WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint, WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName, WebInspector.UIString("All Uncaught Exceptions"));
-        this.suppressFilteringOnTreeElements([this._allExceptionsBreakpointTreeElement, this._allUncaughtExceptionsBreakpointTreeElement]);
+        this._allUncaughtExceptionsBreakpointTreeElement = new WebInspector.BreakpointTreeElement(WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint, WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName, WebInspector.UIString("Uncaught Exceptions"));
+        this._assertionsBreakpointTreeElement = new WebInspector.BreakpointTreeElement(WebInspector.debuggerManager.assertionsBreakpoint, WebInspector.DebuggerSidebarPanel.AssertionIconStyleClassName, WebInspector.UIString("Assertion Failures"));
 
+        this.suppressFilteringOnTreeElements([this._allExceptionsBreakpointTreeElement, this._allUncaughtExceptionsBreakpointTreeElement, this._assertionsBreakpointTreeElement]);
+
         this.filterBar.placeholder = WebInspector.UIString("Filter List");
 
         function showResourcesWithIssuesOnlyFilterFunction(treeElement)
@@ -150,6 +152,10 @@
         this._breakpointsContentTreeOutline.appendChild(this._allExceptionsBreakpointTreeElement);
         this._breakpointsContentTreeOutline.appendChild(this._allUncaughtExceptionsBreakpointTreeElement);
 
+        // COMPATIBILITY (iOS 10): DebuggerAgent.setPauseOnAssertions did not exist yet.
+        if (DebuggerAgent.setPauseOnAssertions)
+            this._breakpointsContentTreeOutline.appendChild(this._assertionsBreakpointTreeElement);
+
         this._scriptsContentTreeOutline = this.createContentTreeOutline(true);
         this._scriptsContentTreeOutline.addEventListener(WebInspector.TreeOutline.Event.SelectionDidChange, this._treeSelectionDidChange, this);
 
@@ -281,6 +287,11 @@
             return;
         }
 
+        if (representedObject === WebInspector.debuggerManager.assertionsBreakpoint) {
+            cookie[WebInspector.DebuggerSidebarPanel.SelectedAssertionsCookieKey] = true;
+            return;
+        }
+
         super.saveStateToCookie(cookie);
     }
 
@@ -293,6 +304,8 @@
             this._allExceptionsBreakpointTreeElement.revealAndSelect();
         else if (cookie[WebInspector.DebuggerSidebarPanel.SelectedAllUncaughtExceptionsCookieKey])
             this._allUncaughtExceptionsBreakpointTreeElement.revealAndSelect();
+        else if (cookie[WebInspector.DebuggerSidebarPanel.SelectedAssertionsCookieKey])
+            this._assertionsBreakpointTreeElement.revealAndSelect();
         else
             super.restoreStateFromCookie(cookie, relaxedMatchDelay);
     }
@@ -691,7 +704,7 @@
         if (!(treeElement instanceof WebInspector.ResourceTreeElement) && !(treeElement instanceof WebInspector.ScriptTreeElement))
             return false;
 
-        var wasTopResourceTreeElement = treeElement.previousSibling === this._allUncaughtExceptionsBreakpointTreeElement;
+        var wasTopResourceTreeElement = treeElement.previousSibling === this._assertionsBreakpointTreeElement || treeElement.previousSibling === this._allUncaughtExceptionsBreakpointTreeElement;
         var nextSibling = treeElement.nextSibling;
 
         var breakpoints = this._breakpointsBeneathTreeElement(treeElement);
@@ -774,7 +787,9 @@
     {
         function isSpecialBreakpoint(treeElement)
         {
-            return treeElement.representedObject === WebInspector.debuggerManager.allExceptionsBreakpoint || treeElement.representedObject === WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint;
+            return treeElement.representedObject === WebInspector.debuggerManager.allExceptionsBreakpoint
+                || treeElement.representedObject === WebInspector.debuggerManager.allUncaughtExceptionsBreakpoint
+                || treeElement.representedObject === WebInspector.debuggerManager.assertionsBreakpoint;
         }
 
         if (isSpecialBreakpoint(a))
@@ -955,7 +970,9 @@
 
 WebInspector.DebuggerSidebarPanel.DebuggerPausedStyleClassName = "paused";
 WebInspector.DebuggerSidebarPanel.ExceptionIconStyleClassName = "breakpoint-exception-icon";
+WebInspector.DebuggerSidebarPanel.AssertionIconStyleClassName = "breakpoint-assertion-icon";
 WebInspector.DebuggerSidebarPanel.PausedBreakpointIconStyleClassName = "breakpoint-paused-icon";
 
 WebInspector.DebuggerSidebarPanel.SelectedAllExceptionsCookieKey = "debugger-sidebar-panel-all-exceptions-breakpoint";
 WebInspector.DebuggerSidebarPanel.SelectedAllUncaughtExceptionsCookieKey = "debugger-sidebar-panel-all-uncaught-exceptions-breakpoint";
+WebInspector.DebuggerSidebarPanel.SelectedAssertionsCookieKey = "debugger-sidebar-panel-assertions-breakpoint";
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to