Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Added the test case for issue 5834 #36

Open
wants to merge 1 commit into from

2 participants

Bharath unique1D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Sep 10, 2012
unique1D unique1D Added the test case for issue 5834 7e667f1
This page is out of date. Refresh to see the latest.
64 tests/content/cookies/5834/issue5834.js
... ... @@ -0,0 +1,64 @@
  1 +function runTest()
  2 +{
  3 + FBTest.sysout("issue5834.START");
  4 +
  5 + FBTest.openNewTab(basePath + "cookies/5834/issue5834.php", function(win)
  6 + {
  7 + FBTest.openFirebug();
  8 + FBTestFireCookie.enableCookiePanel(function(win)
  9 + {
  10 + FBTest.selectPanel("cookies");
  11 +
  12 + var tests = [];
  13 + tests.push(short);
  14 + tests.push(shortURLEncoded);
  15 + tests.push(long);
  16 + tests.push(longURLEncoded);
  17 +
  18 + FBTest.runTestSuite(tests, function()
  19 + {
  20 + FBTest.testDone("issue5834; DONE");
  21 + });
  22 + });
  23 + });
  24 +}
  25 +
  26 +function short(callback)
  27 +{
  28 + executeTest("TestCookie5834-1", /Size\s*21 B/, callback);
  29 +}
  30 +
  31 +function shortURLEncoded(callback)
  32 +{
  33 + executeTest("TestCookie5834-2", /Size\s*23 B\s*Raw Size\s*31 B/, callback);
  34 +}
  35 +
  36 +function long(callback)
  37 +{
  38 + executeTest("TestCookie5834-3", new RegExp("Size\\s*"+((1.2).toLocaleString())+" KB\\s*\\("+
  39 + ((1216).toLocaleString())+" B\\)"), callback);
  40 +}
  41 +
  42 +function longURLEncoded(callback)
  43 +{
  44 + executeTest("TestCookie5834-4", new RegExp("Size\\s*"+(166).toLocaleString()+
  45 + " B\\s*Raw Size\\s*"+(1.3).toLocaleString()+" KB\\s*\\("+(1366).toLocaleString()+" B\\)"),
  46 + callback);
  47 +}
  48 +
  49 +function executeTest(cookieName, expected, callback)
  50 +{
  51 + var panelNode = FBTest.getSelectedPanel().panelNode;
  52 + var cookie = FBTestFireCookie.getCookieByName(panelNode, cookieName);
  53 + var sizeCol = cookie.row.getElementsByClassName("cookieSizeCol").item(0);
  54 +
  55 + var config = {tagName: "table", classes: "sizeInfoTip"};
  56 + FBTest.waitForDisplayedElement("cookies", config, function (infoTip)
  57 + {
  58 + FBTest.compare(expected, infoTip.textContent, "The infotip for the '"+cookieName+
  59 + "' cookie must contain the correct values");
  60 + callback();
  61 + });
  62 +
  63 + FBTest.mouseOver(sizeCol);
  64 +}
71 tests/content/cookies/5834/issue5834.php
... ... @@ -0,0 +1,71 @@
  1 +<?php
  2 + $longValue = "";
  3 + $longValueUTF8 = "";
  4 +
  5 + for ($i=0; $i<1200; $i++)
  6 + $longValue .= "x";
  7 +
  8 + for ($i=0; $i<150; $i++)
  9 + $longValueUTF8 .= "☺";
  10 +
  11 + $time = time() + 86400;
  12 + $dir = dirname($_SERVER['SCRIPT_NAME']);
  13 +
  14 + setcookie("TestCookie5834-1", "Value", $time, $dir);
  15 + setcookie("TestCookie5834-2", "Value ☺", $time, $dir);
  16 + setcookie("TestCookie5834-3", $longValue, $time, $dir);
  17 + setcookie("TestCookie5834-4", $longValueUTF8, $time, $dir);
  18 +?>
  19 +
  20 +<!DOCTYPE html>
  21 +<html>
  22 + <head>
  23 + <title>Issue 5834: Add infotip for cookie size</title>
  24 + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  25 + <link href="../../_common/testcase.css" type="text/css" rel="stylesheet"/>
  26 + </head>
  27 + <body>
  28 + <header>
  29 + <h1><a href="http://code.google.com/p/fbug/issues/detail?id=5834">Issue 5834</a>: Add infotip for cookie size</h1>
  30 + </header>
  31 + <div>
  32 + <section id="description">
  33 + <h3>Steps to reproduce</h3>
  34 + <ol>
  35 + <li>Open Firebug</li>
  36 + <li>Enable and switch to the <em>Cookies</em> panel</li>
  37 + <li>
  38 + Reload the page<br/>
  39 + <span class="ok">&rArr; Four cookies should be listed (<code>TestCookie5834-1</code> to <code>TestCookie5834-4</code>)</span>
  40 + </li>
  41 + <li>Hover the size value of each cookie</li>
  42 + </ol>
  43 + <h3>Expected result</h3>
  44 + <ul>
  45 + <li>
  46 + An infotip should be displayed for each value:<br/>
  47 +TestCookie5834-1:
  48 + <code>
  49 +Size 21 B
  50 + </code><br/>
  51 +TestCookie5834-2:
  52 + <code>
  53 +Size 23 B
  54 +Raw Size 31 B
  55 + </code><br/>
  56 +TestCookie5834-3:
  57 + <code>
  58 +Size 1.2 KB (1,216 B)
  59 + </code><br/>
  60 +TestCookie5834-4:
  61 + <code>
  62 +Size 166 B
  63 +Raw Size 1.3 KB (1,366 B)
  64 + </code>
  65 + </li>
  66 + </ul>
  67 + </section>
  68 + <footer>Sebastian Zartner, sebastianzartner@gmail.com</footer>
  69 + </div>
  70 + </body>
  71 +</html>
