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

Unified Diff: chrome/test/data/extensions/api_test/incognito/apis/background.js

Issue 1984573002: Prevent chrome.windows.create from moving a tab to another profile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Devlin's nits Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/incognito/apis/background.js
diff --git a/chrome/test/data/extensions/api_test/incognito/apis/background.js b/chrome/test/data/extensions/api_test/incognito/apis/background.js
index 640c2efb51a883fb30e627776fa8a2a66ff7090b..762f49cd2423d654ecfab235b4d2523d6b5b8845 100644
--- a/chrome/test/data/extensions/api_test/incognito/apis/background.js
+++ b/chrome/test/data/extensions/api_test/incognito/apis/background.js
@@ -126,6 +126,22 @@ chrome.test.getConfig(function(config) {
chrome.tabs.move(tab.id,
{windowId: incognitoWindow.id, index: 0}, fail(errorMsg));
}));
+ },
+
+ // Tests that it is not possible to create a new window with a tab from a
+ // different profile.
+ function createWindowWithTabFromOtherProfile() {
+ chrome.windows.create({
+ tabId: incognitoTab.id,
+ }, fail('Tabs can only be moved between windows in the same profile.'));
+ },
+
+ // Similarly, try to move a non-incognito tab to an incognito window.
+ function createWindowWithTabFromOtherProfile2() {
+ chrome.windows.create({
+ tabId: normalTab.id,
+ incognito: true,
+ }, fail('Tabs can only be moved between windows in the same profile.'));
}
]);
});
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698