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

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

Issue 439843002: Merge 280354 "Have the Debugger extension api check that it has ..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/2062/src/
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 tabId; 8 var tabId;
9 var debuggee; 9 var debuggee;
10 var protocolVersion = "1.1"; 10 var protocolVersion = "1.1";
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 chrome.debugger.onDetach.addListener(onDetach); 101 chrome.debugger.onDetach.addListener(onDetach);
102 chrome.tabs.remove(tab.id); 102 chrome.tabs.remove(tab.id);
103 }); 103 });
104 }); 104 });
105 }, 105 },
106 106
107 function attachToWebUI() { 107 function attachToWebUI() {
108 chrome.tabs.create({url:"chrome://version"}, function(tab) { 108 chrome.tabs.create({url:"chrome://version"}, function(tab) {
109 var debuggee = {tabId: tab.id}; 109 var debuggee = {tabId: tab.id};
110 chrome.debugger.attach(debuggee, protocolVersion, 110 chrome.debugger.attach(debuggee, protocolVersion,
111 fail("Can not attach to the page with the \"chrome://\" scheme.")); 111 fail("Cannot access a chrome:// URL"));
112 chrome.tabs.remove(tab.id); 112 chrome.tabs.remove(tab.id);
113 }); 113 });
114 }, 114 },
115 115
116 function attachToMissing() { 116 function attachToMissing() {
117 var missingDebuggee = {tabId: -1}; 117 var missingDebuggee = {tabId: -1};
118 chrome.debugger.attach(missingDebuggee, protocolVersion, 118 chrome.debugger.attach(missingDebuggee, protocolVersion,
119 fail("No tab with given id " + missingDebuggee.tabId + ".")); 119 fail("No tab with given id " + missingDebuggee.tabId + "."));
120 }, 120 },
121 121
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 function onAttach() { 200 function onAttach() {
201 chrome.debugger.sendCommand(debuggee, "Page.enable"); 201 chrome.debugger.sendCommand(debuggee, "Page.enable");
202 chrome.debugger.sendCommand( 202 chrome.debugger.sendCommand(
203 debuggee, "Page.navigate", {url:"about:blank"}, onNavigateDone); 203 debuggee, "Page.navigate", {url:"about:blank"}, onNavigateDone);
204 } 204 }
205 205
206 chrome.debugger.attach(debuggee, protocolVersion, onAttach); 206 chrome.debugger.attach(debuggee, protocolVersion, onAttach);
207 }); 207 });
208 } 208 }
209 ]); 209 ]);
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/debugger/debugger_extension_apitest.cc ('k') | extensions/common/permissions/permissions_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698