Permalink
Browse files

FBTest, skeleton test, helping Farshid with test for issue 5526

  • Loading branch information...
1 parent 45fdd80 commit 0a0305589ca6f82da2bc295faa498a0ac6d18c52 @janodvarko janodvarko committed Jun 22, 2012
Showing with 138 additions and 0 deletions.
  1. +68 −0 tests/content/firebug/5526/issue5526.html
  2. +70 −0 tests/content/firebug/5526/issue5526.js
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<html>
+ <!--
+ STEPS TO CREATE A TEST CASE:
+ 1. Replace "xxxx" by number of your issue
+ 2. Replace "Issue summary" by title of your issue
+ 3. Put inspectable elements, form fields etc. into the "content" section
+ 4. Add the exact steps to reproduce your issue under "Steps to reproduce"
+ 5. Describe the currently seen result under "Observed result"
+ 6. Describe what you would expect to see under "Expected result"
+ 7. Add your contact information
+ 8. Remove all template comments
+
+ Note: Make sure, the URL to testcase.css is https://getfirebug.com/tests/content/templates/default/testcase.css
+ -->
+ <head>
+ <!--
+ Add the issue number and title here.
+ -->
+ <title>Issue xxxx: Issue summary</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=xxxx">Issue xxxx</a>: Issue summary</h1>
+ </header>
+ <div>
+ <section id="content">
+ <!--
+ All inspectable elements, form fields etc. needed to execute the test should be placed here.
+ If you generate output via JavaScript, put it into <section id="output"></section>.
+ If you don't need any content, you can remove the "content" section.
+ -->
+ </section>
+ <section id="description">
+ <!--
+ The steps to reproduce the test case should be described here in detail.
+ -->
+ <h3>Steps to reproduce</h3>
+ <ol>
+ <li>Step 1</li>
+ <li>Step 2</li>
+ <li>Step 3</li>
+ </ol>
+ <h3>Observed result</h3>
+ <ul>
+ <li>Point 1</li>
+ <li>Point 2</li>
+ <li>Point 3</li>
+ </ul>
+ <h3>Expected result</h3>
+ <ul>
+ <li>Point 1</li>
+ <li>Point 2</li>
+ <li>Point 3</li>
+ </ul>
+ </section>
+ <footer>
+ <!--
+ Your name and your email address (or other contact information) should be placed here.
+ This is important in the case we need to contact you for further reference.
+ -->
+ &lt;Author name&gt;, &lt;email address&gt;
+ </footer>
+ </div>
+ </body>
+</html>
@@ -0,0 +1,70 @@
+function runTest()
+{
+ FBTest.sysout("issue5526.START");
+
+ FBTest.openNewTab(basePath + "firebug/5526/issue5526.html", function(win)
+ {
+ detachFirebug(function(win)
+ {
+ FBTest.ok(FBTest.isDetached(), "Firebug must be detached now");
+ attachFirebug(function()
+ {
+ FBTest.progress("waiting for detach " + FW.Firebug.chrome.waitingForDetach);
+ FBTest.ok(FBTest.isMinimized(), "Firebug must be minimized now");
+
+ openFirebug(function()
+ {
+ FBTest.ok(FBTest.isDetached(), "Firebug must be detached now");
+ FBTest.testDone("issue5526.DONE");
+ });
+ })
+ });
+ });
+}
+
+// xxxHonza: if this method is generic enough it
+// should be moved into FBTest namespace so, other tests
+// can reuse it (and it should probably replace the current
+// FBTest.detachFirebug API)
+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 openFirebug(callback)
+{
+ FBTest.sendKey("F12");
+
+ // This time out is wrong, we need to get detached window,
+ // register onload event one shot handler and wait till the window
+ // is loaded. Just like the detachFirebug method does.
+ setTimeout(function()
+ {
+ callback();
+ }, 1000);
+}
+
+function attachFirebug(callback)
+{
+ // Attaching Firebug is synchronous?
+ FBTest.sendKey("F12");
+ callback();
+}
+
+// xxxHonza: already in FBTest will be part of FBTest 1.10b6
+function isMinimized()
+{
+ return FW.Firebug.isMinimized();
+}
+

0 comments on commit 0a03055

Please sign in to comment.