Skip to content

Commit

Permalink
Merge m-c to b2g-inbound.
Browse files Browse the repository at this point in the history
  • Loading branch information
rvandermeulen committed Oct 1, 2013
2 parents 8f11518 + 50daa32 commit f57f378
Show file tree
Hide file tree
Showing 278 changed files with 4,129 additions and 12,427 deletions.
14 changes: 14 additions & 0 deletions browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,21 @@ pref("app.update.cert.maxErrors", 5);
// when the |app.update.cert.checkAttributes| preference is set to false. Also,
// the |app.update.url.override| preference should ONLY be used for testing.
// IMPORTANT! metro.js should also be updated for updates to certs.X.issuerName

// Nightly builds have switched over to aus4.mozilla.org, but we don't want anything else to yet.
#ifdef NIGHTLY_BUILD
pref("app.update.certs.1.issuerName", "CN=DigiCert Secure Server CA,O=DigiCert Inc,C=US");
pref("app.update.certs.1.commonName", "aus4.mozilla.org");

pref("app.update.certs.2.issuerName", "CN=Thawte SSL CA,O=\"Thawte, Inc.\",C=US");
pref("app.update.certs.2.commonName", "aus4.mozilla.org");
#else
pref("app.update.certs.1.issuerName", "OU=Equifax Secure Certificate Authority,O=Equifax,C=US");
pref("app.update.certs.1.commonName", "aus3.mozilla.org");

pref("app.update.certs.2.issuerName", "CN=Thawte SSL CA,O=\"Thawte, Inc.\",C=US");
pref("app.update.certs.2.commonName", "aus3.mozilla.org");
#endif

// Whether or not app updates are enabled
pref("app.update.enabled", true);
Expand Down Expand Up @@ -162,7 +172,11 @@ pref("app.update.silent", false);
pref("app.update.staging.enabled", true);

