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

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

Issue 2272503002: [DevTools] Protocol version 1.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more experimental Created 4 years, 3 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 | « no previous file | chrome/test/data/extensions/api_test/debugger_extension/background.js » ('j') | 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) 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.2";
11 var protocolPreviousVersion = "1.0"; 11 var protocolPreviousVersion = "1.1";
12 var unsupportedMinorProtocolVersion = "1.5";
13 var unsupportedMajorProtocolVersion = "100.0";
12 14
13 var SILENT_FLAG_REQUIRED = "Cannot attach to this target unless " + 15 var SILENT_FLAG_REQUIRED = "Cannot attach to this target unless " +
14 "'silent-debugger-extension-api' flag is enabled."; 16 "'silent-debugger-extension-api' flag is enabled.";
15 17
16 chrome.test.runTests([ 18 chrome.test.runTests([
17 19
18 function attachMalformedVersion() { 20 function attachMalformedVersion() {
19 chrome.tabs.getSelected(null, function(tab) { 21 chrome.tabs.getSelected(null, function(tab) {
20 chrome.debugger.attach({tabId: tab.id}, "malformed-version", fail( 22 chrome.debugger.attach({tabId: tab.id}, "malformed-version", fail(
21 "Requested protocol version is not supported: malformed-version.")); 23 "Requested protocol version is not supported: malformed-version."));
22 }); 24 });
23 }, 25 },
24 26
25 function attachUnsupportedMinorVersion() { 27 function attachUnsupportedMinorVersion() {
26 chrome.tabs.getSelected(null, function(tab) { 28 chrome.tabs.getSelected(null, function(tab) {
27 chrome.debugger.attach({tabId: tab.id}, "1.5", 29 chrome.debugger.attach({tabId: tab.id}, unsupportedMinorProtocolVersion,
28 fail("Requested protocol version is not supported: 1.5.")); 30 fail("Requested protocol version is not supported: " +
31 unsupportedMinorProtocolVersion + "."));
29 }); 32 });
30 }, 33 },
31 34
32 function attachUnsupportedVersion() { 35 function attachUnsupportedVersion() {
33 chrome.tabs.getSelected(null, function(tab) { 36 chrome.tabs.getSelected(null, function(tab) {
34 chrome.debugger.attach({tabId: tab.id}, "100.0", 37 chrome.debugger.attach({tabId: tab.id}, unsupportedMajorProtocolVersion,
35 fail("Requested protocol version is not supported: 100.0.")); 38 fail("Requested protocol version is not supported: " +
39 unsupportedMajorProtocolVersion + "."));
36 }); 40 });
37 }, 41 },
38 42
39 function attachPreviousVersion() { 43 function attachPreviousVersion() {
40 chrome.tabs.getSelected(null, function(tab) { 44 chrome.tabs.getSelected(null, function(tab) {
41 debuggee = {tabId: tab.id}; 45 debuggee = {tabId: tab.id};
42 chrome.debugger.attach(debuggee, protocolPreviousVersion, function() { 46 chrome.debugger.attach(debuggee, protocolPreviousVersion, function() {
43 chrome.debugger.detach(debuggee, pass()); 47 chrome.debugger.detach(debuggee, pass());
44 }); 48 });
45 }); 49 });
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 function onAttach() { 212 function onAttach() {
209 chrome.debugger.sendCommand(debuggee, "Page.enable"); 213 chrome.debugger.sendCommand(debuggee, "Page.enable");
210 chrome.debugger.sendCommand( 214 chrome.debugger.sendCommand(
211 debuggee, "Page.navigate", {url:"about:blank"}, onNavigateDone); 215 debuggee, "Page.navigate", {url:"about:blank"}, onNavigateDone);
212 } 216 }
213 217
214 chrome.debugger.attach(debuggee, protocolVersion, onAttach); 218 chrome.debugger.attach(debuggee, protocolVersion, onAttach);
215 }); 219 });
216 } 220 }
217 ]); 221 ]);
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/debugger_extension/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698