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

Side by Side Diff: chrome/test/data/extensions/api_test/incognito/apis/background.html

Issue 6330010: Prevent extensions from moving tabs between profiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 9 years, 10 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
« no previous file with comments | « chrome/browser/extensions/extension_tabs_module_constants.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <script> 1 <script>
2 var normalWindow, normalTab; 2 var normalWindow, normalTab;
3 var incognitoWindow, incognitoTab; 3 var incognitoWindow, incognitoTab;
4 4
5 var pass = chrome.test.callbackPass; 5 var pass = chrome.test.callbackPass;
6 var fail = chrome.test.callbackFail;
6 var assertEq = chrome.test.assertEq; 7 var assertEq = chrome.test.assertEq;
7 var assertTrue = chrome.test.assertTrue; 8 var assertTrue = chrome.test.assertTrue;
8 9
9 chrome.test.getConfig(function(config) { 10 chrome.test.getConfig(function(config) {
10 chrome.test.runTests([ 11 chrome.test.runTests([
11 function setupWindows() { 12 function setupWindows() {
12 // The test harness should have set us up with 2 windows: 1 incognito 13 // The test harness should have set us up with 2 windows: 1 incognito
13 // and 1 regular. Verify that we can see both when we ask for it. 14 // and 1 regular. Verify that we can see both when we ask for it.
14 chrome.windows.getAll({populate: true}, pass(function(windows) { 15 chrome.windows.getAll({populate: true}, pass(function(windows) {
15 assertEq(2, windows.length); 16 assertEq(2, windows.length);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 pass(function(tab) { 101 pass(function(tab) {
101 chrome.tabs.executeScript(tab.id, 102 chrome.tabs.executeScript(tab.id,
102 {code: 'document.title = chrome.extension.inIncognitoContext'}, 103 {code: 'document.title = chrome.extension.inIncognitoContext'},
103 pass(function() { 104 pass(function() {
104 assertEq(undefined, chrome.extension.lastError); 105 assertEq(undefined, chrome.extension.lastError);
105 chrome.tabs.get(tab.id, pass(function(tab) { 106 chrome.tabs.get(tab.id, pass(function(tab) {
106 assertEq("false", tab.title); 107 assertEq("false", tab.title);
107 })); 108 }));
108 })); 109 }));
109 })); 110 }));
111 },
112
113 // Tests that extensions can't move tabs between incognito and
114 // non-incognito windows.
115 function moveTabBetweenProfiles() {
116 var errorMsg = "Tabs can only be moved between " +
117 "windows in the same profile.";
118
119 // Create a tab in the non-incognito window...
120 chrome.tabs.create({windowId: normalWindow.id, url: 'about:blank'},
121 pass(function(tab) {
122 // ... and then try to move it to the incognito window.
123 chrome.tabs.move(tab.id,
124 {windowId: incognitoWindow.id, index: 0}, fail(errorMsg));
125 }));
110 } 126 }
111 ]); 127 ]);
112 }); 128 });
113 129
114 </script> 130 </script>
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_tabs_module_constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698