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

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

Issue 46523002: Fix Telemetry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « chrome/chrome.gyp ('k') | content/browser/devtools/devtools_http_handler_impl.cc » ('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) 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 function requestUrl(url, callback) { 5 function requestUrl(url, callback) {
6 var req = new XMLHttpRequest(); 6 var req = new XMLHttpRequest();
7 req.open('GET', url, true); 7 req.open('GET', url, true);
8 req.onload = function() { 8 req.onload = function() {
9 if (req.status == 200) 9 if (req.status == 200)
10 callback(req.responseText); 10 callback(req.responseText);
(...skipping 14 matching lines...) Expand all
25 if (!target) 25 if (!target)
26 chrome.test.fail('Cannot find a target with url ' + url); 26 chrome.test.fail('Cannot find a target with url ' + url);
27 27
28 var wsAddress = REMOTE_DEBUGGER_HOST + '/devtools/page/' + target.id; 28 var wsAddress = REMOTE_DEBUGGER_HOST + '/devtools/page/' + target.id;
29 29
30 chrome.test.assertEq( 30 chrome.test.assertEq(
31 '/devtools/devtools.html?ws=' + wsAddress, 31 '/devtools/devtools.html?ws=' + wsAddress,
32 target.devtoolsFrontendUrl); 32 target.devtoolsFrontendUrl);
33 // On some platforms (e.g. Chrome OS) target.faviconUrl might be empty for 33 // On some platforms (e.g. Chrome OS) target.faviconUrl might be empty for
34 // a freshly created tab. Ignore the check then. 34 // a freshly created tab. Ignore the check then.
35 if (target.faviconUrl && opt_faviconUrl) 35 if (target.faviconUrl)
36 chrome.test.assertEq(opt_faviconUrl, target.faviconUrl); 36 chrome.test.assertEq(opt_faviconUrl, target.faviconUrl);
37 // Sometimes thumbnailUrl is not available for a freshly loaded tab. 37 // Sometimes thumbnailUrl is not available for a freshly loaded tab.
38 if (target.thumbnailUrl) 38 if (target.thumbnailUrl)
39 chrome.test.assertEq('/thumb/' + target.id, target.thumbnailUrl); 39 chrome.test.assertEq('/thumb/' + target.id, target.thumbnailUrl);
40 chrome.test.assertEq(opt_title || target.url, target.title); 40 chrome.test.assertEq(opt_title || target.url, target.title);
41 chrome.test.assertEq(type, target.type); 41 chrome.test.assertEq(type, target.type);
42 chrome.test.assertEq('ws://' + wsAddress, target.webSocketDebuggerUrl); 42 chrome.test.assertEq('ws://' + wsAddress, target.webSocketDebuggerUrl);
43 } 43 }
44 44
45 chrome.test.runTests([ 45 chrome.test.runTests([
46 function discoverTargets() { 46 function discoverTargets() {
47 var testPageUrl = chrome.extension.getURL('test_page.html'); 47 var testPageUrl = chrome.extension.getURL('test_page.html');
48 48
49 function onUpdated() { 49 function onUpdated() {
50 chrome.tabs.onUpdated.removeListener(onUpdated); 50 chrome.tabs.onUpdated.removeListener(onUpdated);
51 requestUrl('http://' + REMOTE_DEBUGGER_HOST + '/json', function(text) { 51 requestUrl('http://' + REMOTE_DEBUGGER_HOST + '/json', function(text) {
52 var targets = JSON.parse(text); 52 var targets = JSON.parse(text);
53 53
54 checkTarget(targets, 'about:blank', 'page'); 54 checkTarget(targets, 'about:blank', 'page');
55 checkTarget(targets, testPageUrl, 'page', 'Test page', 55 checkTarget(targets, testPageUrl, 'page', 'Test page',
56 chrome.extension.getURL('favicon.png')); 56 chrome.extension.getURL('favicon.png'));
57 checkTarget(targets, 57 checkTarget(targets,
58 chrome.extension.getURL('_generated_background_page.html'), 58 chrome.extension.getURL('_generated_background_page.html'),
59 'background_page', 59 'other');
60 'Remote Debugger Test');
61 60
62 chrome.test.succeed(); 61 chrome.test.succeed();
63 }); 62 });
64 } 63 }
65 chrome.tabs.onUpdated.addListener(onUpdated); 64 chrome.tabs.onUpdated.addListener(onUpdated);
66 chrome.tabs.create({url: testPageUrl}); 65 chrome.tabs.create({url: testPageUrl});
67 } 66 }
68 ]); 67 ]);
OLDNEW
« no previous file with comments | « chrome/chrome.gyp ('k') | content/browser/devtools/devtools_http_handler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698