diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 18:40:32 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 18:40:32 +0000 |
commit | bc535ee5bb4eece29f5d88bcc688613b3b208b27 (patch) | |
tree | 37b90c6bbbe98732c81515b35f02f8b835ac5df7 /chrome/browser/extensions/extension_incognito_apitest.cc | |
parent | 7566dbf757617f9e77f4a7f9f031402eb7818b04 (diff) | |
download | chromium_src-bc535ee5bb4eece29f5d88bcc688613b3b208b27.zip chromium_src-bc535ee5bb4eece29f5d88bcc688613b3b208b27.tar.gz chromium_src-bc535ee5bb4eece29f5d88bcc688613b3b208b27.tar.bz2 |
Add support for a "split" incognito behavior for extensions.
- On by default for apps, off by default for extensions.
- Split mode means "run incognito extensions in a separate process if the user
says OK, and the two processes can only see their own profile."
- Spanning mode is what we have now, and means "run a single extension process,
but allow it to access both profiles if the user says OK."
BUG=49232
BUG=49114
TEST=extensions still work in incognito when you check "Allow in Incognito".
Review URL: http://codereview.chromium.org/3210007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58033 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_incognito_apitest.cc')
-rw-r--r-- | chrome/browser/extensions/extension_incognito_apitest.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_incognito_apitest.cc b/chrome/browser/extensions/extension_incognito_apitest.cc index dd0abd4..41ddb99 100644 --- a/chrome/browser/extensions/extension_incognito_apitest.cc +++ b/chrome/browser/extensions/extension_incognito_apitest.cc @@ -95,6 +95,31 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Incognito) { EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); } +// Tests that the APIs in an incognito-enabled split-mode extension work +// properly. +IN_PROC_BROWSER_TEST_F(ExtensionApiTest, IncognitoSplitMode) { + host_resolver()->AddRule("*", "127.0.0.1"); + ASSERT_TRUE(test_server()->Start()); + + // We need 2 ResultCatchers because we'll be running the same test in both + // regular and incognito mode. + ResultCatcher catcher; + catcher.RestrictToProfile(browser()->profile()); + ResultCatcher catcher_incognito; + catcher_incognito.RestrictToProfile( + browser()->profile()->GetOffTheRecordProfile()); + + // Open incognito window and navigate to test page. + ui_test_utils::OpenURLOffTheRecord(browser()->profile(), + GURL("http://www.example.com:1337/files/extensions/test_file.html")); + + ASSERT_TRUE(LoadExtensionIncognito(test_data_dir_ + .AppendASCII("incognito").AppendASCII("split"))); + + EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); + EXPECT_TRUE(catcher_incognito.GetNextResult()) << catcher.message(); +} + // Tests that the APIs in an incognito-disabled extension don't see incognito // events or callbacks. // Hangy, http://crbug.com/53869. |