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

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

Issue 12377047: Add chrome.debugger.getTargets method to discover available debug targets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@targets
Patch Set: Removed flaky tests Created 7 years, 8 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
« no previous file with comments | « chrome/test/data/extensions/api_test/debugger/background.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var pass = chrome.test.callbackPass; 5 var pass = chrome.test.callbackPass;
6 var fail = chrome.test.callbackFail; 6 var fail = chrome.test.callbackFail;
7 7
8 var debuggee; 8 var debuggee;
9 var protocolVersion = "1.0"; 9 var protocolVersion = "1.0";
10 10
11 chrome.test.runTests([ 11 chrome.test.runTests([
12 12
13 function attach() { 13 function attach() {
14 var extensionId = chrome.extension.getURL('').split('/')[2]; 14 var extensionId = chrome.extension.getURL('').split('/')[2];
15 debuggee = {extensionId: extensionId}; 15 debuggee = {extensionId: extensionId};
16 chrome.debugger.attach(debuggee, protocolVersion, pass()); 16 chrome.debugger.attach(debuggee, protocolVersion, pass());
17 }, 17 },
18 18
19 function attachToMissing() { 19 function attachToMissing() {
20 var missingDebuggee = {extensionId: "foo"}; 20 var missingDebuggee = {extensionId: "foo"};
21 chrome.debugger.attach(missingDebuggee, protocolVersion, 21 chrome.debugger.attach(missingDebuggee, protocolVersion,
22 fail("No extension with given id " + 22 fail("No background page with given id " +
23 missingDebuggee.extensionId + ".")); 23 missingDebuggee.extensionId + "."));
24 }, 24 },
25 25
26 function attachAgain() { 26 function attachAgain() {
27 chrome.debugger.attach(debuggee, protocolVersion, 27 chrome.debugger.attach(debuggee, protocolVersion,
28 fail("Another debugger is already attached to the extension with id: " + 28 fail("Another debugger is already attached " +
29 debuggee.extensionId + ".")); 29 "to the background page with id: " + debuggee.extensionId + "."));
30 }, 30 },
31 31
32 function detach() { 32 function detach() {
33 chrome.debugger.detach(debuggee, pass()); 33 chrome.debugger.detach(debuggee, pass());
34 }, 34 },
35 35
36 function detachAgain() { 36 function detachAgain() {
37 chrome.debugger.detach(debuggee, 37 chrome.debugger.detach(debuggee,
38 fail("Debugger is not attached to the extension with id: " + 38 fail("Debugger is not attached to the background page with id: " +
39 debuggee.extensionId + ".")); 39 debuggee.extensionId + "."));
40 } 40 }
41 ]); 41 ]);
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/debugger/background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698