// Update service URL:
#ifdef NIGHTLY_BUILD
pref("app.update.url", "https://aus4.mozilla.org/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
#else
pref("app.update.url", "https://aus3.mozilla.org/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
#endif
// app.update.url.manual is in branding section
// app.update.url.details is in branding section

Expand Down
56 changes: 0 additions & 56 deletions browser/devtools/debugger/debugger-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -663,62 +663,6 @@ StackFramesView.prototype = Heritage.extend(WidgetMethods, {
_prevBlackBoxedUrl: null
});

/**
* Utility functions for handling stackframes.
*/
let StackFrameUtils = {
/**
* Create a textual representation for the specified stack frame
* to display in the stackframes container.
*
* @param object aFrame
* The stack frame to label.
*/
getFrameTitle: function(aFrame) {
if (aFrame.type == "call") {
let c = aFrame.callee;
return (c.userDisplayName || c.displayName || c.name || "(anonymous)");
}
return "(" + aFrame.type + ")";
},

/**
* Constructs a scope label based on its environment.
*
* @param object aEnv
* The scope's environment.
* @return string
* The scope's label.
*/
getScopeLabel: function(aEnv) {
let name = "";

// Name the outermost scope Global.
if (!aEnv.parent) {
name = L10N.getStr("globalScopeLabel");
}
// Otherwise construct the scope name.
else {
name = aEnv.type.charAt(0).toUpperCase() + aEnv.type.slice(1);
}

let label = L10N.getFormatStr("scopeLabel", name);
switch (aEnv.type) {
case "with":
case "object":
label += " [" + aEnv.object.class + "]";
break;
case "function":
let f = aEnv.function;
label += " [" +
(f.userDisplayName || f.displayName || f.name || "(anonymous)") +
"]";
break;
}
return label;
}
};

/**
* Functions handling the filtering UI.
*/
Expand Down
1 change: 1 addition & 0 deletions browser/devtools/debugger/debugger-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ let DebuggerView = {

// Attach a controller that handles interfacing with the debugger protocol.
VariablesViewController.attach(this.Variables, {
getEnvironmentClient: aObject => gThreadClient.environment(aObject),
getObjectClient: aObject => gThreadClient.pauseGrip(aObject)
});

Expand Down
2 changes: 2 additions & 0 deletions browser/devtools/debugger/test/browser.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ support-files =
code_ugly.js
doc_binary_search.html
doc_blackboxing.html
doc_closures.html
doc_cmd-break.html
doc_cmd-dbg.html
doc_conditional-breakpoints.html
Expand Down Expand Up @@ -69,6 +70,7 @@ support-files =
[browser_dbg_chrome-debugging.js]
[browser_dbg_clean-exit-window.js]
[browser_dbg_clean-exit.js]
[browser_dbg_closure-inspection.js]
[browser_dbg_cmd-blackbox.js]
[browser_dbg_cmd-break.js]
[browser_dbg_cmd-dbg.js]
Expand Down
216 changes: 216 additions & 0 deletions browser/devtools/debugger/test/browser_dbg_closure-inspection.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
/*
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/

const TAB_URL = EXAMPLE_URL + "doc_closures.html";

// Test that inspecting a closure works as expected.

function test() {
let gPanel, gTab, gDebuggee, gDebugger;

initDebugger(TAB_URL).then(([aTab, aDebuggee, aPanel]) => {
gTab = aTab;
gDebuggee = aDebuggee;
gPanel = aPanel;
gDebugger = gPanel.panelWin;

waitForSourceShown(gPanel, ".html")
.then(testClosure)
.then(() => resumeDebuggerThenCloseAndFinish(gPanel))
.then(null, aError => {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
});

function testClosure() {
// Spin the event loop before causing the debuggee to pause, to allow
// this function to return first.
executeSoon(() => {
EventUtils.sendMouseEvent({ type: "click" },
gDebuggee.document.querySelector("button"),
gDebuggee);
});

gDebuggee.gRecurseLimit = 2;

return waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_SCOPES).then(() => {
let deferred = promise.defer();

let gVars = gDebugger.DebuggerView.Variables,
localScope = gVars.getScopeAtIndex(0),
globalScope = gVars.getScopeAtIndex(1),
localNodes = localScope.target.querySelector(".variables-view-element-details").childNodes,
globalNodes = globalScope.target.querySelector(".variables-view-element-details").childNodes;

is(localNodes[4].querySelector(".name").getAttribute("value"), "person",
"Should have the right property name for |person|.");

is(localNodes[4].querySelector(".value").getAttribute("value"), "Object",
"Should have the right property value for |person|.");

// Expand the 'person' tree node. This causes its properties to be
// retrieved and displayed.
let personNode = gVars.getItemForNode(localNodes[4]);
personNode.expand();
is(personNode.expanded, true, "person should be expanded at this point.");

// Poll every few milliseconds until the properties are retrieved.
// It's important to set the timer in the chrome window, because the
// content window timers are disabled while the debuggee is paused.
let count1 = 0;
let intervalID = window.setInterval(function(){
info("count1: " + count1);
if (++count1 > 50) {
ok(false, "Timed out while polling for the properties.");
window.clearInterval(intervalID);
deferred.reject("Timed out.");
return;
}
if (!personNode._retrieved) {
return;
}
window.clearInterval(intervalID);

is(personNode.get("getName").target.querySelector(".name")
.getAttribute("value"), "getName",
"Should have the right property name for 'getName' in person.");
is(personNode.get("getName").target.querySelector(".value")
.getAttribute("value"), "Function",
"'getName' in person should have the right value.");
is(personNode.get("getFoo").target.querySelector(".name")
.getAttribute("value"), "getFoo",
"Should have the right property name for 'getFoo' in person.");
is(personNode.get("getFoo").target.querySelector(".value")
.getAttribute("value"), "Function",
"'getFoo' in person should have the right value.");

// Expand the function nodes. This causes their properties to be
// retrieved and displayed.
let getFooNode = personNode.get("getFoo");
let getNameNode = personNode.get("getName");
getFooNode.expand();
getNameNode.expand();
is(getFooNode.expanded, true, "person.getFoo should be expanded at this point.");
is(getNameNode.expanded, true, "person.getName should be expanded at this point.");

// Poll every few milliseconds until the properties are retrieved.
// It's important to set the timer in the chrome window, because the
// content window timers are disabled while the debuggee is paused.
let count2 = 0;
let intervalID1 = window.setInterval(function(){
info("count2: " + count2);
if (++count2 > 50) {
ok(false, "Timed out while polling for the properties.");
window.clearInterval(intervalID1);
deferred.reject("Timed out.");
return;
}
if (!getFooNode._retrieved || !getNameNode._retrieved) {
return;
}
window.clearInterval(intervalID1);

is(getFooNode.get("<Closure>").target.querySelector(".name")
.getAttribute("value"), "<Closure>",
"Found the closure node for getFoo.");
is(getFooNode.get("<Closure>").target.querySelector(".value")
.getAttribute("value"), "",
"The closure node has no value for getFoo.");
is(getNameNode.get("<Closure>").target.querySelector(".name")
.getAttribute("value"), "<Closure>",
"Found the closure node for getName.");
is(getNameNode.get("<Closure>").target.querySelector(".value")
.getAttribute("value"), "",
"The closure node has no value for getName.");

// Expand the Closure nodes.
let getFooClosure = getFooNode.get("<Closure>");
let getNameClosure = getNameNode.get("<Closure>");
getFooClosure.expand();
getNameClosure.expand();
is(getFooClosure.expanded, true, "person.getFoo closure should be expanded at this point.");
is(getNameClosure.expanded, true, "person.getName closure should be expanded at this point.");

// Poll every few milliseconds until the properties are retrieved.
// It's important to set the timer in the chrome window, because the
// content window timers are disabled while the debuggee is paused.
let count3 = 0;
let intervalID2 = window.setInterval(function(){
info("count3: " + count3);
if (++count3 > 50) {
ok(false, "Timed out while polling for the properties.");
window.clearInterval(intervalID2);
deferred.reject("Timed out.");
return;
}
if (!getFooClosure._retrieved || !getNameClosure._retrieved) {
return;
}
window.clearInterval(intervalID2);

is(getFooClosure.get("Function scope [_pfactory]").target.querySelector(".name")
.getAttribute("value"), "Function scope [_pfactory]",
"Found the function scope node for the getFoo closure.");
is(getFooClosure.get("Function scope [_pfactory]").target.querySelector(".value")
.getAttribute("value"), "",
"The function scope node has no value for the getFoo closure.");
is(getNameClosure.get("Function scope [_pfactory]").target.querySelector(".name")
.getAttribute("value"), "Function scope [_pfactory]",
"Found the function scope node for the getName closure.");
is(getNameClosure.get("Function scope [_pfactory]").target.querySelector(".value")
.getAttribute("value"), "",
"The function scope node has no value for the getName closure.");

// Expand the scope nodes.
let getFooInnerScope = getFooClosure.get("Function scope [_pfactory]");
let getNameInnerScope = getNameClosure.get("Function scope [_pfactory]");
getFooInnerScope.expand();
getNameInnerScope.expand();
is(getFooInnerScope.expanded, true, "person.getFoo inner scope should be expanded at this point.");
is(getNameInnerScope.expanded, true, "person.getName inner scope should be expanded at this point.");

// Poll every few milliseconds until the properties are retrieved.
// It's important to set the timer in the chrome window, because the
// content window timers are disabled while the debuggee is paused.
let count4 = 0;
let intervalID3 = window.setInterval(function(){
info("count4: " + count4);
if (++count4 > 50) {
ok(false, "Timed out while polling for the properties.");
window.clearInterval(intervalID3);
deferred.reject("Timed out.");
return;
}
if (!getFooInnerScope._retrieved || !getNameInnerScope._retrieved) {
return;
}
window.clearInterval(intervalID3);

// Only test that each function closes over the necessary variable.
// We wouldn't want future SpiderMonkey closure space
// optimizations to break this test.
is(getFooInnerScope.get("foo").target.querySelector(".name")
.getAttribute("value"), "foo",
"Found the foo node for the getFoo inner scope.");
is(getFooInnerScope.get("foo").target.querySelector(".value")
.getAttribute("value"), "10",
"The foo node has the expected value.");
is(getNameInnerScope.get("name").target.querySelector(".name")
.getAttribute("value"), "name",
"Found the name node for the getName inner scope.");
is(getNameInnerScope.get("name").target.querySelector(".value")
.getAttribute("value"), '"Bob"',
"The name node has the expected value.");

deferred.resolve();
}, 100);
}, 100);
}, 100);
}, 100);

return deferred.promise;
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ function testVariablesAndPropertiesFiltering() {
isnot(globalScope.target.querySelectorAll(".variables-view-variable:not([non-match])").length, 0,
"There should be some variables displayed in the global scope.");

is(localScope.target.querySelectorAll(".variables-view-property:not([non-match])").length, 3,
"There should be 3 properties displayed in the local scope.");
is(withScope.target.querySelectorAll(".variables-view-property:not([non-match])").length, 0,
"There should be 0 properties displayed in the with scope.");
is(functionScope.target.querySelectorAll(".variables-view-property:not([non-match])").length, 0,
Expand Down
32 changes: 32 additions & 0 deletions browser/devtools/debugger/test/doc_closures.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset='utf-8'/>
<title>Debugger Test for Closure Inspection</title>
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<script type="text/javascript">
window.addEventListener("load", function onload() {
window.removeEventListener("load", onload);
function clickHandler(event) {
button.removeEventListener("click", clickHandler, false);
var PersonFactory = function _pfactory(name) {
var foo = 10;
return {
getName: function() { return name; },
getFoo: function() { foo = Date.now(); return foo; }
};
};
var person = new PersonFactory("Bob");
debugger;
}
var button = document.querySelector("button");
button.addEventListener("click", clickHandler, false);
});
</script>

</head>
<body>
<button>Click me!</button>
</body>
</html>
Loading

0 comments on commit f57f378

Please sign in to comment.