| Index: chrome/browser/extensions/extension_incognito_apitest.cc
|
| diff --git a/chrome/browser/extensions/extension_incognito_apitest.cc b/chrome/browser/extensions/extension_incognito_apitest.cc
|
| index dbc9234c51b3b59146dc078716a59e558d7e1d28..8a138b98294bf8610bda34babc40549f00e6fc78 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.
|
| IN_PROC_BROWSER_TEST_F(ExtensionApiTest, IncognitoDisabled) {
|
|
|