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 callbackFail = chrome.test.callbackFail; | 8 var callbackFail = chrome.test.callbackFail; |
9 var callbackPass = chrome.test.callbackPass; | 9 var callbackPass = chrome.test.callbackPass; |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 'document.body.appendChild(iframe);\n'; | 43 'document.body.appendChild(iframe);\n'; |
44 | 44 |
45 chrome.browserAction.onClicked.addListener(function(tab) { | 45 chrome.browserAction.onClicked.addListener(function(tab) { |
46 iframeDone = chrome.test.callbackAdded(); | 46 iframeDone = chrome.test.callbackAdded(); |
47 cachedUrl = tab.url; | 47 cachedUrl = tab.url; |
48 chrome.tabs.executeScript({ code: injectIframe }, callbackPass()); | 48 chrome.tabs.executeScript({ code: injectIframe }, callbackPass()); |
49 assertTrue(canXhr(tab.url)); | 49 assertTrue(canXhr(tab.url)); |
50 | 50 |
51 chrome.automation.getTree(callbackPass(function(rootNode) { | 51 chrome.automation.getTree(callbackPass(function(rootNode) { |
52 assertFalse(rootNode == undefined); | 52 assertFalse(rootNode == undefined); |
53 assertEq(RoleType.rootWebArea, rootNode.role); | 53 assertEq(RoleType.ROOT_WEB_AREA, rootNode.role); |
54 })); | 54 })); |
55 }); | 55 }); |
56 | 56 |
57 chrome.webNavigation.onCompleted.addListener(function(details) { | 57 chrome.webNavigation.onCompleted.addListener(function(details) { |
58 chrome.tabs.executeScript({ code: 'true' }, callbackFail( | 58 chrome.tabs.executeScript({ code: 'true' }, callbackFail( |
59 'Cannot access contents of the page. ' + | 59 'Cannot access contents of the page. ' + |
60 'Extension manifest must request permission to access the ' + | 60 'Extension manifest must request permission to access the ' + |
61 'respective host.')); | 61 'respective host.')); |
62 | 62 |
63 chrome.automation.getTree(callbackFail( | 63 chrome.automation.getTree(callbackFail( |
64 'Cannot request automation tree on url "' + details.url + | 64 'Cannot request automation tree on url "' + details.url + |
65 '". Extension manifest must request permission to access this host.')); | 65 '". Extension manifest must request permission to access this host.')); |
66 | 66 |
67 assertFalse(canXhr(details.url)); | 67 assertFalse(canXhr(details.url)); |
68 }); | 68 }); |
OLD | NEW |