| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 ui_test_utils::OpenURLOffTheRecord( | 162 ui_test_utils::OpenURLOffTheRecord( |
| 163 browser()->profile(), | 163 browser()->profile(), |
| 164 test_server()->GetURL("files/extensions/test_file.html")); | 164 test_server()->GetURL("files/extensions/test_file.html")); |
| 165 | 165 |
| 166 ASSERT_TRUE(LoadExtension(test_data_dir_ | 166 ASSERT_TRUE(LoadExtension(test_data_dir_ |
| 167 .AppendASCII("incognito").AppendASCII("apis_disabled"))); | 167 .AppendASCII("incognito").AppendASCII("apis_disabled"))); |
| 168 | 168 |
| 169 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 169 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 170 } | 170 } |
| 171 | 171 |
| 172 #if defined(OS_WIN) |
| 173 // http://crbug.com/104438. |
| 174 #define MAYBE_IncognitoPopup DISABLED_IncognitoPopup |
| 175 #else |
| 176 #define MAYBE_IncognitoPopup IncognitoPopup |
| 177 #endif |
| 172 // Test that opening a popup from an incognito browser window works properly. | 178 // Test that opening a popup from an incognito browser window works properly. |
| 173 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, IncognitoPopup) { | 179 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_IncognitoPopup) { |
| 174 host_resolver()->AddRule("*", "127.0.0.1"); | 180 host_resolver()->AddRule("*", "127.0.0.1"); |
| 175 ASSERT_TRUE(StartTestServer()); | 181 ASSERT_TRUE(StartTestServer()); |
| 176 | 182 |
| 177 ResultCatcher catcher; | 183 ResultCatcher catcher; |
| 178 | 184 |
| 179 ASSERT_TRUE(LoadExtensionIncognito(test_data_dir_ | 185 ASSERT_TRUE(LoadExtensionIncognito(test_data_dir_ |
| 180 .AppendASCII("incognito").AppendASCII("popup"))); | 186 .AppendASCII("incognito").AppendASCII("popup"))); |
| 181 | 187 |
| 182 // Open incognito window and navigate to test page. | 188 // Open incognito window and navigate to test page. |
| 183 ui_test_utils::OpenURLOffTheRecord( | 189 ui_test_utils::OpenURLOffTheRecord( |
| 184 browser()->profile(), | 190 browser()->profile(), |
| 185 test_server()->GetURL("files/extensions/test_file.html")); | 191 test_server()->GetURL("files/extensions/test_file.html")); |
| 186 | 192 |
| 187 Browser* incognito_browser = BrowserList::FindTabbedBrowser( | 193 Browser* incognito_browser = BrowserList::FindTabbedBrowser( |
| 188 browser()->profile()->GetOffTheRecordProfile(), false); | 194 browser()->profile()->GetOffTheRecordProfile(), false); |
| 189 | 195 |
| 190 // Simulate the incognito's browser action being clicked. | 196 // Simulate the incognito's browser action being clicked. |
| 191 BrowserActionTestUtil(incognito_browser).Press(0); | 197 BrowserActionTestUtil(incognito_browser).Press(0); |
| 192 | 198 |
| 193 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 199 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 194 } | 200 } |
| OLD | NEW |