OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/extensions/browser_action_test_util.h" | 5 #include "chrome/browser/extensions/browser_action_test_util.h" |
6 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
7 #include "chrome/browser/extensions/extension_service.h" | 7 #include "chrome/browser/extensions/extension_service.h" |
8 #include "chrome/browser/extensions/extension_test_message_listener.h" | 8 #include "chrome/browser/extensions/extension_test_message_listener.h" |
9 #include "chrome/browser/extensions/user_script_master.h" | 9 #include "chrome/browser/extensions/user_script_master.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 embedded_test_server()->GetURL("/extensions/test_file.html")); | 113 embedded_test_server()->GetURL("/extensions/test_file.html")); |
114 | 114 |
115 ASSERT_TRUE(LoadExtensionIncognito(test_data_dir_ | 115 ASSERT_TRUE(LoadExtensionIncognito(test_data_dir_ |
116 .AppendASCII("incognito").AppendASCII("apis"))); | 116 .AppendASCII("incognito").AppendASCII("apis"))); |
117 | 117 |
118 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 118 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
119 } | 119 } |
120 | 120 |
121 // Tests that the APIs in an incognito-enabled split-mode extension work | 121 // Tests that the APIs in an incognito-enabled split-mode extension work |
122 // properly. | 122 // properly. |
123 #if defined(OS_WIN) | |
124 // http://crbug.com/120484 | 123 // http://crbug.com/120484 |
125 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_IncognitoSplitMode) { | 124 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_IncognitoSplitMode) { |
126 #else | |
127 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, IncognitoSplitMode) { | |
128 #endif | |
129 host_resolver()->AddRule("*", "127.0.0.1"); | 125 host_resolver()->AddRule("*", "127.0.0.1"); |
130 ASSERT_TRUE(StartEmbeddedTestServer()); | 126 ASSERT_TRUE(StartEmbeddedTestServer()); |
131 | 127 |
132 // We need 2 ResultCatchers because we'll be running the same test in both | 128 // We need 2 ResultCatchers because we'll be running the same test in both |
133 // regular and incognito mode. | 129 // regular and incognito mode. |
134 ResultCatcher catcher; | 130 ResultCatcher catcher; |
135 catcher.RestrictToProfile(browser()->profile()); | 131 catcher.RestrictToProfile(browser()->profile()); |
136 ResultCatcher catcher_incognito; | 132 ResultCatcher catcher_incognito; |
137 catcher_incognito.RestrictToProfile( | 133 catcher_incognito.RestrictToProfile( |
138 browser()->profile()->GetOffTheRecordProfile()); | 134 browser()->profile()->GetOffTheRecordProfile()); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 // Open incognito window and navigate to test page. | 203 // Open incognito window and navigate to test page. |
208 Browser* incognito_browser = ui_test_utils::OpenURLOffTheRecord( | 204 Browser* incognito_browser = ui_test_utils::OpenURLOffTheRecord( |
209 browser()->profile(), | 205 browser()->profile(), |
210 embedded_test_server()->GetURL("/extensions/test_file.html")); | 206 embedded_test_server()->GetURL("/extensions/test_file.html")); |
211 | 207 |
212 // Simulate the incognito's browser action being clicked. | 208 // Simulate the incognito's browser action being clicked. |
213 BrowserActionTestUtil(incognito_browser).Press(0); | 209 BrowserActionTestUtil(incognito_browser).Press(0); |
214 | 210 |
215 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 211 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
216 } | 212 } |
OLD | NEW |