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 30 matching lines...) Expand all Loading... |
41 }, | 41 }, |
42 | 42 |
43 function attachAgain() { | 43 function attachAgain() { |
44 chrome.debugger.attach(debuggee, protocolVersion, | 44 chrome.debugger.attach(debuggee, protocolVersion, |
45 fail("Another debugger is already attached to the tab with id: " + | 45 fail("Another debugger is already attached to the tab with id: " + |
46 tabId + ".")); | 46 tabId + ".")); |
47 }, | 47 }, |
48 | 48 |
49 function sendCommand() { | 49 function sendCommand() { |
50 function onResponse() { | 50 function onResponse() { |
51 if (chrome.extension.lastError && | 51 if (chrome.runtime.lastError && |
52 chrome.extension.lastError.message.indexOf("invalidMethod") != -1) | 52 chrome.runtime.lastError.message.indexOf("invalidMethod") != -1) |
53 chrome.test.succeed(); | 53 chrome.test.succeed(); |
54 else | 54 else |
55 chrome.test.fail(); | 55 chrome.test.fail(); |
56 } | 56 } |
57 chrome.debugger.sendCommand(debuggee, | 57 chrome.debugger.sendCommand(debuggee, |
58 "invalidMethod", | 58 "invalidMethod", |
59 null, | 59 null, |
60 onResponse); | 60 onResponse); |
61 }, | 61 }, |
62 | 62 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 ]); | 103 ]); |
OLD | NEW |