[Pkg-mozext-commits] [firebug] 19/55: FBTest for issue 4171

David Prévot taffit at moszumanska.debian.org
Mon Mar 31 22:46:08 UTC 2014


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

taffit pushed a commit to tag firebug-1.10.1
in repository firebug.

commit 1316e1dc57ff54db0241c7f16bd64cbb08b1f524
Author: Jan Odvarko <odvarko at gmail.com>
Date:   Wed Jul 18 13:19:38 2012 +0200

    FBTest for issue 4171
---
 tests/content/console/spy/4171/issue4171.html | 40 ++++++++++++++++++++++++
 tests/content/console/spy/4171/issue4171.js   | 45 +++++++++++++++++++++++++++
 tests/content/console/spy/4171/issue4171.php  |  5 +++
 tests/content/firebug.html                    |  1 +
 4 files changed, 91 insertions(+)

diff --git a/tests/content/console/spy/4171/issue4171.html b/tests/content/console/spy/4171/issue4171.html
new file mode 100644
index 0000000..8dc3199
--- /dev/null
+++ b/tests/content/console/spy/4171/issue4171.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>Issue 4171: Expanding an XMLHttpRequest in Console tab before it ends makes JSON tab disappear</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <link href="../../../_common/testcase.css" type="text/css" rel="stylesheet"/>
+</head>
+<body>
+<script type="text/javascript">
+function executeTest()
+{
+    var oXmlHttp = new XMLHttpRequest();
+    oXmlHttp.open("GET", "issue4171.php");
+    oXmlHttp.send(null);
+}
+</script>
+
+<header>
+    <h1><a href="http://code.google.com/p/fbug/issues/detail?id=4171">Issue 4171</a>:
+        Expanding an XMLHttpRequest in Console tab before it ends makes JSON tab disappear</h1>
+</header>
+<div>
+    <section id="description">
+        <h3>Steps to reproduce</h3>
+        <ol>
+            <li>Open Firebug, switch to the Console panel and enable it.</li>
+            <li>Click this button <button id="testButton" onclick="executeTest()">Click Me!</button></li>
+            <li>It generates a new XHR entry in the Console panel</li>
+            <li>Expand the entry before the request finishes (you have about 5 sec)</li>
+            <li>Only <i>Headers</i> info tab is displayed since the request didn't finish yet</li>
+            <li>As soon as the response is received, both <i>Response</i> and <i>JSON</i> tabs
+                should appear.</li>
+        </ol>
+    </section>
+    <footer>
+        Jan Odvarko <odvarko at gmail.com>
+    </footer>
+</div>
+</body>
+</html>
diff --git a/tests/content/console/spy/4171/issue4171.js b/tests/content/console/spy/4171/issue4171.js
new file mode 100644
index 0000000..c876caa
--- /dev/null
+++ b/tests/content/console/spy/4171/issue4171.js
@@ -0,0 +1,45 @@
+function runTest()
+{
+    FBTest.sysout("issue4171.START");
+    FBTest.setPref("showXMLHttpRequests", true);
+    FBTest.openNewTab(basePath + "console/spy/4171/issue4171.html", function(win)
+    {
+        // Open Firebug and enable the Console panel.
+        FBTest.openFirebug();
+        FBTest.enableConsolePanel(function(win)
+        {
+            var options = {
+                tagName: "div",
+                classes: "logRow logRow-spy loading"
+            };
+
+            // Wait till the XHR request in the Console appear (loading in progress)
+            FBTest.waitForDisplayedElement("console", options, function(row)
+            {
+                var clickTarget = row.getElementsByClassName("spyTitleCol spyCol")[0];
+                FBTest.click(clickTarget);
+
+                // At this point, there is only Header tab.
+                var tab = row.getElementsByClassName("netInfoHeadersText netInfoText")[0];
+                FBTest.ok(tab, "Headers tab must exist");
+
+                // Wait till the XHR request finishes (changes its state to loaded)
+                options.classes = "logRow logRow-spy loaded";
+                FBTest.waitForDisplayedElement("console", options, function(row)
+                {
+                    // Now there must be both: the Response and JSON tab.
+                    var tab = row.getElementsByClassName("netInfoResponseText netInfoText")[0];
+                    FBTest.ok(tab, "Response tab must exist");
+
+                    tab = row.getElementsByClassName("netInfoJSONText netInfoText")[0];
+                    FBTest.ok(tab, "JSON tab must exist");
+
+                    FBTest.testDone("issue2868.DONE");
+                });
+            });
+
+            // Execute test implemented on the test page.
+            FBTest.click(win.document.getElementById("testButton"));
+        });
+    });
+}
diff --git a/tests/content/console/spy/4171/issue4171.php b/tests/content/console/spy/4171/issue4171.php
new file mode 100644
index 0000000..3eea737
--- /dev/null
+++ b/tests/content/console/spy/4171/issue4171.php
@@ -0,0 +1,5 @@
+<?php 
+header("Content-Type: text/json");
+sleep(5);
+echo "[{'Name':'Beatles','Country':'England'}]";
+?>
diff --git a/tests/content/firebug.html b/tests/content/firebug.html
index 5c93103..a9a6bb2 100644
--- a/tests/content/firebug.html
+++ b/tests/content/firebug.html
@@ -121,6 +121,7 @@ var testList = [
     {group: "console/spy",        uri: "console/spy/2868/issue2868.js",           desc: "ajax response is not shown in the answer tab", testPage: "console/spy/2868/issue2868.html" },
     {group: "console/spy",        uri: "console/spy/4085/issue4085.js",           desc: "Errors inside an XmlHttpRequest.onReadyStateChange still fail silently", testPage: "console/spy/4085/issue4085.html" },
     {group: "console/spy",        uri: "console/spy/4738/issue4738.js",           desc: "Open in new tab opens wrong url when reusing XMLHttpRequest objects", testPage: "console/spy/4738/issue4738.html" },
+    {group: "console/spy",        uri: "console/spy/4171/issue4171.js",           desc: "Expanding an XMLHttpRequest in Console tab before it ends makes JSON tab disappear", testPage: "console/spy/4171/issue4171.html" },
     {group: "console/api",        uri: "console/api/assert.js",                   desc: "Test for console.assert API.", testPage: "console/api/assert.html" },
     {group: "console/api",        uri: "console/api/clear.js",                    desc: "Test for console.clear API.", testPage: "console/api/clear.html" },
     {group: "console/api",        uri: "console/api/count.js",                    desc: "Test for console.count API.", testPage: "console/api/count.html" },

-- 
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