Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added the test case to issue 5834

  • Loading branch information...
commit d121cc5afc9c50aff838e9eb69fc932a5e03c5b7 1 parent e60a084
Bharath bharaththiruveedula authored
64 tests/content/cookies/5834/issue5834.js
View
@@ -0,0 +1,64 @@
+function runTest()
+{
+ FBTest.sysout("issue5834.START");
+
+ FBTest.openNewTab(basePath + "cookies/5834/issue5834.php", function(win)
+ {
+ FBTest.openFirebug();
+ FBTestFireCookie.enableCookiePanel(function(win)
+ {
+ FBTest.selectPanel("cookies");
+
+ var tests = [];
+ tests.push(short);
+ tests.push(shortURLEncoded);
+ tests.push(long);
+ tests.push(longURLEncoded);
+
+ FBTest.runTestSuite(tests, function()
+ {
+ FBTest.testDone("issue5834; DONE");
+ });
+ });
+ });
+}
+
+function short(callback)
+{
+ executeTest("TestCookie5834-1", /Size\s*21 B/, callback);
+}
+
+function shortURLEncoded(callback)
+{
+ executeTest("TestCookie5834-2", /Size\s*23 B\s*Raw Size\s*31 B/, callback);
+}
+
+function long(callback)
+{
+ executeTest("TestCookie5834-3", new RegExp("Size\\s*"+((1.2).toLocaleString())+" KB\\s*\\("+
+ ((1216).toLocaleString())+" B\\)"), callback);
+}
+
+function longURLEncoded(callback)
+{
+ executeTest("TestCookie5834-4", new RegExp("Size\\s*"+(166).toLocaleString()+
+ " B\\s*Raw Size\\s*"+(1.3).toLocaleString()+" KB\\s*\\("+(1366).toLocaleString()+" B\\)"),
+ callback);
+}
+
+function executeTest(cookieName, expected, callback)
+{
+ var panelNode = FBTest.getSelectedPanel().panelNode;
+ var cookie = FBTestFireCookie.getCookieByName(panelNode, cookieName);
+ var sizeCol = cookie.row.getElementsByClassName("cookieSizeCol").item(0);
+
+ var config = {tagName: "table", classes: "sizeInfoTip"};
+ FBTest.waitForDisplayedElement("cookies", config, function (infoTip)
+ {
+ FBTest.compare(expected, infoTip.textContent, "The infotip for the '"+cookieName+
+ "' cookie must contain the correct values");
+ callback();
+ });
+
+ FBTest.mouseOver(sizeCol);
+}
71 tests/content/cookies/5834/issue5834.php
View
@@ -0,0 +1,71 @@
+<?php
+ $longValue = "";
+ $longValueUTF8 = "";
+
+ for ($i=0; $i<1200; $i++)
+ $longValue .= "x";
+
+ for ($i=0; $i<150; $i++)
+ $longValueUTF8 .= "";
+
+ $time = time() + 86400;
+ $dir = dirname($_SERVER['SCRIPT_NAME']);
+
+ setcookie("TestCookie5834-1", "Value", $time, $dir);
+ setcookie("TestCookie5834-2", "Value ☺", $time, $dir);
+ setcookie("TestCookie5834-3", $longValue, $time, $dir);
+ setcookie("TestCookie5834-4", $longValueUTF8, $time, $dir);
+?>
+
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Issue 5834: Add infotip for cookie size</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=5834">Issue 5834</a>: Add infotip for cookie size</h1>
+ </header>
+ <div>
+ <section id="description">
+ <h3>Steps to reproduce</h3>
+ <ol>
+ <li>Open Firebug</li>
+ <li>Enable and switch to the <em>Cookies</em> panel</li>
+ <li>
+ Reload the page<br/>
+ <span class="ok">&rArr; Four cookies should be listed (<code>TestCookie5834-1</code> to <code>TestCookie5834-4</code>)</span>
+ </li>
+ <li>Hover the size value of each cookie</li>
+ </ol>
+ <h3>Expected result</h3>
+ <ul>
+ <li>
+ An infotip should be displayed for each value:<br/>
+TestCookie5834-1:
+ <code>
+Size 21 B
+ </code><br/>
+TestCookie5834-2:
+ <code>
+Size 23 B
+Raw Size 31 B
+ </code><br/>
+TestCookie5834-3:
+ <code>
+Size 1.2 KB (1,216 B)
+ </code><br/>
+TestCookie5834-4:
+ <code>
+Size 166 B
+Raw Size 1.3 KB (1,366 B)
+ </code>
+ </li>
+ </ul>
+ </section>
+ <footer>Sebastian Zartner, sebastianzartner@gmail.com</footer>
+ </div>
+ </body>
+</html>
1  tests/content/firebug.html
View
@@ -334,6 +334,7 @@
{group: "cookies", uri: "cookies/54/issue54.js", desc: "urlencoding of cookies value", testPage: "cookies/54/issue54.php" },
{group: "cookies", uri: "cookies/60/issue60.js", desc: "'[' and ']' characters get badly encoded on cookie name upon editing", testPage: "cookies/60/issue60.php" },
{group: "cookies", uri: "cookies/5560/issue5560.js", desc: "Add column for raw value", testPage: "cookies/5560/issue5560.php" }
+ {group: "cookies", uri: "cookies/5834/issue5834.js", desc: "Add infotip for cookie size", testpage: "cookies/5834/issue5834.php" }
];
</script>
Please sign in to comment.
Something went wrong with that request. Please try again.