Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(465)

Side by Side Diff: chrome/test/data/extensions/api_test/debugger_extension/background.js

Issue 12304021: Allow chrome.debugger API to attach to extension background pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a command line switch enabling attach to extension Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698