| Index: chrome/test/data/extensions/api_test/debugger/background.js
|
| diff --git a/chrome/test/data/extensions/api_test/debugger/background.js b/chrome/test/data/extensions/api_test/debugger/background.js
|
| index 0ca46c96a3bb130dba39384b31f4233213b97be4..35a02514bb8ea03fde52a0ab38fbfe6de9e4320a 100644
|
| --- a/chrome/test/data/extensions/api_test/debugger/background.js
|
| +++ b/chrome/test/data/extensions/api_test/debugger/background.js
|
| @@ -7,6 +7,7 @@ var fail = chrome.test.callbackFail;
|
|
|
| var tabId;
|
| var debuggee;
|
| +var debuggeeExtension;
|
| var protocolVersion = "1.0";
|
|
|
| chrome.test.runTests([
|
| @@ -40,6 +41,12 @@ chrome.test.runTests([
|
| });
|
| },
|
|
|
| + function attachToMissingTab() {
|
| + var missingDebuggee = {tabId: -1};
|
| + chrome.debugger.attach(missingDebuggee, protocolVersion,
|
| + fail("No tab with given id " + missingDebuggee.tabId + "."));
|
| + },
|
| +
|
| function attachAgain() {
|
| chrome.debugger.attach(debuggee, protocolVersion,
|
| fail("Another debugger is already attached to the tab with id: " +
|
| @@ -98,6 +105,40 @@ chrome.test.runTests([
|
| fail("Can not attach to the page with the \"chrome://\" scheme."));
|
| chrome.tabs.remove(tab.id);
|
| });
|
| - }
|
| + },
|
| +
|
| + function attachToExtension() {
|
| + var extensionId = chrome.extension.getURL('').split('/')[2];
|
| + debuggeeExtension = {extensionId: extensionId};
|
| + chrome.debugger.attach(debuggeeExtension, protocolVersion, pass());
|
| + },
|
| +
|
| + function attachToMissingExtension() {
|
| + var missingDebuggee = {extensionId: "foo"};
|
| + chrome.debugger.attach(missingDebuggee, protocolVersion,
|
| + fail("No extension with given id " +
|
| + missingDebuggee.extensionId + "."));
|
| + },
|
|
|
| + function attachToInvalidTarget() {
|
| + var emptyDebuggee = {};
|
| + chrome.debugger.attach(emptyDebuggee, protocolVersion,
|
| + fail("Either tab id or extension id must be specified."));
|
| + },
|
| +
|
| + function attachAgainToExtension() {
|
| + chrome.debugger.attach(debuggeeExtension, protocolVersion,
|
| + fail("Another debugger is already attached to the extension with id: " +
|
| + debuggeeExtension.extensionId + "."));
|
| + },
|
| +
|
| + function detachFromExtension() {
|
| + chrome.debugger.detach(debuggeeExtension, pass());
|
| + },
|
| +
|
| + function detachAgainFromExtension() {
|
| + chrome.debugger.detach(debuggeeExtension,
|
| + fail("Debugger is not attached to the extension with id: " +
|
| + debuggeeExtension.extensionId + "."));
|
| + },
|
| ]);
|
|
|