| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 } | 122 } |
| 123 | 123 |
| 124 if (!unauthenticated_load_allowed_) | 124 if (!unauthenticated_load_allowed_) |
| 125 num_expected_extensions = 0; | 125 num_expected_extensions = 0; |
| 126 | 126 |
| 127 ASSERT_EQ(static_cast<uint32>(num_expected_extensions), | 127 ASSERT_EQ(static_cast<uint32>(num_expected_extensions), |
| 128 static_cast<uint32>(found_extensions)); | 128 static_cast<uint32>(found_extensions)); |
| 129 ASSERT_EQ(expect_extensions_enabled, service->extensions_enabled()); | 129 ASSERT_EQ(expect_extensions_enabled, service->extensions_enabled()); |
| 130 | 130 |
| 131 content::WindowedNotificationObserver user_scripts_observer( | 131 content::WindowedNotificationObserver user_scripts_observer( |
| 132 chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, | 132 extensions::NOTIFICATION_USER_SCRIPTS_UPDATED, |
| 133 content::NotificationService::AllSources()); | 133 content::NotificationService::AllSources()); |
| 134 extensions::UserScriptMaster* master = | 134 extensions::UserScriptMaster* master = |
| 135 extensions::ExtensionSystem::Get(browser()->profile())-> | 135 extensions::ExtensionSystem::Get(browser()->profile())-> |
| 136 user_script_master(); | 136 user_script_master(); |
| 137 if (!master->ScriptsReady()) | 137 if (!master->ScriptsReady()) |
| 138 user_scripts_observer.Wait(); | 138 user_scripts_observer.Wait(); |
| 139 ASSERT_TRUE(master->ScriptsReady()); | 139 ASSERT_TRUE(master->ScriptsReady()); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void TestInjection(bool expect_css, bool expect_script) { | 142 void TestInjection(bool expect_css, bool expect_script) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 registry->enabled_extensions().begin(); | 214 registry->enabled_extensions().begin(); |
| 215 it != registry->enabled_extensions().end(); ++it) { | 215 it != registry->enabled_extensions().end(); ++it) { |
| 216 if ((*it)->location() == extensions::Manifest::COMPONENT) | 216 if ((*it)->location() == extensions::Manifest::COMPONENT) |
| 217 continue; | 217 continue; |
| 218 if (extensions::util::AllowFileAccess((*it)->id(), browser()->profile())) | 218 if (extensions::util::AllowFileAccess((*it)->id(), browser()->profile())) |
| 219 extension_list.push_back(it->get()); | 219 extension_list.push_back(it->get()); |
| 220 } | 220 } |
| 221 | 221 |
| 222 for (size_t i = 0; i < extension_list.size(); ++i) { | 222 for (size_t i = 0; i < extension_list.size(); ++i) { |
| 223 content::WindowedNotificationObserver user_scripts_observer( | 223 content::WindowedNotificationObserver user_scripts_observer( |
| 224 chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, | 224 extensions::NOTIFICATION_USER_SCRIPTS_UPDATED, |
| 225 content::NotificationService::AllSources()); | 225 content::NotificationService::AllSources()); |
| 226 extensions::util::SetAllowFileAccess( | 226 extensions::util::SetAllowFileAccess( |
| 227 extension_list[i]->id(), browser()->profile(), false); | 227 extension_list[i]->id(), browser()->profile(), false); |
| 228 user_scripts_observer.Wait(); | 228 user_scripts_observer.Wait(); |
| 229 } | 229 } |
| 230 | 230 |
| 231 TestInjection(false, false); | 231 TestInjection(false, false); |
| 232 } | 232 } |
| 233 | 233 |
| 234 // ExtensionsLoadTest | 234 // ExtensionsLoadTest |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 .AppendASCII("extensions") | 293 .AppendASCII("extensions") |
| 294 .AppendASCII("app2"); | 294 .AppendASCII("app2"); |
| 295 load_extensions_.push_back(fourth_extension_path.value()); | 295 load_extensions_.push_back(fourth_extension_path.value()); |
| 296 } | 296 } |
| 297 }; | 297 }; |
| 298 | 298 |
| 299 IN_PROC_BROWSER_TEST_F(ExtensionsLoadMultipleTest, Test) { | 299 IN_PROC_BROWSER_TEST_F(ExtensionsLoadMultipleTest, Test) { |
| 300 WaitForServicesToStart(4, true); | 300 WaitForServicesToStart(4, true); |
| 301 TestInjection(true, true); | 301 TestInjection(true, true); |
| 302 } | 302 } |
| OLD | NEW |