Skip to content

Commit

Permalink
Merge branch 'master' into issue5585
Browse files Browse the repository at this point in the history
  • Loading branch information
janodvarko committed Jun 22, 2012
2 parents 482fe17 + 0a03055 commit b922fde
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 67 deletions.
64 changes: 0 additions & 64 deletions extension/content/firebug/cookies/cookieReps.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -39,19 +39,6 @@ const Ci = Components.interfaces;
const lastSortedColumn = "cookies.lastSortedColumn"; const lastSortedColumn = "cookies.lastSortedColumn";
const hiddenColsPref = "cookies.hiddenColumns"; const hiddenColsPref = "cookies.hiddenColumns";


// Cookie status & policy
var STATUS_UNKNOWN = Ci.nsICookie2.STATUS_UNKNOWN;
var STATUS_ACCEPTED = Ci.nsICookie2.STATUS_ACCEPTED;
var STATUS_DOWNGRADED = Ci.nsICookie2.STATUS_DOWNGRADED;
var STATUS_FLAGGED = Ci.nsICookie2.STATUS_FLAGGED;
var STATUS_REJECTED = Ci.nsICookie2.STATUS_REJECTED;

var POLICY_UNKNOWN = Ci.nsICookie2.POLICY_UNKNOWN;
var POLICY_NONE = Ci.nsICookie2.POLICY_NONE;
var POLICY_NO_CONSENT = Ci.nsICookie2.POLICY_NO_CONSENT;
var POLICY_IMPLICIT_CONSENT = Ci.nsICookie2.POLICY_IMPLICIT_CONSENT;
var POLICY_NO_II = Ci.nsICookie2.POLICY_NO_II;

const panelName = "cookies"; const panelName = "cookies";


// ********************************************************************************************* // // ********************************************************************************************* //
Expand Down Expand Up @@ -129,9 +116,6 @@ CookieReps.CookieRow = domplate(CookieReps.Rep,
), ),
TD({"class": "cookieSecurityCol cookieCol"}, TD({"class": "cookieSecurityCol cookieCol"},
DIV({"class": "cookieSecurityLabel cookieLabel"}, "$cookie|isSecure") DIV({"class": "cookieSecurityLabel cookieLabel"}, "$cookie|isSecure")
),
TD({"class": "cookieStatusCol cookieCol"},
DIV({"class": "cookieLabel"}, "$cookie|getStatus")
) )
) )
), ),
Expand Down Expand Up @@ -283,48 +267,6 @@ CookieReps.CookieRow = domplate(CookieReps.Rep,
return cookie.cookie.isSecure ? Locale.$STR("cookies.secure.label") : ""; return cookie.cookie.isSecure ? Locale.$STR("cookies.secure.label") : "";
}, },


getStatus: function(cookie)
{
if (!cookie.cookie.status)
return "";

switch (cookie.cookie.status)
{
case STATUS_UNKNOWN:
return "";
case STATUS_ACCEPTED:
return Locale.$STR("cookies.status.accepted");
case STATUS_DOWNGRADED:
return Locale.$STR("cookies.status.downgraded");
case STATUS_FLAGGED:
return Locale.$STR("cookies.status.flagged");
case STATUS_REJECTED:
return Locale.$STR("cookies.status.rejected");
}

return "";
},

getPolicy: function(cookie)
{
switch (cookie.cookie.policy)
{
//xxxHonza localization
case POLICY_UNKNOWN:
return "POLICY_UNKNOWN";
case POLICY_NONE:
return "POLICY_NONE";
case POLICY_NO_CONSENT:
return "POLICY_NO_CONSENT";
case POLICY_IMPLICIT_CONSENT:
return "POLICY_IMPLICIT_CONSENT";
case POLICY_NO_II:
return "POLICY_NO_II";
}

return "";
},

