[email protected] | 4d245165 | 2012-02-14 23:54:26 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 038d52e1 | 2009-10-14 16:53:41 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | f0488f2f | 2009-07-01 05:25:22 | [diff] [blame] | 5 | #include <vector> |
| 6 | |
| 7 | #include "base/command_line.h" |
[email protected] | f0488f2f | 2009-07-01 05:25:22 | [diff] [blame] | 8 | #include "base/file_util.h" |
[email protected] | 5799981 | 2013-02-24 05:40:52 | [diff] [blame] | 9 | #include "base/files/file_path.h" |
[email protected] | f0488f2f | 2009-07-01 05:25:22 | [diff] [blame] | 10 | #include "base/path_service.h" |
[email protected] | 00e7bef | 2013-06-10 20:35:17 | [diff] [blame] | 11 | #include "base/strings/string_util.h" |
[email protected] | 9ea0cd3 | 2013-07-12 01:50:36 | [diff] [blame^] | 12 | #include "chrome/browser/chrome_notification_types.h" |
[email protected] | eaa7dd18 | 2010-12-14 11:09:00 | [diff] [blame] | 13 | #include "chrome/browser/extensions/extension_service.h" |
[email protected] | 5d272a4 | 2012-10-29 13:28:22 | [diff] [blame] | 14 | #include "chrome/browser/extensions/extension_system.h" |
[email protected] | 8cb5d5b | 2010-02-09 11:36:16 | [diff] [blame] | 15 | #include "chrome/browser/extensions/user_script_master.h" |
[email protected] | 8ecad5e | 2010-12-02 21:18:33 | [diff] [blame] | 16 | #include "chrome/browser/profiles/profile.h" |
[email protected] | 7b5dc00 | 2010-11-16 23:08:10 | [diff] [blame] | 17 | #include "chrome/browser/ui/browser.h" |
[email protected] | 47ae2337 | 2013-01-29 01:50:48 | [diff] [blame] | 18 | #include "chrome/browser/ui/tabs/tab_strip_model.h" |
[email protected] | f0488f2f | 2009-07-01 05:25:22 | [diff] [blame] | 19 | #include "chrome/common/chrome_paths.h" |
| 20 | #include "chrome/common/chrome_switches.h" |
[email protected] | 00b5d0a5 | 2012-10-30 13:13:53 | [diff] [blame] | 21 | #include "chrome/common/extensions/feature_switch.h" |
[email protected] | af44e7fb | 2011-07-29 18:32:32 | [diff] [blame] | 22 | #include "chrome/test/base/in_process_browser_test.h" |
[email protected] | 89dbb177 | 2012-07-17 13:47:25 | [diff] [blame] | 23 | #include "chrome/test/base/testing_profile.h" |
[email protected] | af44e7fb | 2011-07-29 18:32:32 | [diff] [blame] | 24 | #include "chrome/test/base/ui_test_utils.h" |
[email protected] | 6c2381d | 2011-10-19 02:52:53 | [diff] [blame] | 25 | #include "content/public/browser/notification_details.h" |
[email protected] | ad50def5 | 2011-10-19 23:17:07 | [diff] [blame] | 26 | #include "content/public/browser/notification_service.h" |
[email protected] | 4ca1530 | 2012-01-03 05:53:20 | [diff] [blame] | 27 | #include "content/public/browser/web_contents.h" |
[email protected] | 7d478cb | 2012-07-24 17:19:42 | [diff] [blame] | 28 | #include "content/public/test/browser_test_utils.h" |
[email protected] | f0488f2f | 2009-07-01 05:25:22 | [diff] [blame] | 29 | #include "net/base/net_util.h" |
| 30 | |
[email protected] | 00b5d0a5 | 2012-10-30 13:13:53 | [diff] [blame] | 31 | using extensions::FeatureSwitch; |
| 32 | |
[email protected] | 17c4f3c | 2009-07-04 16:36:25 | [diff] [blame] | 33 | // This file contains high-level startup tests for the extensions system. We've |
| 34 | // had many silly bugs where command line flags did not get propagated correctly |
| 35 | // into the services, so we didn't start correctly. |
[email protected] | f0488f2f | 2009-07-01 05:25:22 | [diff] [blame] | 36 | |
[email protected] | 3e59bac | 2010-04-08 16:16:55 | [diff] [blame] | 37 | class ExtensionStartupTestBase : public InProcessBrowserTest { |
[email protected] | f0488f2f | 2009-07-01 05:25:22 | [diff] [blame] | 38 | public: |
[email protected] | 00b5d0a5 | 2012-10-30 13:13:53 | [diff] [blame] | 39 | ExtensionStartupTestBase() : |
[email protected] | 90c780ac | 2013-04-16 09:26:28 | [diff] [blame] | 40 | enable_extensions_(false) { |
[email protected] | fe13bf6 | 2010-08-26 14:33:19 | [diff] [blame] | 41 | num_expected_extensions_ = 3; |
[email protected] | f0488f2f | 2009-07-01 05:25:22 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | protected: |
| 45 | // InProcessBrowserTest |
[email protected] | 49aeab6 | 2013-02-07 02:53:11 | [diff] [blame] | 46 | virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
[email protected] | 10f6b14 | 2012-04-14 19:22:43 | [diff] [blame] | 47 | if (!enable_extensions_) |
| 48 | command_line->AppendSwitch(switches::kDisableExtensions); |
| 49 | |
| 50 | if (!load_extensions_.empty()) { |
[email protected] | dd6d3667 | 2013-05-17 22:50:02 | [diff] [blame] | 51 | base::FilePath::StringType paths = JoinString(load_extensions_, ','); |
[email protected] | 10f6b14 | 2012-04-14 19:22:43 | [diff] [blame] | 52 | command_line->AppendSwitchNative(switches::kLoadExtension, |
| 53 | paths); |
| 54 | command_line->AppendSwitch(switches::kDisableExtensionsFileAccessCheck); |
| 55 | } |
| 56 | } |
| 57 | |
[email protected] | 49aeab6 | 2013-02-07 02:53:11 | [diff] [blame] | 58 | virtual bool SetUpUserDataDirectory() OVERRIDE { |
[email protected] | 650b2d5 | 2013-02-10 03:41:45 | [diff] [blame] | 59 | base::FilePath profile_dir; |
[email protected] | f0488f2f | 2009-07-01 05:25:22 | [diff] [blame] | 60 | PathService::Get(chrome::DIR_USER_DATA, &profile_dir); |
[email protected] | 89dbb177 | 2012-07-17 13:47:25 | [diff] [blame] | 61 | profile_dir = profile_dir.AppendASCII(TestingProfile::kTestUserProfileDir); |
[email protected] | f0488f2f | 2009-07-01 05:25:22 | [diff] [blame] | 62 | file_util::CreateDirectory(profile_dir); |
| 63 | |
| 64 | preferences_file_ = profile_dir.AppendASCII("Preferences"); |
| 65 | user_scripts_dir_ = profile_dir.AppendASCII("User Scripts"); |
| 66 | extensions_dir_ = profile_dir.AppendASCII("Extensions"); |
| 67 | |
[email protected] | 10f6b14 | 2012-04-14 19:22:43 | [diff] [blame] | 68 | if (enable_extensions_ && load_extensions_.empty()) { |
[email protected] | 650b2d5 | 2013-02-10 03:41:45 | [diff] [blame] | 69 | base::FilePath src_dir; |
[email protected] | 10f6b14 | 2012-04-14 19:22:43 | [diff] [blame] | 70 | PathService::Get(chrome::DIR_TEST_DATA, &src_dir); |
| 71 | src_dir = src_dir.AppendASCII("extensions").AppendASCII("good"); |
[email protected] | f0488f2f | 2009-07-01 05:25:22 | [diff] [blame] | 72 | |
[email protected] | f0ff2ad | 2013-07-09 17:42:26 | [diff] [blame] | 73 | base::CopyFile(src_dir.AppendASCII("Preferences"), preferences_file_); |
| 74 | base::CopyDirectory(src_dir.AppendASCII("Extensions"), |
| 75 | profile_dir, true); // recursive |
[email protected] | f0488f2f | 2009-07-01 05:25:22 | [diff] [blame] | 76 | } |
[email protected] | 10f6b14 | 2012-04-14 19:22:43 | [diff] [blame] | 77 | return true; |
[email protected] | f0488f2f | 2009-07-01 05:25:22 | [diff] [blame] | 78 | } |
| 79 | |
[email protected] | f0488f2f | 2009-07-01 05:25:22 | [diff] [blame] | 80 | virtual void TearDown() { |
[email protected] | 918efbf | 2013-07-01 19:41:02 | [diff] [blame] | 81 | EXPECT_TRUE(base::Delete(preferences_file_, false)); |
[email protected] | 020f49e | 2010-04-08 19:51:12 | [diff] [blame] | 82 | |
| 83 | // TODO(phajdan.jr): Check return values of the functions below, carefully. |
[email protected] | 918efbf | 2013-07-01 19:41:02 | [diff] [blame] | 84 | base::Delete(user_scripts_dir_, true); |
| 85 | base::Delete(extensions_dir_, true); |
[email protected] | 36fb2c7c | 2011-04-04 15:49:08 | [diff] [blame] | 86 | |
| 87 | InProcessBrowserTest::TearDown(); |
[email protected] | f0488f2f | 2009-07-01 05:25:22 | [diff] [blame] | 88 | } |
| 89 | |
[email protected] | 919ddc8 | 2009-07-15 04:30:12 | [diff] [blame] | 90 | void WaitForServicesToStart(int num_expected_extensions, |
| 91 | bool expect_extensions_enabled) { |
[email protected] | 06bdd2b | 2012-11-30 18:47:13 | [diff] [blame] | 92 | ExtensionService* service = extensions::ExtensionSystem::Get( |
| 93 | browser()->profile())->extension_service(); |
[email protected] | 919ddc8 | 2009-07-15 04:30:12 | [diff] [blame] | 94 | |
[email protected] | fe13bf6 | 2010-08-26 14:33:19 | [diff] [blame] | 95 | // Count the number of non-component extensions. |
| 96 | int found_extensions = 0; |
[email protected] | 84df833 | 2011-12-06 18:22:46 | [diff] [blame] | 97 | for (ExtensionSet::const_iterator it = service->extensions()->begin(); |
| 98 | it != service->extensions()->end(); ++it) |
[email protected] | 1d5e58b | 2013-01-31 08:41:40 | [diff] [blame] | 99 | if ((*it)->location() != extensions::Manifest::COMPONENT) |
[email protected] | fe13bf6 | 2010-08-26 14:33:19 | [diff] [blame] | 100 | found_extensions++; |
| 101 | |
[email protected] | 919ddc8 | 2009-07-15 04:30:12 | [diff] [blame] | 102 | ASSERT_EQ(static_cast<uint32>(num_expected_extensions), |
[email protected] | fe13bf6 | 2010-08-26 14:33:19 | [diff] [blame] | 103 | static_cast<uint32>(found_extensions)); |
[email protected] | 919ddc8 | 2009-07-15 04:30:12 | [diff] [blame] | 104 | ASSERT_EQ(expect_extensions_enabled, service->extensions_enabled()); |
| 105 | |
[email protected] | a7fe911 | 2012-07-20 02:34:45 | [diff] [blame] | 106 | content::WindowedNotificationObserver user_scripts_observer( |
[email protected] | 120abf13 | 2011-09-27 21:38:06 | [diff] [blame] | 107 | chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, |
[email protected] | ad50def5 | 2011-10-19 23:17:07 | [diff] [blame] | 108 | content::NotificationService::AllSources()); |
[email protected] | 20f97c9 | 2012-07-13 23:12:37 | [diff] [blame] | 109 | extensions::UserScriptMaster* master = |
[email protected] | 5d272a4 | 2012-10-29 13:28:22 | [diff] [blame] | 110 | extensions::ExtensionSystem::Get(browser()->profile())-> |
| 111 | user_script_master(); |
[email protected] | 120abf13 | 2011-09-27 21:38:06 | [diff] [blame] | 112 | if (!master->ScriptsReady()) |
| 113 | user_scripts_observer.Wait(); |
[email protected] | 919ddc8 | 2009-07-15 04:30:12 | [diff] [blame] | 114 | ASSERT_TRUE(master->ScriptsReady()); |
| 115 | } |
| 116 | |
| 117 | void TestInjection(bool expect_css, bool expect_script) { |
| 118 | // Load a page affected by the content script and test to see the effect. |
[email protected] | 650b2d5 | 2013-02-10 03:41:45 | [diff] [blame] | 119 | base::FilePath test_file; |
[email protected] | 6277144 | 2009-11-22 02:25:04 | [diff] [blame] | 120 | PathService::Get(chrome::DIR_TEST_DATA, &test_file); |
| 121 | test_file = test_file.AppendASCII("extensions") |
| 122 | .AppendASCII("test_file.html"); |
| 123 | |
| 124 | ui_test_utils::NavigateToURL(browser(), net::FilePathToFileURL(test_file)); |
[email protected] | 919ddc8 | 2009-07-15 04:30:12 | [diff] [blame] | 125 | |
| 126 | bool result = false; |
[email protected] | b6987e0 | 2013-01-04 18:30:43 | [diff] [blame] | 127 | ASSERT_TRUE(content::ExecuteScriptAndExtractBool( |
[email protected] | 47ae2337 | 2013-01-29 01:50:48 | [diff] [blame] | 128 | browser()->tab_strip_model()->GetActiveWebContents(), |
[email protected] | 06bc5d9 | 2013-01-02 22:44:13 | [diff] [blame] | 129 | "window.domAutomationController.send(" |
[email protected] | b6987e0 | 2013-01-04 18:30:43 | [diff] [blame] | 130 | " document.defaultView.getComputedStyle(document.body, null)." |
| 131 | " getPropertyValue('background-color') == 'rgb(245, 245, 220)')", |
[email protected] | 9fabbf7 | 2010-09-30 21:50:05 | [diff] [blame] | 132 | &result)); |
[email protected] | 919ddc8 | 2009-07-15 04:30:12 | [diff] [blame] | 133 | EXPECT_EQ(expect_css, result); |
| 134 | |
| 135 | result = false; |
[email protected] | b6987e0 | 2013-01-04 18:30:43 | [diff] [blame] | 136 | ASSERT_TRUE(content::ExecuteScriptAndExtractBool( |
[email protected] | 47ae2337 | 2013-01-29 01:50:48 | [diff] [blame] | 137 | browser()->tab_strip_model()->GetActiveWebContents(), |
[email protected] | 06bc5d9 | 2013-01-02 22:44:13 | [diff] [blame] | 138 | "window.domAutomationController.send(document.title == 'Modified')", |
[email protected] | 9fabbf7 | 2010-09-30 21:50:05 | [diff] [blame] | 139 | &result)); |
[email protected] | 919ddc8 | 2009-07-15 04:30:12 | [diff] [blame] | 140 | EXPECT_EQ(expect_script, result); |
| 141 | } |
| 142 | |
[email protected] | 650b2d5 | 2013-02-10 03:41:45 | [diff] [blame] | 143 | base::FilePath preferences_file_; |
| 144 | base::FilePath extensions_dir_; |
| 145 | base::FilePath user_scripts_dir_; |
[email protected] | f0488f2f | 2009-07-01 05:25:22 | [diff] [blame] | 146 | bool enable_extensions_; |
[email protected] | bfc9356 | 2011-12-14 19:40:04 | [diff] [blame] | 147 | // Extensions to load from the command line. |
[email protected] | 650b2d5 | 2013-02-10 03:41:45 | [diff] [blame] | 148 | std::vector<base::FilePath::StringType> load_extensions_; |
[email protected] | e50013c3 | 2010-08-18 21:05:24 | [diff] [blame] | 149 | |
| 150 | int num_expected_extensions_; |
[email protected] | f0488f2f | 2009-07-01 05:25:22 | [diff] [blame] | 151 | }; |
| 152 | |
| 153 | |
| 154 | // ExtensionsStartupTest |
| 155 | // Ensures that we can startup the browser with --enable-extensions and some |
| 156 | // extensions installed and see them run and do basic things. |
| 157 | |
| 158 | class ExtensionsStartupTest : public ExtensionStartupTestBase { |
| 159 | public: |
| 160 | ExtensionsStartupTest() { |
| 161 | enable_extensions_ = true; |
| 162 | } |
| 163 | }; |
| 164 | |
[email protected] | c5b2c611 | 2010-06-11 00:02:14 | [diff] [blame] | 165 | IN_PROC_BROWSER_TEST_F(ExtensionsStartupTest, Test) { |
[email protected] | e50013c3 | 2010-08-18 21:05:24 | [diff] [blame] | 166 | WaitForServicesToStart(num_expected_extensions_, true); |
[email protected] | 919ddc8 | 2009-07-15 04:30:12 | [diff] [blame] | 167 | TestInjection(true, true); |
| 168 | } |
[email protected] | 919ddc8 | 2009-07-15 04:30:12 | [diff] [blame] | 169 | |
[email protected] | b2f665f5 | 2010-07-02 01:32:09 | [diff] [blame] | 170 | // Sometimes times out on Mac. http://crbug.com/48151 |
| 171 | #if defined(OS_MACOSX) |
| 172 | #define MAYBE_NoFileAccess DISABLED_NoFileAccess |
| 173 | #else |
| 174 | #define MAYBE_NoFileAccess NoFileAccess |
| 175 | #endif |
[email protected] | 05c8218 | 2010-06-24 17:49:08 | [diff] [blame] | 176 | // Tests that disallowing file access on an extension prevents it from injecting |
| 177 | // script into a page with a file URL. |
[email protected] | b2f665f5 | 2010-07-02 01:32:09 | [diff] [blame] | 178 | IN_PROC_BROWSER_TEST_F(ExtensionsStartupTest, MAYBE_NoFileAccess) { |
[email protected] | e50013c3 | 2010-08-18 21:05:24 | [diff] [blame] | 179 | WaitForServicesToStart(num_expected_extensions_, true); |
[email protected] | 05c8218 | 2010-06-24 17:49:08 | [diff] [blame] | 180 | |
[email protected] | 84df833 | 2011-12-06 18:22:46 | [diff] [blame] | 181 | // Keep a separate list of extensions for which to disable file access, since |
| 182 | // doing so reloads them. |
[email protected] | 1c321ee | 2012-05-21 03:02:34 | [diff] [blame] | 183 | std::vector<const extensions::Extension*> extension_list; |
[email protected] | 84df833 | 2011-12-06 18:22:46 | [diff] [blame] | 184 | |
[email protected] | 06bdd2b | 2012-11-30 18:47:13 | [diff] [blame] | 185 | ExtensionService* service = extensions::ExtensionSystem::Get( |
| 186 | browser()->profile())->extension_service(); |
[email protected] | 84df833 | 2011-12-06 18:22:46 | [diff] [blame] | 187 | for (ExtensionSet::const_iterator it = service->extensions()->begin(); |
| 188 | it != service->extensions()->end(); ++it) { |
[email protected] | 1d5e58b | 2013-01-31 08:41:40 | [diff] [blame] | 189 | if ((*it)->location() == extensions::Manifest::COMPONENT) |
[email protected] | fe13bf6 | 2010-08-26 14:33:19 | [diff] [blame] | 190 | continue; |
[email protected] | cadac62 | 2013-06-11 16:46:36 | [diff] [blame] | 191 | if (service->AllowFileAccess(it->get())) |
| 192 | extension_list.push_back(it->get()); |
[email protected] | 84df833 | 2011-12-06 18:22:46 | [diff] [blame] | 193 | } |
| 194 | |
| 195 | for (size_t i = 0; i < extension_list.size(); ++i) { |
[email protected] | a7fe911 | 2012-07-20 02:34:45 | [diff] [blame] | 196 | content::WindowedNotificationObserver user_scripts_observer( |
[email protected] | 84df833 | 2011-12-06 18:22:46 | [diff] [blame] | 197 | chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, |
| 198 | content::NotificationService::AllSources()); |
| 199 | service->SetAllowFileAccess(extension_list[i], false); |
| 200 | user_scripts_observer.Wait(); |
[email protected] | 05c8218 | 2010-06-24 17:49:08 | [diff] [blame] | 201 | } |
| 202 | |
| 203 | TestInjection(false, false); |
| 204 | } |
| 205 | |
[email protected] | 919ddc8 | 2009-07-15 04:30:12 | [diff] [blame] | 206 | // ExtensionsLoadTest |
| 207 | // Ensures that we can startup the browser with --load-extension and see them |
| 208 | // run. |
| 209 | |
| 210 | class ExtensionsLoadTest : public ExtensionStartupTestBase { |
| 211 | public: |
| 212 | ExtensionsLoadTest() { |
[email protected] | d728e00 | 2010-12-08 04:46:23 | [diff] [blame] | 213 | enable_extensions_ = true; |
[email protected] | 650b2d5 | 2013-02-10 03:41:45 | [diff] [blame] | 214 | base::FilePath one_extension_path; |
[email protected] | bfc9356 | 2011-12-14 19:40:04 | [diff] [blame] | 215 | PathService::Get(chrome::DIR_TEST_DATA, &one_extension_path); |
| 216 | one_extension_path = one_extension_path |
[email protected] | 919ddc8 | 2009-07-15 04:30:12 | [diff] [blame] | 217 | .AppendASCII("extensions") |
| 218 | .AppendASCII("good") |
| 219 | .AppendASCII("Extensions") |
| 220 | .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj") |
| 221 | .AppendASCII("1.0.0.0"); |
[email protected] | bfc9356 | 2011-12-14 19:40:04 | [diff] [blame] | 222 | load_extensions_.push_back(one_extension_path.value()); |
[email protected] | f0488f2f | 2009-07-01 05:25:22 | [diff] [blame] | 223 | } |
[email protected] | 919ddc8 | 2009-07-15 04:30:12 | [diff] [blame] | 224 | }; |
[email protected] | f0488f2f | 2009-07-01 05:25:22 | [diff] [blame] | 225 | |
[email protected] | 4b10905 | 2011-04-29 12:53:24 | [diff] [blame] | 226 | // Fails inconsistently on Linux x64. http://crbug.com/80961 |
[email protected] | dc12802 | 2012-02-17 23:14:58 | [diff] [blame] | 227 | // TODO(dpapad): Has not failed since October 2011, let's reenable, monitor |
| 228 | // and act accordingly. |
| 229 | IN_PROC_BROWSER_TEST_F(ExtensionsLoadTest, Test) { |
[email protected] | d728e00 | 2010-12-08 04:46:23 | [diff] [blame] | 230 | WaitForServicesToStart(1, true); |
[email protected] | 919ddc8 | 2009-07-15 04:30:12 | [diff] [blame] | 231 | TestInjection(true, true); |
[email protected] | f0488f2f | 2009-07-01 05:25:22 | [diff] [blame] | 232 | } |
[email protected] | bfc9356 | 2011-12-14 19:40:04 | [diff] [blame] | 233 | |
| 234 | // ExtensionsLoadMultipleTest |
| 235 | // Ensures that we can startup the browser with multiple extensions |
| 236 | // via --load-extension=X1,X2,X3. |
| 237 | class ExtensionsLoadMultipleTest : public ExtensionStartupTestBase { |
| 238 | public: |
| 239 | ExtensionsLoadMultipleTest() { |
| 240 | enable_extensions_ = true; |
[email protected] | 650b2d5 | 2013-02-10 03:41:45 | [diff] [blame] | 241 | base::FilePath one_extension_path; |
[email protected] | bfc9356 | 2011-12-14 19:40:04 | [diff] [blame] | 242 | PathService::Get(chrome::DIR_TEST_DATA, &one_extension_path); |
| 243 | one_extension_path = one_extension_path |
| 244 | .AppendASCII("extensions") |
| 245 | .AppendASCII("good") |
| 246 | .AppendASCII("Extensions") |
| 247 | .AppendASCII("behllobkkfkfnphdnhnkndlbkcpglgmj") |
| 248 | .AppendASCII("1.0.0.0"); |
| 249 | load_extensions_.push_back(one_extension_path.value()); |
| 250 | |
[email protected] | 650b2d5 | 2013-02-10 03:41:45 | [diff] [blame] | 251 | base::FilePath second_extension_path; |
[email protected] | bfc9356 | 2011-12-14 19:40:04 | [diff] [blame] | 252 | PathService::Get(chrome::DIR_TEST_DATA, &second_extension_path); |
| 253 | second_extension_path = second_extension_path |
| 254 | .AppendASCII("extensions") |
| 255 | .AppendASCII("app"); |
| 256 | load_extensions_.push_back(second_extension_path.value()); |
| 257 | |
[email protected] | 650b2d5 | 2013-02-10 03:41:45 | [diff] [blame] | 258 | base::FilePath third_extension_path; |
[email protected] | bfc9356 | 2011-12-14 19:40:04 | [diff] [blame] | 259 | PathService::Get(chrome::DIR_TEST_DATA, &third_extension_path); |
| 260 | third_extension_path = third_extension_path |
| 261 | .AppendASCII("extensions") |
| 262 | .AppendASCII("app1"); |
| 263 | load_extensions_.push_back(third_extension_path.value()); |
| 264 | |
[email protected] | 650b2d5 | 2013-02-10 03:41:45 | [diff] [blame] | 265 | base::FilePath fourth_extension_path; |
[email protected] | bfc9356 | 2011-12-14 19:40:04 | [diff] [blame] | 266 | PathService::Get(chrome::DIR_TEST_DATA, &fourth_extension_path); |
| 267 | fourth_extension_path = fourth_extension_path |
| 268 | .AppendASCII("extensions") |
| 269 | .AppendASCII("app2"); |
| 270 | load_extensions_.push_back(fourth_extension_path.value()); |
| 271 | } |
| 272 | }; |
| 273 | |
| 274 | IN_PROC_BROWSER_TEST_F(ExtensionsLoadMultipleTest, Test) { |
| 275 | WaitForServicesToStart(4, true); |
| 276 | TestInjection(true, true); |
| 277 | } |