[Pkg-mozext-commits] [firebug] 02/48: FBTest for issue 7470: Breakpoint conditions are disregarded.

David Prévot taffit at moszumanska.debian.org
Tue Jun 3 01:47:42 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository firebug.

commit f725eb871cf2a055f4090c7d0df9b4bc375de73e
Author: Farshid Beheshti <farshid.beheshti at gmail.com>
Date:   Sat May 24 21:53:21 2014 +0430

    FBTest for issue 7470: Breakpoint conditions are disregarded.
---
 tests/content/firebug.html                         |  1 +
 .../content/script/breakpoints/7470/issue7470.html | 44 ++++++++++++++
 tests/content/script/breakpoints/7470/issue7470.js | 71 ++++++++++++++++++++++
 3 files changed, 116 insertions(+)

diff --git a/tests/content/firebug.html b/tests/content/firebug.html
index 2d8443a..a4b7415 100644
--- a/tests/content/firebug.html
+++ b/tests/content/firebug.html
@@ -361,6 +361,7 @@ var testList = [
     {group: "script/breakpoints", uri: "script/breakpoints/7295/issue7295.js",    desc: "Detaching and attaching backend thread without page-reload disables breakpoints", testPage: "script/breakpoints/7295/issue7295.html" },
     {group: "script/breakpoints", uri: "script/breakpoints/7372/issue7372.js",    desc: "Turning off 'Log Calls' for a line hides breakpoints on that line", testPage: "script/breakpoints/7372/issue7372.html" },
     {group: "script/breakpoints", uri: "script/breakpoints/7373/issue7373.js",    desc: "Debugger breaks on monitored functions", testPage: "script/breakpoints/7373/issue7373.html" },
+    {group: "script/breakpoints", uri: "script/breakpoints/7470/issue7470.js",    desc: "Issue 7470: Breakpoint conditions are disregarded", testPage: "script/breakpoints/7470/issue7470.html"},
     {group: "script/callstack",   uri: "script/callstack/1811/issue1811.js",      desc: "Issue 1811: Add prettyName/displayName support to Profiler output and Stacks", testPage: "script/callstack/1811/issue1811.html"},
     {group: "script/callstack",   uri: "script/callstack/3596/issue3596.js",      desc: "Issue 3596: Stack trace forgets where it is", testPage: "script/callstack/3596/issue3596.html"},
     {group: "script/callstack",   disabled: "See issue 6789", uri: "script/callstack/3645/issue3645.js",      desc: "Issue 3645: _firebugRerun and friends need to be elided from the panel status path", testPage: "script/callstack/3645/issue3645.html"},
diff --git a/tests/content/script/breakpoints/7470/issue7470.html b/tests/content/script/breakpoints/7470/issue7470.html
new file mode 100644
index 0000000..19562f8
--- /dev/null
+++ b/tests/content/script/breakpoints/7470/issue7470.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <title>Issue 7470: Breakpoint conditions are disregarded</title>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+        <link href="../../../_common/testcase.css" type="text/css" rel="stylesheet"/>
+        <script type="text/javascript">
+            function logIt() {
+                console.log('A call to console.log() API');
+            };
+        </script>
+    </head>
+    <body>
+        <header>
+            <h1>
+                <a href="https://code.google.com/p/fbug/issues/detail?id=7470">Issue 7470</a>: Breakpoint conditions are disregarded.
+            </h1>
+        </header>
+        <div>
+            <section id="description">
+                <h3>Steps to reproduce</h3>
+                <ol>
+                    <li>Open Firebug</li>
+                    <li>Switch to the <em>Script</em> panel and enable it.</li>
+                    <li>Right click on the breakpoint column at line #9
+                        (<code> console.log('A call to console.log() API'); </code>)
+                        <br />
+                        <span class="ok">=> The condition editor should appear.</span>
+                    </li>
+                    <li>Type <em>false</em> in the editor and hit the enter/return key.</li>
+                    <li>Click the <em>log It</em> button
+                        <button id="btnLogIt" onclick="logIt();">Log it</button>
+                        <br />
+                    </li>
+                </ol>
+                <h3>Expected result</h3>
+                <ul>
+                    <li>The conditional breakpoint, at line #9, must <b>not</b> get hit.</li>
+                </ul>
+            </section>
+            <footer>@farshidbeheshti, farshid.beheshti at gmail.com</footer>
+        </div>
+    </body>
+</html>
diff --git a/tests/content/script/breakpoints/7470/issue7470.js b/tests/content/script/breakpoints/7470/issue7470.js
new file mode 100644
index 0000000..f259b9d
--- /dev/null
+++ b/tests/content/script/breakpoints/7470/issue7470.js
@@ -0,0 +1,71 @@
+function runTest()
+{
+    FBTest.openNewTab(basePath + "script/breakpoints/7470/issue7470.html", (win) =>
+    {
+        FBTest.enableScriptPanel((win) =>
+        {
+            FBTest.setBreakpoint(null, "issue7470.html", 9, null, (row) =>
+            {
+                // Open the condition editor.
+                var target = row.querySelector(".CodeMirror-linenumber");
+                var event = {type: "mousedown", button: 2};
+                FBTest.synthesizeMouse(target, 2, 2, event);
+                var scriptPanel = FBTest.selectPanel("script");
+                var conditionEditor = scriptPanel.panelNode.
+                    querySelector(".conditionEditor");
+
+                // Just a bit(zero-length) dealay to make sure the
+                // condition editor is fully loaded.
+                justDelay(() =>
+                {
+                    FBTest.ok(conditionEditor, "The condition editor must be opened.");
+
+                    // Type 'false' in the editor and hit the enter key.
+                    var editorInput = conditionEditor.querySelector(".completionInput");
+                    editorInput.value = 'false';
+                    FBTest.ok(editorInput, "Enter 'false' in the editor");
+
+                    // Focus the editor to make sure it's selected before
+                    // hitting the key enter.
+                    FBTest.focus(editorInput);
+                    FBTest.synthesizeKey("VK_RETURN", null, win);
+                    FBTest.progress("Press the enter key to close the condition editor.");
+
+                    var debuggerBreakIn = false;
+                    FBTest.waitForBreakInDebugger(null, 9, true, () =>
+                    {
+                        debuggerBreakIn = true;
+                        FBTest.clickContinueButton();
+                    });
+                    
+                    // Another delay to make sure the breakpoint is set and
+                    // the editor is closed.
+                    justDelay(() =>
+                    {
+                        // Call the event handler.
+                        FBTest.clickContentButton(win, "btnLogIt");
+                    });
+
+                    // Wait for a 300 milliseconds to make sure the debugger
+                    // doesn't break on the condition editor when it doesn't
+                    // meet the condition.
+                    var timeOut = setTimeout(() =>
+                    {
+                        FBTest.ok(!debuggerBreakIn, "The debugger must not break at the " +
+                            "line #9 when it doesn't meet the condition");
+                        FBTest.removeBreakpoint(null, "issue7470.html", 9, () =>
+                        {
+                            FBTest.testDone();
+                        });
+                    }, 300);
+                });
+
+                function justDelay(callback)
+                {
+                    setTimeout(callback);
+                }
+
+            });
+        });
+    });
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git



More information about the Pkg-mozext-commits mailing list