// Firebug rep support // Firebug rep support
supportsObject: function(cookie) supportsObject: function(cookie)
{ {
Expand Down Expand Up @@ -1070,12 +1012,6 @@ CookieReps.CookieTable = domplate(CookieReps.Rep,
DIV({"class": "cookieHeaderCellBox", DIV({"class": "cookieHeaderCellBox",
title: Locale.$STR("cookies.header.security.tooltip")}, title: Locale.$STR("cookies.header.security.tooltip")},
Locale.$STR("cookies.header.security")) Locale.$STR("cookies.header.security"))
),
TD({id: "colStatus", role: "columnheader",
"class": "cookieHeaderCell alphaValue a11yFocus"},
DIV({"class": "cookieHeaderCellBox",
title: Locale.$STR("cookies.header.status.tooltip")},
Locale.$STR("cookies.header.status"))
) )
) )
) )
Expand Down
1 change: 1 addition & 0 deletions extension/content/firebug/firefox/firebug.xul
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<?xml-stylesheet href="chrome://global/skin/global.css"?> <?xml-stylesheet href="chrome://global/skin/global.css"?>


<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
windowtype="Firebug:Detached"
id="firebug" id="firebug"
title="Firebug" title="Firebug"
width="800" height="600" width="800" height="600"
Expand Down
4 changes: 1 addition & 3 deletions extension/locale/en-US/cookies.properties
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -192,13 +192,12 @@ cookies.header.size=Size
cookies.header.path=Path cookies.header.path=Path
cookies.header.expires=Expires cookies.header.expires=Expires
cookies.header.security=Security cookies.header.security=Security
cookies.header.status=Status
cookies.header.httponly=HttpOnly cookies.header.httponly=HttpOnly


# LOCALIZATION NOTE (cookies.header.name.tooltip, cookies.header.value.tooltip, # LOCALIZATION NOTE (cookies.header.name.tooltip, cookies.header.value.tooltip,
# cookies.header.rawValue.tooltip, cookies.header.domain.tooltip, cookies.header.size.tooltip, # cookies.header.rawValue.tooltip, cookies.header.domain.tooltip, cookies.header.size.tooltip,
# cookies.header.path.tooltip, cookies.header.expires.tooltip, cookies.header.security.tooltip, # cookies.header.path.tooltip, cookies.header.expires.tooltip, cookies.header.security.tooltip,
# cookies.header.status.tooltip, cookies.header.httponly.tooltip): # cookies.header.httponly.tooltip):
# Column tooltips used in the cookie header. # Column tooltips used in the cookie header.
cookies.header.name.tooltip=Name of the cookie cookies.header.name.tooltip=Name of the cookie
cookies.header.value.tooltip=Value stored for the cookie cookies.header.value.tooltip=Value stored for the cookie
Expand All @@ -208,7 +207,6 @@ cookies.header.size.tooltip=Size of the stored cookie
cookies.header.path.tooltip=Directory where the cookie is active cookies.header.path.tooltip=Directory where the cookie is active
cookies.header.expires.tooltip=Expiration date for the cookie cookies.header.expires.tooltip=Expiration date for the cookie
cookies.header.security.tooltip=Shows whether it is a secure cookie or not cookies.header.security.tooltip=Shows whether it is a secure cookie or not
cookies.header.status.tooltip=Status of the cookie (downgraded, flagged, etc.)
cookies.header.httponly.tooltip=Shows if the cookie is an HTTP only cookie cookies.header.httponly.tooltip=Shows if the cookie is an HTTP only cookie


# LOCALIZATION NOTE (cookies.netinfo.Received_Cookies, cookies.netinfo.Sent_Cookies): # LOCALIZATION NOTE (cookies.netinfo.Received_Cookies, cookies.netinfo.Sent_Cookies):
Expand Down
10 changes: 10 additions & 0 deletions tests/FBTest/content/FBTestFirebug.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -563,6 +563,16 @@ this.isDetached = function()
return FW.Firebug.isDetached(); return FW.Firebug.isDetached();
}; };


this.isMinimized = function()
{
return FW.Firebug.isMinimized();
};

this.isInBrowser = function()
{
return FW.Firebug.isInBrowser();
};

/** /**
* Detach Firebug into a new separate window. * Detach Firebug into a new separate window.
*/ */
Expand Down
68 changes: 68 additions & 0 deletions tests/content/firebug/5526/issue5526.html
Original file line number Original file line Diff line number Diff line change
@@ -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>
70 changes: 70 additions & 0 deletions tests/content/firebug/5526/issue5526.js
Original file line number Original file line Diff line number Diff line change
@@ -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 b922fde

Please sign in to comment.