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

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

Issue 333223003: DevTools: fixed test ExtensionApiTest.Debugger (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed "MAYBE" Created 6 years, 6 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/browser/extensions/api/debugger/debugger_apitest.cc ('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) 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 if (target) { 133 if (target) {
134 chrome.debugger.attach({targetId: target.id}, protocolVersion, 134 chrome.debugger.attach({targetId: target.id}, protocolVersion,
135 fail(SILENT_FLAG_REQUIRED)); 135 fail(SILENT_FLAG_REQUIRED));
136 } else { 136 } else {
137 chrome.test.succeed(); 137 chrome.test.succeed();
138 } 138 }
139 }); 139 });
140 }, 140 },
141 141
142 function createAndDiscoverTab() { 142 function createAndDiscoverTab() {
143 function onUpdated(tabId) { 143 function onUpdated(tabId, changeInfo) {
144 if (changeInfo.status == 'loading')
145 return;
144 chrome.tabs.onUpdated.removeListener(onUpdated); 146 chrome.tabs.onUpdated.removeListener(onUpdated);
145 chrome.debugger.getTargets(function(targets) { 147 chrome.debugger.getTargets(function(targets) {
146 var page = targets.filter( 148 var page = targets.filter(
147 function(t) { 149 function(t) {
148 return t.type == 'page' && 150 return t.type == 'page' &&
149 t.tabId == tabId && 151 t.tabId == tabId &&
150 t.title == 'Test page'; 152 t.title == 'Test page';
151 })[0]; 153 })[0];
152 if (page) { 154 if (page) {
153 chrome.debugger.attach( 155 chrome.debugger.attach(
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 function onAttach() { 200 function onAttach() {
199 chrome.debugger.sendCommand(debuggee, "Page.enable"); 201 chrome.debugger.sendCommand(debuggee, "Page.enable");
200 chrome.debugger.sendCommand( 202 chrome.debugger.sendCommand(
201 debuggee, "Page.navigate", {url:"about:blank"}, onNavigateDone); 203 debuggee, "Page.navigate", {url:"about:blank"}, onNavigateDone);
202 } 204 }
203 205
204 chrome.debugger.attach(debuggee, protocolVersion, onAttach); 206 chrome.debugger.attach(debuggee, protocolVersion, onAttach);
205 }); 207 });
206 } 208 }
207 ]); 209 ]);
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/debugger/debugger_apitest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698