OLD | NEW |
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 assertFalse = chrome.test.assertFalse; | 6 var assertFalse = chrome.test.assertFalse; |
7 var assertTrue = chrome.test.assertTrue; | 7 var assertTrue = chrome.test.assertTrue; |
8 var fail = chrome.test.callbackFail; | 8 var fail = chrome.test.callbackFail; |
9 var pass = chrome.test.callbackPass; | 9 var pass = chrome.test.callbackPass; |
10 var listenOnce = chrome.test.listenOnce; | 10 var listenOnce = chrome.test.listenOnce; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 function checkPermSetsEq(set1, set2) { | 53 function checkPermSetsEq(set1, set2) { |
54 return checkEqualSets(set1.permissions, set2.permissions) && | 54 return checkEqualSets(set1.permissions, set2.permissions) && |
55 checkEqualSets(set1.origins, set2.origins); | 55 checkEqualSets(set1.origins, set2.origins); |
56 } | 56 } |
57 | 57 |
58 chrome.test.getConfig(function(config) { | 58 chrome.test.getConfig(function(config) { |
59 | 59 |
60 function doReq(domain, callback) { | 60 function doReq(domain, callback) { |
61 var req = new XMLHttpRequest(); | 61 var req = new XMLHttpRequest(); |
62 var url = domain + ":PORT/files/extensions/test_file.txt"; | 62 var url = domain + ":PORT/extensions/test_file.txt"; |
63 url = url.replace(/PORT/, config.testServer.port); | 63 url = url.replace(/PORT/, config.testServer.port); |
64 | 64 |
65 chrome.test.log("Requesting url: " + url); | 65 chrome.test.log("Requesting url: " + url); |
66 req.open("GET", url, true); | 66 req.open("GET", url, true); |
67 | 67 |
68 req.onload = function() { | 68 req.onload = function() { |
69 assertEq(200, req.status); | 69 assertEq(200, req.status); |
70 assertEq("Hello!", req.responseText); | 70 assertEq("Hello!", req.responseText); |
71 callback(true); | 71 callback(true); |
72 }; | 72 }; |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 assertTrue(granted); | 295 assertTrue(granted); |
296 chrome.permissions.remove( | 296 chrome.permissions.remove( |
297 {permissions: ['bookmarks']}, pass(function() { | 297 {permissions: ['bookmarks']}, pass(function() { |
298 assertTrue(true); | 298 assertTrue(true); |
299 })); | 299 })); |
300 })); | 300 })); |
301 } | 301 } |
302 | 302 |
303 ]); | 303 ]); |
304 }); | 304 }); |
OLD | NEW |