OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 var pass = chrome.test.callbackPass; |
| 6 var fail = chrome.test.callbackFail; |
| 7 |
| 8 var debuggee; |
| 9 var protocolVersion = "1.0"; |
| 10 |
| 11 chrome.test.runTests([ |
| 12 |
| 13 function attach() { |
| 14 var extensionId = chrome.extension.getURL('').split('/')[2]; |
| 15 debuggee = {extensionId: extensionId}; |
| 16 chrome.debugger.attach(debuggee, protocolVersion, pass()); |
| 17 }, |
| 18 |
| 19 function attachToMissing() { |
| 20 var missingDebuggee = {extensionId: "foo"}; |
| 21 chrome.debugger.attach(missingDebuggee, protocolVersion, |
| 22 fail("No extension with given id " + |
| 23 missingDebuggee.extensionId + ".")); |
| 24 }, |
| 25 |
| 26 function attachAgain() { |
| 27 chrome.debugger.attach(debuggee, protocolVersion, |
| 28 fail("Another debugger is already attached to the extension with id: " + |
| 29 debuggee.extensionId + ".")); |
| 30 }, |
| 31 |
| 32 function detach() { |
| 33 chrome.debugger.detach(debuggee, pass()); |
| 34 }, |
| 35 |
| 36 function detachAgain() { |
| 37 chrome.debugger.detach(debuggee, |
| 38 fail("Debugger is not attached to the extension with id: " + |
| 39 debuggee.extensionId + ".")); |
| 40 } |
| 41 ]); |
OLD | NEW |