Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #35 from fflorent/issue5639

FBTests for Issue5639
  • Loading branch information...
commit 8f0a4d52c5c4ee9395c427637248561478076072 2 parents 70ed3a6 + 0e9c5a9
@janodvarko janodvarko authored
View
4 extension/content/firebug/js/watchPanel.js
@@ -391,7 +391,7 @@ Firebug.WatchPanel.prototype = Obj.extend(Firebug.DOMBasePanel.prototype,
if (!this.watches || this.watches.length == 0)
return items;
- // find the index of "DeleteWatch" in the items:
+ // find the index of "DeletePropery" in the items:
var deleteWatchIndex = items.map(function(item)
{
return item.id;
@@ -406,7 +406,7 @@ Firebug.WatchPanel.prototype = Obj.extend(Firebug.DOMBasePanel.prototype,
// insert DeleteAllWatches after DeleteWatch
items.splice(deleteAllWatchesIndex, 0, {
- id: "deleteAllWatches",
+ id: "fbDeleteAllWatches",
label: "DeleteAllWatches",
tooltiptext: "watch.tip.Delete_All_Watches",
command: Obj.bindFixed(this.deleteAllWatches, this)
View
20 tests/FBTest/content/FBTestFirebug.js
@@ -264,29 +264,29 @@ this.manualVerify = function(verifyMsg, instructions)
// ********************************************************************************************* //
// Event automation
-this.click = function(node)
+this.click = function(node, win)
{
- this.sendMouseEvent({type: "click"}, node);
+ this.sendMouseEvent({type: "click"}, node, win);
};
-this.dblclick = function(node)
+this.dblclick = function(node, win)
{
- this.sendMouseEvent({type: "click", detail: 2}, node);
+ this.sendMouseEvent({type: "click", detail: 2}, node, win);
};
-this.rightClick = function(node)
+this.rightClick = function(node, win)
{
- this.sendMouseEvent({type: "click", button: 2}, node);
+ this.sendMouseEvent({type: "click", button: 2}, node, win);
};
-this.mouseDown = function(node)
+this.mouseDown = function(node, win)
{
- this.sendMouseEvent({type: "mousedown"}, node);
+ this.sendMouseEvent({type: "mousedown"}, node, win);
};
-this.mouseUp = function(node)
+this.mouseUp = function(node, win)
{
- this.sendMouseEvent({type: "mouseup"}, node);
+ this.sendMouseEvent({type: "mouseup"}, node, win);
};
this.mouseOver = function(node, offsetX, offsetY)
View
1  tests/content/firebug.html
@@ -267,6 +267,7 @@
{group: "script/watch", uri: "script/watch/5009/issue5009.js", desc: "Watch side panel shows \"Command line closed?\"", testPage: "script/watch/5009/issue5009.html"},
{group: "script/watch", uri: "script/watch/5019/issue5019.js", desc: "Editing a variable in the Watch window doesn't work", testPage: "script/watch/5019/issue5019.html"},
{group: "script/watch", uri: "script/watch/5336/issue5336.js", desc: "HTMLCollection object is undefined in the Script panel", testPage: "script/watch/5336/issue5336.html"},
+ {group: "script/watch", uri: "script/watch/5639/issue5639.js", desc: "Allow deleting all watch expressions at once", testPage: "script/watch/5639/issue5639.html"},
{group: "dom", uri: "dom/attributes/attributes.js", desc: "Better DOM representation for element attributes", testPage: "dom/attributes/attributes.html" },
{group: "dom", uri: "dom/breakpoints/breakOnProperty.js", desc: "Break on property change", testPage: "dom/breakpoints/breakOnProperty.html" },
{group: "dom", uri: "dom/breakpoints/breakOnGlobalProperty.js",desc: "Break on global property change", testPage: "dom/breakpoints/breakOnGlobalProperty.html" },
View
39 tests/content/script/watch/5639/issue5639.html
@@ -0,0 +1,39 @@
+
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Issue 5639: Allow deleting all watch expressions at once</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ <link href="../../../_common/testcase.css" type="text/css" rel="stylesheet"/>
+ </head>
+ <body>
+ <header>
+ <h1><a href="http://code.google.com/p/fbug/issues/detail?id=5639">Issue 5639</a>: Allow deleting all watch expressions at once</h1>
+ </header>
+ <div>
+ <section id="content">
+ <script>
+ var a = 1, b = 2;
+ </script>
+ </section>
+ <section id="description">
+ <ol>
+ <li>Open Firebug</li>
+ <li>Enable and switch to the <em>script</em> panel</li>
+ <li>Switch to the <em>Watch</em> side panel</li>
+ <li>Add this watch expression (without the quotes): "a"</li>
+ <li>Add this watch expression: "b"</li>
+ <li>Right click on the "a" watch expression and click on "Delete All Watches"</li>
+ <li>Every watch should be removed</li>
+ <li>Redo steps 4 and 5</li>
+ <li>Right click on an empty space of the <em>Watch</em> panel</li>
+ <li>Click on "Delete All Watches"</li>
+ <li>Every watch should be removed</li>
+ </ol>
+ </section>
+ <footer>
+ &lt;Florent FAYOLLE&gt;, <span id="email">&lt;florent.fayolle69@gmail.com&gt;</span>
+ </footer>
+ </div>
+ </body>
+</html>
View
57 tests/content/script/watch/5639/issue5639.js
@@ -0,0 +1,57 @@
+function runTest()
+{
+ FBTest.sysout("issue5639.START");
+ FBTest.openNewTab(basePath + "script/watch/5639/issue5639.html", function(win)
+ {
+ FBTest.openFirebug();
+ FBTest.enableScriptPanel(function(win)
+ {
+ FBTest.selectPanel("script");
+ var panelNode = FBTest.selectSidePanel("watches").panelNode;
+ var watchExpressions = ["a", "b"];
+ var tasks = new FBTest.TaskList();
+ // click on a watch expression:
+ tasks.push(testDeleteAllWatches, panelNode, ".memberValueCell", watchExpressions);
+ // click on the watch edition area
+ tasks.push(testDeleteAllWatches, panelNode, ".watchEditCell", watchExpressions);
+
+ tasks.run(function()
+ {
+ FBTest.testDone("issue5639.DONE");
+ });
+ });
+ });
+}
+
+function countWatches(panelNode)
+{
+ return panelNode.getElementsByClassName("memberValueCell").length;
+}
+
+function testDeleteAllWatches(callback, panelNode, targetSelector, watchExpressions)
+{
+ addWatches(watchExpressions.slice(0), function()
+ {
+ FBTest.compare(watchExpressions.length, countWatches(panelNode), "all the watches must be added");
+ var target = panelNode.querySelector(targetSelector);
+ FBTest.executeContextMenuCommand(target, "fbDeleteAllWatches", function()
+ {
+ FBTest.compare(0, countWatches(panelNode), "There should not be any watch");
+ callback();
+ });
+ });
+}
+
+function addWatches(watchExpressions, callback)
+{
+ if (watchExpressions.length > 0)
+ {
+ FBTest.addWatchExpression(null, watchExpressions.pop(), function()
+ {
+ addWatches(watchExpressions, callback);
+ });
+ }
+ else
+ callback();
+}
+
Please sign in to comment.
Something went wrong with that request. Please try again.