OLD | NEW |
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 ExtensionsStartupTest() { | 137 ExtensionsStartupTest() { |
138 enable_extensions_ = true; | 138 enable_extensions_ = true; |
139 } | 139 } |
140 }; | 140 }; |
141 | 141 |
142 IN_PROC_BROWSER_TEST_F(ExtensionsStartupTest, Test) { | 142 IN_PROC_BROWSER_TEST_F(ExtensionsStartupTest, Test) { |
143 WaitForServicesToStart(4, true); // 1 component extension and 3 others. | 143 WaitForServicesToStart(4, true); // 1 component extension and 3 others. |
144 TestInjection(true, true); | 144 TestInjection(true, true); |
145 } | 145 } |
146 | 146 |
| 147 // Sometimes times out on Mac. http://crbug.com/48151 |
| 148 #if defined(OS_MACOSX) |
| 149 #define MAYBE_NoFileAccess DISABLED_NoFileAccess |
| 150 #else |
| 151 #define MAYBE_NoFileAccess NoFileAccess |
| 152 #endif |
147 // Tests that disallowing file access on an extension prevents it from injecting | 153 // Tests that disallowing file access on an extension prevents it from injecting |
148 // script into a page with a file URL. | 154 // script into a page with a file URL. |
149 IN_PROC_BROWSER_TEST_F(ExtensionsStartupTest, NoFileAccess) { | 155 IN_PROC_BROWSER_TEST_F(ExtensionsStartupTest, MAYBE_NoFileAccess) { |
150 WaitForServicesToStart(4, true); // 1 component extension and 3 others. | 156 WaitForServicesToStart(4, true); // 1 component extension and 3 others. |
151 | 157 |
152 ExtensionsService* service = browser()->profile()->GetExtensionsService(); | 158 ExtensionsService* service = browser()->profile()->GetExtensionsService(); |
153 for (size_t i = 0; i < service->extensions()->size(); ++i) { | 159 for (size_t i = 0; i < service->extensions()->size(); ++i) { |
154 if (service->AllowFileAccess(service->extensions()->at(i))) { | 160 if (service->AllowFileAccess(service->extensions()->at(i))) { |
155 service->SetAllowFileAccess(service->extensions()->at(i), false); | 161 service->SetAllowFileAccess(service->extensions()->at(i), false); |
156 ui_test_utils::WaitForNotification( | 162 ui_test_utils::WaitForNotification( |
157 NotificationType::USER_SCRIPTS_UPDATED); | 163 NotificationType::USER_SCRIPTS_UPDATED); |
158 } | 164 } |
159 } | 165 } |
(...skipping 21 matching lines...) Expand all Loading... |
181 // Flaky (times out) on Mac/Windows. http://crbug.com/46301. | 187 // Flaky (times out) on Mac/Windows. http://crbug.com/46301. |
182 #if defined(OS_MACOSX) || defined(OS_WIN) | 188 #if defined(OS_MACOSX) || defined(OS_WIN) |
183 #define MAYBE_Test FLAKY_Test | 189 #define MAYBE_Test FLAKY_Test |
184 #else | 190 #else |
185 #define MAYBE_Test Test | 191 #define MAYBE_Test Test |
186 #endif | 192 #endif |
187 IN_PROC_BROWSER_TEST_F(ExtensionsLoadTest, MAYBE_Test) { | 193 IN_PROC_BROWSER_TEST_F(ExtensionsLoadTest, MAYBE_Test) { |
188 WaitForServicesToStart(1, false); | 194 WaitForServicesToStart(1, false); |
189 TestInjection(true, true); | 195 TestInjection(true, true); |
190 } | 196 } |
OLD | NEW |