OLD | NEW |
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 17 matching lines...) Expand all Loading... |
28 | 28 |
29 var wsAddress = REMOTE_DEBUGGER_HOST + '/devtools/page/' + target.id; | 29 var wsAddress = REMOTE_DEBUGGER_HOST + '/devtools/page/' + target.id; |
30 | 30 |
31 chrome.test.assertEq( | 31 chrome.test.assertEq( |
32 '/devtools/inspector.html?ws=' + wsAddress, | 32 '/devtools/inspector.html?ws=' + wsAddress, |
33 target.devtoolsFrontendUrl); | 33 target.devtoolsFrontendUrl); |
34 // On some platforms (e.g. Chrome OS) target.faviconUrl might be empty for | 34 // On some platforms (e.g. Chrome OS) target.faviconUrl might be empty for |
35 // a freshly created tab. Ignore the check then. | 35 // a freshly created tab. Ignore the check then. |
36 if (target.faviconUrl && opt_faviconUrl) | 36 if (target.faviconUrl && opt_faviconUrl) |
37 chrome.test.assertEq(opt_faviconUrl, target.faviconUrl); | 37 chrome.test.assertEq(opt_faviconUrl, target.faviconUrl); |
38 // Sometimes thumbnailUrl is not available for a freshly loaded tab. | |
39 if (target.thumbnailUrl) | |
40 chrome.test.assertEq('/thumb/' + target.id, target.thumbnailUrl); | |
41 chrome.test.assertEq(opt_title || target.url, target.title); | 38 chrome.test.assertEq(opt_title || target.url, target.title); |
42 chrome.test.assertEq(type, target.type); | 39 chrome.test.assertEq(type, target.type); |
43 chrome.test.assertEq('ws://' + wsAddress, target.webSocketDebuggerUrl); | 40 chrome.test.assertEq('ws://' + wsAddress, target.webSocketDebuggerUrl); |
44 | 41 |
45 return target; | 42 return target; |
46 } | 43 } |
47 | 44 |
48 function waitForTab(filter, callback) { | 45 function waitForTab(filter, callback) { |
49 var fired = false; | 46 var fired = false; |
50 function onUpdated(updatedTabId, changeInfo, updatedTab) { | 47 function onUpdated(updatedTabId, changeInfo, updatedTab) { |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 }, | 239 }, |
243 | 240 |
244 function newSpecificPage() { | 241 function newSpecificPage() { |
245 runNewPageTest('/json/new?chrome://version/', "chrome://version/"); | 242 runNewPageTest('/json/new?chrome://version/', "chrome://version/"); |
246 }, | 243 }, |
247 | 244 |
248 function newDefaultPage() { | 245 function newDefaultPage() { |
249 runNewPageTest('/json/new', "about:blank"); | 246 runNewPageTest('/json/new', "about:blank"); |
250 } | 247 } |
251 ]); | 248 ]); |
OLD | NEW |