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

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

Issue 16268017: GTTF: convert some tests in chrome to use EmbeddedTestServer patch nr 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 assertEq = chrome.test.assertEq; 5 var assertEq = chrome.test.assertEq;
6 var assertTrue = chrome.test.assertTrue; 6 var assertTrue = chrome.test.assertTrue;
7 var pass = chrome.test.callbackPass; 7 var pass = chrome.test.callbackPass;
8 var callbackFail = chrome.test.callbackFail; 8 var callbackFail = chrome.test.callbackFail;
9 var listenForever = chrome.test.listenForever; 9 var listenForever = chrome.test.listenForever;
10 10
11 var testTabId; 11 var testTabId;
12 var port; 12 var port;
13 13
14 function testUrl(domain) { 14 function testUrl(domain) {
15 return 'http://' + domain + ':' + port + 15 return 'http://' + domain + ':' + port +
16 '/files/extensions/test_file.html'; 16 '/extensions/test_file.html';
17 } 17 }
18 18
19 function error(domain) { 19 function error(domain) {
20 return 'Cannot access contents of url "' + testUrl(domain) + '".' + 20 return 'Cannot access contents of url "' + testUrl(domain) + '".' +
21 ' Extension manifest must request permission to access this host.'; 21 ' Extension manifest must request permission to access this host.';
22 } 22 }
23 23
24 // Creates a new tab, navigated to the specified |domain|. 24 // Creates a new tab, navigated to the specified |domain|.
25 function createTestTab(domain, callback) { 25 function createTestTab(domain, callback) {
26 var createdTabId = -1; 26 var createdTabId = -1;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 tab.id, {code: 'document.title = "success"'}, 103 tab.id, {code: 'document.title = "success"'},
104 pass(function() { 104 pass(function() {
105 chrome.tabs.get(tab.id, pass(function(tab) { 105 chrome.tabs.get(tab.id, pass(function(tab) {
106 assertEq('success', tab.title); 106 assertEq('success', tab.title);
107 })); 107 }));
108 })); 108 }));
109 })); 109 }));
110 } 110 }
111 ]); 111 ]);
112 }); 112 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698