OLD | NEW |
(Empty) | |
| 1 var pass = chrome.test.callbackPass; |
| 2 var fail = chrome.test.callbackFail; |
| 3 |
| 4 var debuggee; |
| 5 var protocolVersion = "1.0"; |
| 6 |
| 7 chrome.test.runTests([ |
| 8 |
| 9 function attach() { |
| 10 var extensionId = chrome.extension.getURL('').split('/')[2]; |
| 11 debuggee = {extensionId: extensionId}; |
| 12 chrome.debugger.attach(debuggee, protocolVersion, pass()); |
| 13 }, |
| 14 |
| 15 function attachToMissing() { |
| 16 var missingDebuggee = {extensionId: "foo"}; |
| 17 chrome.debugger.attach(missingDebuggee, protocolVersion, |
| 18 fail("No extension with given id " + |
| 19 missingDebuggee.extensionId + ".")); |
| 20 }, |
| 21 |
| 22 function attachAgain() { |
| 23 chrome.debugger.attach(debuggee, protocolVersion, |
| 24 fail("Another debugger is already attached to the extension with id: " + |
| 25 debuggee.extensionId + ".")); |
| 26 }, |
| 27 |
| 28 function detach() { |
| 29 chrome.debugger.detach(debuggee, pass()); |
| 30 }, |
| 31 |
| 32 function detachAgain() { |
| 33 chrome.debugger.detach(debuggee, |
| 34 fail("Debugger is not attached to the extension with id: " + |
| 35 debuggee.extensionId + ".")); |
| 36 }, |
| 37 ]); |
OLD | NEW |