Permalink
Browse files

Merge pull request #17 from FarshidB/Test-Issue4153

test case for issue 4153
  • Loading branch information...
2 parents 9fd376a + 8d66d58 commit d5e7f9c16b4d1a0ad629c3b7b131e3ddf5614dc2 @janodvarko janodvarko committed Jul 10, 2012
Showing with 113 additions and 2 deletions.
  1. +3 −2 tests/content/firebug.html
  2. +34 −0 tests/content/firebug/4153/issue4153.html
  3. +76 −0 tests/content/firebug/4153/issue4153.js
View
5 tests/content/firebug.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
@@ -56,7 +56,8 @@
{group: "firebug", uri: "firebug/selectedPanelAfterReopen.js", desc: "Selected panel should be still selected if Firebug UI is reopened.", testPage: "firebug/OpenFirebugOnThisPage.html"},
{group: "firebug", uri: "firebug/viralActivation.js", desc: "Links from active pages should be active", testPage: "firebug/OpenFirebugOnThisPage.html" },
{group: "firebug", uri: "firebug/2613/issue2613.js", desc: "HTML, CSS, and DOM panels do not display on reload.", testPage: "firebug/2613/issue2613.html" },
- {group: "firebug", uri: "firebug/4040/issue4040.js", desc: "Switching to a about:blank page does not update the panels", testPage: "firebug/4040/issue4040.html" },
+ { group: "firebug", uri: "firebug/4040/issue4040.js", desc: "Switching to a about:blank page does not update the panels", testPage: "firebug/4040/issue4040.html" },
+ { group: "firebug", uri: "firebug/4153/issue4153.js", desc: "Re-attaching detached, deactivated Firebug UI doesn't close it", testPage: "firebug/4153/issue4153.html" },
{group: "firebug", uri: "firebug/4553/issue4553.js", desc: "iframe should be content-primary", testPage: "firebug/4553/issue4553.html" },
{group: "firebug", uri: "firebug/5349/issue5349.js", desc: "Context menu in select, radio, check, not work", testPage: "firebug/5349/issue5349.html" },
{group: "firebug", uri: "firebug/5526/issue5526.js", desc: "Open Firebug in detached mode when it was minimized in detached mode", testPage: "firebug/5526/issue5526.html" },
View
34 tests/content/firebug/4153/issue4153.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+ <head>
+ <title>Issue 4153: Re-attaching detached, deactivated Firebug UI doesn't close it</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ <link href="https://getfirebug.com/tests/head/_common/testcase.css" type="text/css" rel="stylesheet"/>
+ </head>
+ <body>
+ <header>
+ <h1><a href="http://code.google.com/p/fbug/issues/detail?id=4153">Issue 4153</a>: Re-attaching detached, deactivated Firebug UI doesn't close it</h1>
+ </header>
+ <div>
+ <section id="content">
+ </section>
+ <section id="description">
+ <h3>Steps to reproduce</h3>
+ <ol>
+ <li>Open Firebug in detached mode on this page.</li>
+ <li>Deactivate firebug by Selecting "Deactivate Firebug" from the menu or by pressing Shift+F12.</li>
+ <li>Press Ctrl + F12 to attach Firebug to the main window.</li>
+ </ol>
+ <h3>Observed result</h3>
+ <ul>
+ <li>Firebug opens in browser with blank panel.</li>
+ </ul>
+ <h3>Expected result</h3>
+ <ul>
+ <li>Firebug must be activated before attaching to the main window.</li>
+ </ul>
+ </section>
+ <footer>Farshid Beheshti, Farshid.Beheshti@gmail.com</footer>
+ </div>
+ </body>
+</html>
View
76 tests/content/firebug/4153/issue4153.js
@@ -0,0 +1,76 @@
+function runTest()
+{
+ FBTest.sysout("issue4153.START");
+ FBTest.openNewTab(basePath + "firebug/4153/issue4153.html", function (win)
+ {
+ detachFirebug(function (win)
+ {
+ FBTest.ok(FBTest.isDetached(), "Firebug must be detached now.");
+ deactiveFirebug(function ()
+ {
+ FBTest.ok(isDeactive(), "Firebug must be deactivated now.");
+ toggleDetachBar(function ()
+ {
+ FBTest.ok(!(FBTest.isDetached() && isDeactive()),
+ "Firebug must be activated and also attached to the main window now.");
+ FBTest.testDone("issue4153.DONE");
+ });
+ });
+ });
+ });
+}
+
+function detachFirebug(callback)
+{
+ var detachedWindow = FBTest.detachFirebug();
+ if (FBTest.ok(detachedWindow, "Firebug is detaching ....."))
+ {
+ FBTest.OneShotHandler(detachedWindow, "load", function (event)
+ {
+ FBTest.progress("Firebug detached in a new window.");
+ setTimeout(function ()
+ {
+ callback(detachedWindow);
+ });
+ });
+ }
+}
+
+function toggleDetachBar(callback)
+{
+ FW.Firebug.toggleDetachBar(false, true);
+ if (FBTest.ok(!FBTest.isDetached(), "Firebug is attached to the main window."))
+ {
+ setTimeout(function ()
+ {
+ callback();
+ });
+ }
+ else
+ {
+ FBTest.testDone("issue4153.FAILED.");
+ return;
+ }
+}
+
+function deactiveFirebug(callback)
+{
+ FW.Firebug.closeFirebug(true);
+ if (FBTest.ok(isDeactive(), "Firebug is deactivated now."))
+ {
+ setTimeout(function ()
+ {
+ callback();
+ });
+ }
+ else
+ {
+ FBTest.testDone("issue4153.FAILED.");
+ return;
+ }
+}
+
+function isDeactive()
+{
+ return !FW.Firebug.currentContext;
+}

0 comments on commit d5e7f9c

Please sign in to comment.