142 tests/content/cookies/5834/testcase.css
... ... @@ -0,0 +1,142 @@
  1 +@font-face {
  2 + font-family: 'TitilliumMaps';
  3 + src: url('http://getfirebug.com/fonts/TitilliumMaps26L001.eot');
  4 + src: local('☺'), url('http://getfirebug.com/fonts/TitilliumMaps26L001.woff') format('woff'), url('http://getfirebug.com/fonts/TitilliumMaps26L001.ttf') format('truetype');
  5 + font-weight: bold;
  6 +}
  7 +
  8 +* {
  9 + position: relative;
  10 +}
  11 +
  12 +html, body {
  13 + width: 100%;
  14 + min-height: -moz-calc(100% - 30px);
  15 + margin: 0;
  16 + padding-bottom: 30px;
  17 +}
  18 +
  19 +body {
  20 + background: #FFFFFF -moz-linear-gradient(center top, #EAF1FB, #FFFFFF 450px) no-repeat;
  21 + font-family: "Trebuchet MS", Helvetica, sans-serif;
  22 + font-size: 0.9em;
  23 +}
  24 +
  25 +body > div, h1 {
  26 + margin: auto;
  27 + width: 800px;
  28 +}
  29 +
  30 +body > div {
  31 + top: 40px;
  32 + border-radius: 8px;
  33 + box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  34 + background-color: rgba(255, 255, 255, 0.6);
  35 + padding: 15px;
  36 +}
  37 +
  38 +section#content {
  39 + background-image: -moz-linear-gradient(bottom, #E6E6E6, #F0F0F0);
  40 + border-radius: 8px;
  41 + margin-bottom: 10px;
  42 + padding: 10px;
  43 +}
  44 +
  45 +section#output {
  46 + display: none;
  47 + background-image: -moz-linear-gradient(bottom, #F5F5F5, #FFFFFF);
  48 + margin: 10px 0;
  49 + padding: 10px;
  50 +}
  51 +
  52 +pre {
  53 + margin: 0;
  54 +}
  55 +
  56 +footer {
  57 + margin-top: 10px;
  58 + text-align: right;
  59 + font-size: 75%;
  60 + font-style: italic;
  61 +}
  62 +
  63 +h1, h2 {
  64 + font-family: /* TitilliumMaps, */ "Trebuchet MS", Helvetica, sans-serif;
  65 + font-size: 130%;
  66 + font-weight: bold;
  67 +}
  68 +
  69 +h1 {
  70 + top: 20px;
  71 +}
  72 +
  73 +h2 {
  74 + margin: 0.5em 0;
  75 + border-bottom: 2px solid #9ACBE4;
  76 +}
  77 +
  78 +h3 {
  79 + margin: 0.3em 0 0.2em 0;
  80 + font-size: 105%;
  81 +}
  82 +
  83 +p, ol, ul {
  84 + margin: 0.2em 0;
  85 +}
  86 +
  87 +p {
  88 + padding-left: 20px;
  89 +}
  90 +
  91 +section#description p {
  92 + font-style: italic;
  93 +}
  94 +
  95 +section#description ul {
  96 + list-style-type: square;
  97 + list-style-image: url(data:image/gif;base64,R0lGODlhBQAIAPcAAGOMnGOMnP///2OMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnGOMnP///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////yH5BAEAAAIALAAAAAAFAAgABwgSAAEIHEiwoEGC/xImFMCwocOAADs=);
  98 +}
  99 +
  100 +section#description li.ok, section#description li span.ok {
  101 + color: #00B400;
  102 +}
  103 +
  104 +section#description li.error, section#description li span.error {
  105 + color: #DC0000;
  106 +}
  107 +
  108 +code {
  109 + white-space: pre;
  110 + color: #008C00;
  111 +}
  112 +
  113 +code.key {
  114 + color: #0000DC;
  115 +}
  116 +
  117 +input, button {
  118 + border: 1px solid #AAAAAA;
  119 + border-radius: 5px;
  120 + padding: 3px 5px;
  121 +}
  122 +
  123 +input[type="button"], button {
  124 + background-image: -moz-linear-gradient(bottom, #A0A0A0, #C8C8C8);
  125 + box-shadow: 0 -2px 2px -1px rgba(0, 0, 0, 0.5) inset, 0 2px 2px -1px #FFFFFF inset;
  126 + text-shadow: 1px 1px rgba(255, 255, 255, 0.3);
  127 +}
  128 +
  129 +input[type="button"][disabled="true"], button[disabled="true"] {
  130 + background-image: -moz-linear-gradient(bottom, #C8C8C8, #F0F0F0);
  131 +}
  132 +
  133 +input[type="button"]:not([disabled="true"]):hover,
  134 +button:not([disabled="true"]):hover {
  135 + background-image: -moz-linear-gradient(bottom, #B4B4B4, #DCDCDC);
  136 +}
  137 +
  138 +input[type="button"]:not([disabled="true"]):active,
  139 +button:not([disabled="true"]):active {
  140 + background-image: -moz-linear-gradient(top, #8C8C8C, #A0A0A0);
  141 + box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.5) inset, 0 -2px 2px -1px #FFFFFF inset;
  142 +}

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.