| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 pass = chrome.test.callbackPass; | 5 var pass = chrome.test.callbackPass; |
| 6 var assertEq = chrome.test.assertEq; | 6 var assertEq = chrome.test.assertEq; |
| 7 var assertTrue = chrome.test.assertTrue; | 7 var assertTrue = chrome.test.assertTrue; |
| 8 | 8 |
| 9 var win, tab; | 9 var win, tab; |
| 10 var inIncognitoContext = chrome.extension.inIncognitoContext; | 10 var inIncognitoContext = chrome.extension.inIncognitoContext; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 // Test that chrome.extension.inIncognitoContext is true for incognito | 94 // Test that chrome.extension.inIncognitoContext is true for incognito |
| 95 // tabs. | 95 // tabs. |
| 96 chrome.tabs.create({windowId: win.id, url: testUrl}, | 96 chrome.tabs.create({windowId: win.id, url: testUrl}, |
| 97 pass(function(tab) { | 97 pass(function(tab) { |
| 98 chrome.tabs.executeScript(tab.id, | 98 chrome.tabs.executeScript(tab.id, |
| 99 {code: 'chrome.extension.sendRequest({' + | 99 {code: 'chrome.extension.sendRequest({' + |
| 100 ' inIncognitoContext: chrome.extension.inIncognitoContext' + | 100 ' inIncognitoContext: chrome.extension.inIncognitoContext' + |
| 101 '});'}, | 101 '});'}, |
| 102 pass(function() { | 102 pass(function() { |
| 103 assertEq(undefined, chrome.extension.lastError); | 103 assertEq(undefined, chrome.runtime.lastError); |
| 104 })); | 104 })); |
| 105 })); | 105 })); |
| 106 | 106 |
| 107 var done = chrome.test.listenForever(chrome.extension.onRequest, | 107 var done = chrome.test.listenForever(chrome.extension.onRequest, |
| 108 function(request, sender, sendResponse) { | 108 function(request, sender, sendResponse) { |
| 109 assertEq(inIncognitoContext, request.inIncognitoContext); | 109 assertEq(inIncognitoContext, request.inIncognitoContext); |
| 110 sendResponse(); | 110 sendResponse(); |
| 111 done(); | 111 done(); |
| 112 }); | 112 }); |
| 113 }, | 113 }, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 147 |
| 148 // Tests that we can set cookies in both processes. | 148 // Tests that we can set cookies in both processes. |
| 149 function setDocumentCookie() { | 149 function setDocumentCookie() { |
| 150 document.cookie = "k=v"; | 150 document.cookie = "k=v"; |
| 151 chrome.test.assertTrue(document.cookie.indexOf("k=v") != -1); | 151 chrome.test.assertTrue(document.cookie.indexOf("k=v") != -1); |
| 152 chrome.test.succeed(); | 152 chrome.test.succeed(); |
| 153 } | 153 } |
| 154 ]); | 154 ]); |
| 155 | 155 |
| 156 }); | 156 }); |
| OLD | NEW |