-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug 911098 - Implement addon dubugger UI #3
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
toolkit/mozapps/extensions/test/addons/test_jetpack/bootstrap.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Components.utils.import("resource://gre/modules/Services.jsm"); | ||
|
||
function install(data, reason) { | ||
Services.prefs.setIntPref("jetpacktest.installed_version", 1); | ||
} | ||
|
||
function startup(data, reason) { | ||
Services.prefs.setIntPref("jetpacktest.active_version", 1); | ||
} | ||
|
||
function shutdown(data, reason) { | ||
Services.prefs.setIntPref("jetpacktest.active_version", 0); | ||
} | ||
|
||
function uninstall(data, reason) { | ||
Services.prefs.setIntPref("jetpacktest.installed_version", 0); | ||
} |
1 change: 1 addition & 0 deletions
1
toolkit/mozapps/extensions/test/addons/test_jetpack/harness-options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
28 changes: 28 additions & 0 deletions
28
toolkit/mozapps/extensions/test/addons/test_jetpack/install.rdf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0"?> | ||
|
||
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||
xmlns:em="http://www.mozilla.org/2004/em-rdf#"> | ||
|
||
<Description about="urn:mozilla:install-manifest"> | ||
<em:id>jetpack@tests.mozilla.org</em:id> | ||
<em:version>1.0</em:version> | ||
<em:bootstrap>true</em:bootstrap> | ||
|
||
<!-- Front End MetaData --> | ||
<em:name>Test jetpack</em:name> | ||
<em:description>Test Description</em:description> | ||
|
||
<em:iconURL>chrome://foo/skin/icon.png</em:iconURL> | ||
<em:aboutURL>chrome://foo/content/about.xul</em:aboutURL> | ||
<em:optionsURL>chrome://foo/content/options.xul</em:optionsURL> | ||
|
||
<em:targetApplication> | ||
<Description> | ||
<em:id>xpcshell@tests.mozilla.org</em:id> | ||
<em:minVersion>1</em:minVersion> | ||
<em:maxVersion>1</em:maxVersion> | ||
</Description> | ||
</em:targetApplication> | ||
|
||
</Description> | ||
</RDF> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
toolkit/mozapps/extensions/test/browser/browser_debug_button.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* Any copyright is dedicated to the Public Domain. | ||
* http://creativecommons.org/publicdomain/zero/1.0/ | ||
*/ | ||
|
||
/** | ||
* Tests debug button for addons in list view | ||
*/ | ||
|
||
const getDebugButton = node => | ||
node.ownerDocument.getAnonymousElementByAttribute(node, | ||
"anonid", | ||
"debug-btn"); | ||
|
||
function test() { | ||
requestLongerTimeout(2); | ||
|
||
waitForExplicitFinish(); | ||
|
||
|
||
var gProvider = new MockProvider(); | ||
gProvider.createAddons([{ | ||
id: "non-debuggable@tests.mozilla.org", | ||
name: "No debug", | ||
description: "foo" | ||
}, | ||
{ | ||
id: "debuggable@tests.mozilla.org", | ||
name: "Debuggable", | ||
description: "bar", | ||
isDebuggable: true | ||
}]); | ||
|
||
// Enable add-on debugger | ||
Services.prefs.setBoolPref("devtools.debugger.addon-enabled", true); | ||
|
||
open_manager("addons://list/extension", function(aManager) { | ||
const {document} = aManager; | ||
const addonList = document.getElementById("addon-list"); | ||
const nondebug = addonList.querySelector("[name='No debug']"); | ||
const debuggable = addonList.querySelector("[name='Debuggable']"); | ||
|
||
is(getDebugButton(nondebug).disabled, true, | ||
"button is disabled for legacy addons"); | ||
|
||
is(getDebugButton(debuggable).disabled, false, | ||
"button is enabled for debuggable addons"); | ||
|
||
close_manager(aManager, finish); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
toolkit/mozapps/extensions/test/xpcshell/test_isDebuggable.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
var ADDONS = [ | ||
"test_bootstrap2_1", // restartless addon | ||
"test_bootstrap1_4", // old-school addon | ||
"test_jetpack" // sdk addon | ||
]; | ||
|
||
var IDS = [ | ||
"bootstrap1@tests.mozilla.org", | ||
"bootstrap2@tests.mozilla.org", | ||
"jetpacktest@tests.mozilla.org" | ||
]; | ||
|
||
function run_test() { | ||
do_test_pending(); | ||
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "2", "2"); | ||
|
||
startupManager(); | ||
AddonManager.checkCompatibility = false; | ||
|
||
installAllFiles([do_get_addon(a) for each (a in ADDONS)], function() { | ||
restartManager(); | ||
|
||
AddonManager.getAddonsByIDs(IDS, function([a1, a2, a3]) { | ||
do_check_eq(a1.isDebuggable, false); | ||
do_check_eq(a2.isDebuggable, false); | ||
do_check_eq(a3.isDebuggable, true); | ||
do_test_finished(); | ||
}); | ||
}, true); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mossop I believe @erikvold is going to expose
isJetpack
for native jetpacks anyway, so is there point in delaying it ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like Blair to review any API addition here.
On Thu, Jan 23, 2014 at 3:01 PM, Irakli Gozalishvili <
notifications@github.com> wrote: