| 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_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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 if ((*it)->location() != extensions::Extension::COMPONENT) | 94 if ((*it)->location() != extensions::Extension::COMPONENT) |
| 95 found_extensions++; | 95 found_extensions++; |
| 96 | 96 |
| 97 ASSERT_EQ(static_cast<uint32>(num_expected_extensions), | 97 ASSERT_EQ(static_cast<uint32>(num_expected_extensions), |
| 98 static_cast<uint32>(found_extensions)); | 98 static_cast<uint32>(found_extensions)); |
| 99 ASSERT_EQ(expect_extensions_enabled, service->extensions_enabled()); | 99 ASSERT_EQ(expect_extensions_enabled, service->extensions_enabled()); |
| 100 | 100 |
| 101 ui_test_utils::WindowedNotificationObserver user_scripts_observer( | 101 ui_test_utils::WindowedNotificationObserver user_scripts_observer( |
| 102 chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, | 102 chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, |
| 103 content::NotificationService::AllSources()); | 103 content::NotificationService::AllSources()); |
| 104 UserScriptMaster* master = browser()->profile()->GetUserScriptMaster(); | 104 extensions::UserScriptMaster* master = |
| 105 browser()->profile()->GetUserScriptMaster(); |
| 105 if (!master->ScriptsReady()) | 106 if (!master->ScriptsReady()) |
| 106 user_scripts_observer.Wait(); | 107 user_scripts_observer.Wait(); |
| 107 ASSERT_TRUE(master->ScriptsReady()); | 108 ASSERT_TRUE(master->ScriptsReady()); |
| 108 } | 109 } |
| 109 | 110 |
| 110 void TestInjection(bool expect_css, bool expect_script) { | 111 void TestInjection(bool expect_css, bool expect_script) { |
| 111 // Load a page affected by the content script and test to see the effect. | 112 // Load a page affected by the content script and test to see the effect. |
| 112 FilePath test_file; | 113 FilePath test_file; |
| 113 PathService::Get(chrome::DIR_TEST_DATA, &test_file); | 114 PathService::Get(chrome::DIR_TEST_DATA, &test_file); |
| 114 test_file = test_file.AppendASCII("extensions") | 115 test_file = test_file.AppendASCII("extensions") |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 .AppendASCII("extensions") | 261 .AppendASCII("extensions") |
| 261 .AppendASCII("app2"); | 262 .AppendASCII("app2"); |
| 262 load_extensions_.push_back(fourth_extension_path.value()); | 263 load_extensions_.push_back(fourth_extension_path.value()); |
| 263 } | 264 } |
| 264 }; | 265 }; |
| 265 | 266 |
| 266 IN_PROC_BROWSER_TEST_F(ExtensionsLoadMultipleTest, Test) { | 267 IN_PROC_BROWSER_TEST_F(ExtensionsLoadMultipleTest, Test) { |
| 267 WaitForServicesToStart(4, true); | 268 WaitForServicesToStart(4, true); |
| 268 TestInjection(true, true); | 269 TestInjection(true, true); |
| 269 } | 270 } |
| OLD | NEW |