OLD | NEW |
---|---|
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.0"; | 10 var protocolVersion = "1.0"; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
91 }); | 91 }); |
92 }, | 92 }, |
93 | 93 |
94 function attachToWebUI() { | 94 function attachToWebUI() { |
95 chrome.tabs.create({url:"chrome://version"}, function(tab) { | 95 chrome.tabs.create({url:"chrome://version"}, function(tab) { |
96 var debuggee = {tabId: tab.id}; | 96 var debuggee = {tabId: tab.id}; |
97 chrome.debugger.attach(debuggee, protocolVersion, | 97 chrome.debugger.attach(debuggee, protocolVersion, |
98 fail("Can not attach to the page with the \"chrome://\" scheme.")); | 98 fail("Can not attach to the page with the \"chrome://\" scheme.")); |
99 chrome.tabs.remove(tab.id); | 99 chrome.tabs.remove(tab.id); |
100 }); | 100 }); |
101 } | 101 }, |
102 | 102 |
103 function attachToMissing() { | |
104 var missingDebuggee = {tabId: -1}; | |
105 chrome.debugger.attach(missingDebuggee, protocolVersion, | |
106 fail("No tab with given id " + missingDebuggee.tabId + ".")); | |
107 }, | |
108 | |
109 function attachToExtension() { | |
pfeldman
2013/02/20 14:58:39
attachToExtensionWithNoSilentFlag
Vladislav Kaznacheev
2013/02/20 15:24:50
Done.
| |
110 debuggeeExtension = {extensionId: "foo"}; | |
111 chrome.debugger.attach(debuggeeExtension, protocolVersion, | |
112 fail("Cannot attach to an extension, " + | |
113 "--extension-debugging-silent command line option required.")); | |
114 }, | |
103 ]); | 115 ]); |
OLD | NEW |