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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "chrome/browser/extensions/api/web_request/web_request_api.h" | 6 #include "chrome/browser/extensions/api/web_request/web_request_api.h" |
7 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/extensions/extension_test_message_listener.h" | 9 #include "chrome/browser/extensions/extension_test_message_listener.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
149 const char* exptected_content_incognito_window) { | 149 const char* exptected_content_incognito_window) { |
150 ResultCatcher catcher; | 150 ResultCatcher catcher; |
151 catcher.RestrictToProfile(browser()->profile()); | 151 catcher.RestrictToProfile(browser()->profile()); |
152 ResultCatcher catcher_incognito; | 152 ResultCatcher catcher_incognito; |
153 catcher_incognito.RestrictToProfile( | 153 catcher_incognito.RestrictToProfile( |
154 browser()->profile()->GetOffTheRecordProfile()); | 154 browser()->profile()->GetOffTheRecordProfile()); |
155 | 155 |
156 ExtensionTestMessageListener listener("done", true); | 156 ExtensionTestMessageListener listener("done", true); |
157 ExtensionTestMessageListener listener_incognito("done_incognito", true); | 157 ExtensionTestMessageListener listener_incognito("done_incognito", true); |
158 | 158 |
159 ASSERT_TRUE(LoadExtensionWithOptions( | 159 int load_extension_flags = kFlagNone; |
miket_OOO
2012/08/06 22:33:28
To be hyper-correct, this is a ExtensionApiTest::F
Mihai Parparita -not on Chrome
2012/08/09 23:04:08
ExtensionApiTest::Flags isn't really the right typ
| |
160 if (load_extension_with_incognito_permission) { | |
Aaron Boodman
2012/08/07 02:12:35
Either way is allowed, but we tend to drop the bra
Mihai Parparita -not on Chrome
2012/08/09 23:04:08
Done.
| |
161 load_extension_flags |= kFlagEnableIncognito; | |
162 } | |
163 ASSERT_TRUE(LoadExtensionWithFlags( | |
160 test_data_dir_.AppendASCII("webrequest_permissions") | 164 test_data_dir_.AppendASCII("webrequest_permissions") |
161 .AppendASCII(extension_directory), | 165 .AppendASCII(extension_directory), |
162 load_extension_with_incognito_permission, | 166 load_extension_flags)); |
163 false)); | |
164 | 167 |
165 // Test that navigation in regular window is properly redirected. | 168 // Test that navigation in regular window is properly redirected. |
166 EXPECT_TRUE(listener.WaitUntilSatisfied()); | 169 EXPECT_TRUE(listener.WaitUntilSatisfied()); |
167 | 170 |
168 // This navigation should be redirected. | 171 // This navigation should be redirected. |
169 ui_test_utils::NavigateToURL( | 172 ui_test_utils::NavigateToURL( |
170 browser(), | 173 browser(), |
171 test_server()->GetURL("files/extensions/test_file.html")); | 174 test_server()->GetURL("files/extensions/test_file.html")); |
172 | 175 |
173 std::string body; | 176 std::string body; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
218 // Test split with incognito permission. | 221 // Test split with incognito permission. |
219 RunPermissionTest("split", true, true, "redirected1", "redirected2"); | 222 RunPermissionTest("split", true, true, "redirected1", "redirected2"); |
220 } | 223 } |
221 | 224 |
222 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, | 225 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, |
223 WebRequestDeclarativePermissionSplit2) { | 226 WebRequestDeclarativePermissionSplit2) { |
224 // Test split without incognito permission. | 227 // Test split without incognito permission. |
225 RunPermissionTest("split", false, false, "redirected1", ""); | 228 RunPermissionTest("split", false, false, "redirected1", ""); |
226 } | 229 } |
227 | 230 |
OLD | NEW |