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

Side by Side Diff: chrome/test/data/devtools/target_list/background.js

Issue 824693003: [DevTools] Fix RemoteDebuggingTest.RemoteDebugger (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 REMOTE_DEBUGGER_HOST = 'localhost:9222'; 5 var REMOTE_DEBUGGER_HOST = 'localhost:9222';
6 6
7 function requestUrl(path, callback) { 7 function requestUrl(path, callback) {
8 var req = new XMLHttpRequest(); 8 var req = new XMLHttpRequest();
9 req.open('GET', 'http://' + REMOTE_DEBUGGER_HOST + path, true); 9 req.open('GET', 'http://' + REMOTE_DEBUGGER_HOST + path, true);
10 req.onload = function() { 10 req.onload = function() {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 var extensionTargetId; 118 var extensionTargetId;
119 var extensionTabId; 119 var extensionTabId;
120 var extensionDevtoolsFrontendUrl; 120 var extensionDevtoolsFrontendUrl;
121 var extensionWebSocketDebuggerUrl; 121 var extensionWebSocketDebuggerUrl;
122 122
123 chrome.test.runTests([ 123 chrome.test.runTests([
124 function discoverTargets() { 124 function discoverTargets() {
125 var testPageUrl = chrome.extension.getURL('test_page.html'); 125 var testPageUrl = chrome.extension.getURL('test_page.html');
126 126
127 function onUpdated(updatedTabId) { 127 chrome.tabs.create({url: testPageUrl});
128 requestUrl('/json', function(text) { 128 waitForTab(
129 var targets = JSON.parse(text); 129 function(tab) {
130 waitForTab( 130 return tab.url == testPageUrl && tab.status == "complete";
131 function(tab) { 131 },
132 return tab.id == updatedTabId && tab.status == "complete" 132 function() {
133 }, 133 requestUrl('/json', function(text) {
134 function() { 134 var targets = JSON.parse(text);
135 checkTarget(targets, 'about:blank', 'page'); 135 checkTarget(targets, 'about:blank', 'page');
136 checkTarget(targets, 136 checkTarget(targets,
137 chrome.extension.getURL('_generated_background_page.html'), 137 chrome.extension.getURL('_generated_background_page.html'),
138 'background_page', 138 'background_page',
139 'Remote Debugger Test'); 139 'Remote Debugger Test');
140 var target = checkTarget(targets, 140 var target = checkTarget(targets,
141 testPageUrl, 'page', 'Test page', 141 testPageUrl, 'page', 'Test page',
142 chrome.extension.getURL('favicon.png')); 142 chrome.extension.getURL('favicon.png'));
143 143
144 extensionTargetId = target.id; 144 extensionTargetId = target.id;
145 extensionDevtoolsFrontendUrl = target.devtoolsFrontendUrl; 145 extensionDevtoolsFrontendUrl = target.devtoolsFrontendUrl;
146 extensionWebSocketDebuggerUrl = target.webSocketDebuggerUrl; 146 extensionWebSocketDebuggerUrl = target.webSocketDebuggerUrl;
147 147
148 chrome.test.succeed(); 148 chrome.test.succeed();
149 }); 149 });
150 }); 150 });
151 }
152 listenOnce(chrome.tabs.onUpdated, onUpdated);
153 chrome.tabs.create({url: testPageUrl});
154 }, 151 },
155 152
156 function versionInfo() { 153 function versionInfo() {
157 requestUrl('/json/version', 154 requestUrl('/json/version',
158 function(text) { 155 function(text) {
159 var versionInfo = JSON.parse(text); 156 var versionInfo = JSON.parse(text);
160 chrome.test.assertTrue(/^Chrome\//.test(versionInfo["Browser"])); 157 chrome.test.assertTrue(/^Chrome\//.test(versionInfo["Browser"]));
161 chrome.test.assertTrue("Protocol-Version" in versionInfo); 158 chrome.test.assertTrue("Protocol-Version" in versionInfo);
162 chrome.test.assertTrue("User-Agent" in versionInfo); 159 chrome.test.assertTrue("User-Agent" in versionInfo);
163 chrome.test.assertTrue("WebKit-Version" in versionInfo); 160 chrome.test.assertTrue("WebKit-Version" in versionInfo);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 }, 242 },
246 243
247 function newSpecificPage() { 244 function newSpecificPage() {
248 runNewPageTest('/json/new?chrome://version/', "chrome://version/"); 245 runNewPageTest('/json/new?chrome://version/', "chrome://version/");
249 }, 246 },
250 247
251 function newDefaultPage() { 248 function newDefaultPage() {
252 runNewPageTest('/json/new', "about:blank"); 249 runNewPageTest('/json/new', "about:blank");
253 } 250 }
254 ]); 251 ]);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698