OLD | NEW |
1 // Copyright (c) 2011 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" |
11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // accidentially create and incognito profile. | 85 // accidentially create and incognito profile. |
86 // Test disabled due to http://crbug.com/89054. | 86 // Test disabled due to http://crbug.com/89054. |
87 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_DontCreateIncognitoProfile) { | 87 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_DontCreateIncognitoProfile) { |
88 ASSERT_FALSE(browser()->profile()->HasOffTheRecordProfile()); | 88 ASSERT_FALSE(browser()->profile()->HasOffTheRecordProfile()); |
89 ASSERT_TRUE(RunExtensionTestIncognito( | 89 ASSERT_TRUE(RunExtensionTestIncognito( |
90 "incognito/dont_create_profile")) << message_; | 90 "incognito/dont_create_profile")) << message_; |
91 ASSERT_FALSE(browser()->profile()->HasOffTheRecordProfile()); | 91 ASSERT_FALSE(browser()->profile()->HasOffTheRecordProfile()); |
92 } | 92 } |
93 | 93 |
94 #if defined(OS_WIN) | 94 #if defined(OS_WIN) |
| 95 // http://crbug.com/120484 |
95 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_Incognito) { | 96 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_Incognito) { |
96 #else | 97 #else |
97 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Incognito) { | 98 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Incognito) { |
98 #endif | 99 #endif |
99 host_resolver()->AddRule("*", "127.0.0.1"); | 100 host_resolver()->AddRule("*", "127.0.0.1"); |
100 ASSERT_TRUE(StartTestServer()); | 101 ASSERT_TRUE(StartTestServer()); |
101 | 102 |
102 ResultCatcher catcher; | 103 ResultCatcher catcher; |
103 | 104 |
104 // Open incognito window and navigate to test page. | 105 // Open incognito window and navigate to test page. |
105 ui_test_utils::OpenURLOffTheRecord( | 106 ui_test_utils::OpenURLOffTheRecord( |
106 browser()->profile(), | 107 browser()->profile(), |
107 test_server()->GetURL("files/extensions/test_file.html")); | 108 test_server()->GetURL("files/extensions/test_file.html")); |
108 | 109 |
109 ASSERT_TRUE(LoadExtensionIncognito(test_data_dir_ | 110 ASSERT_TRUE(LoadExtensionIncognito(test_data_dir_ |
110 .AppendASCII("incognito").AppendASCII("apis"))); | 111 .AppendASCII("incognito").AppendASCII("apis"))); |
111 | 112 |
112 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 113 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
113 } | 114 } |
114 | 115 |
115 // Tests that the APIs in an incognito-enabled split-mode extension work | 116 // Tests that the APIs in an incognito-enabled split-mode extension work |
116 // properly. | 117 // properly. |
117 #if defined(OS_WIN) | 118 #if defined(OS_WIN) |
| 119 // http://crbug.com/120484 |
118 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_IncognitoSplitMode) { | 120 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_IncognitoSplitMode) { |
119 #else | 121 #else |
120 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, IncognitoSplitMode) { | 122 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, IncognitoSplitMode) { |
121 #endif | 123 #endif |
122 host_resolver()->AddRule("*", "127.0.0.1"); | 124 host_resolver()->AddRule("*", "127.0.0.1"); |
123 ASSERT_TRUE(StartTestServer()); | 125 ASSERT_TRUE(StartTestServer()); |
124 | 126 |
125 // We need 2 ResultCatchers because we'll be running the same test in both | 127 // We need 2 ResultCatchers because we'll be running the same test in both |
126 // regular and incognito mode. | 128 // regular and incognito mode. |
127 ResultCatcher catcher; | 129 ResultCatcher catcher; |
(...skipping 18 matching lines...) Expand all Loading... |
146 EXPECT_TRUE(listener_incognito.WaitUntilSatisfied()); | 148 EXPECT_TRUE(listener_incognito.WaitUntilSatisfied()); |
147 listener.Reply("go"); | 149 listener.Reply("go"); |
148 listener_incognito.Reply("go"); | 150 listener_incognito.Reply("go"); |
149 | 151 |
150 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 152 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
151 EXPECT_TRUE(catcher_incognito.GetNextResult()) << catcher.message(); | 153 EXPECT_TRUE(catcher_incognito.GetNextResult()) << catcher.message(); |
152 } | 154 } |
153 | 155 |
154 // Tests that the APIs in an incognito-disabled extension don't see incognito | 156 // Tests that the APIs in an incognito-disabled extension don't see incognito |
155 // events or callbacks. | 157 // events or callbacks. |
| 158 #if defined(OS_WIN) |
| 159 // http://crbug.com/120484 |
| 160 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_IncognitoDisabled) { |
| 161 #else |
156 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, IncognitoDisabled) { | 162 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, IncognitoDisabled) { |
| 163 #endif |
157 host_resolver()->AddRule("*", "127.0.0.1"); | 164 host_resolver()->AddRule("*", "127.0.0.1"); |
158 ASSERT_TRUE(StartTestServer()); | 165 ASSERT_TRUE(StartTestServer()); |
159 | 166 |
160 ResultCatcher catcher; | 167 ResultCatcher catcher; |
161 | 168 |
162 // Open incognito window and navigate to test page. | 169 // Open incognito window and navigate to test page. |
163 ui_test_utils::OpenURLOffTheRecord( | 170 ui_test_utils::OpenURLOffTheRecord( |
164 browser()->profile(), | 171 browser()->profile(), |
165 test_server()->GetURL("files/extensions/test_file.html")); | 172 test_server()->GetURL("files/extensions/test_file.html")); |
166 | 173 |
(...skipping 25 matching lines...) Expand all Loading... |
192 test_server()->GetURL("files/extensions/test_file.html")); | 199 test_server()->GetURL("files/extensions/test_file.html")); |
193 | 200 |
194 Browser* incognito_browser = BrowserList::FindTabbedBrowser( | 201 Browser* incognito_browser = BrowserList::FindTabbedBrowser( |
195 browser()->profile()->GetOffTheRecordProfile(), false); | 202 browser()->profile()->GetOffTheRecordProfile(), false); |
196 | 203 |
197 // Simulate the incognito's browser action being clicked. | 204 // Simulate the incognito's browser action being clicked. |
198 BrowserActionTestUtil(incognito_browser).Press(0); | 205 BrowserActionTestUtil(incognito_browser).Press(0); |
199 | 206 |
200 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); | 207 EXPECT_TRUE(catcher.GetNextResult()) << catcher.message(); |
201 } | 208 } |
OLD | NEW |