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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 src_dir = src_dir.AppendASCII("extensions").AppendASCII("good"); | 53 src_dir = src_dir.AppendASCII("extensions").AppendASCII("good"); |
54 | 54 |
55 file_util::CopyFile(src_dir.AppendASCII("Preferences"), | 55 file_util::CopyFile(src_dir.AppendASCII("Preferences"), |
56 preferences_file_); | 56 preferences_file_); |
57 file_util::CopyDirectory(src_dir.AppendASCII("Extensions"), | 57 file_util::CopyDirectory(src_dir.AppendASCII("Extensions"), |
58 profile_dir, true); // recursive | 58 profile_dir, true); // recursive |
59 } else { | 59 } else { |
60 command_line->AppendSwitch(switches::kDisableExtensions); | 60 command_line->AppendSwitch(switches::kDisableExtensions); |
61 } | 61 } |
62 | 62 |
63 if (!load_extension_.value().empty()) { | 63 if (!load_extension_.empty()) { |
64 command_line->AppendSwitchWithValue(switches::kLoadExtension, | 64 command_line->AppendSwitchPath(switches::kLoadExtension, load_extension_); |
65 load_extension_.ToWStringHack()); | |
66 command_line->AppendSwitch(switches::kDisableExtensionsFileAccessCheck); | 65 command_line->AppendSwitch(switches::kDisableExtensionsFileAccessCheck); |
67 } | 66 } |
68 } | 67 } |
69 | 68 |
70 virtual void TearDown() { | 69 virtual void TearDown() { |
71 EXPECT_TRUE(file_util::Delete(preferences_file_, false)); | 70 EXPECT_TRUE(file_util::Delete(preferences_file_, false)); |
72 | 71 |
73 // TODO(phajdan.jr): Check return values of the functions below, carefully. | 72 // TODO(phajdan.jr): Check return values of the functions below, carefully. |
74 file_util::Delete(user_scripts_dir_, true); | 73 file_util::Delete(user_scripts_dir_, true); |
75 file_util::Delete(extensions_dir_, true); | 74 file_util::Delete(extensions_dir_, true); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // Flaky (times out) on Mac/Windows. http://crbug.com/46301. | 186 // Flaky (times out) on Mac/Windows. http://crbug.com/46301. |
188 #if defined(OS_MACOSX) || defined(OS_WIN) | 187 #if defined(OS_MACOSX) || defined(OS_WIN) |
189 #define MAYBE_Test FLAKY_Test | 188 #define MAYBE_Test FLAKY_Test |
190 #else | 189 #else |
191 #define MAYBE_Test Test | 190 #define MAYBE_Test Test |
192 #endif | 191 #endif |
193 IN_PROC_BROWSER_TEST_F(ExtensionsLoadTest, MAYBE_Test) { | 192 IN_PROC_BROWSER_TEST_F(ExtensionsLoadTest, MAYBE_Test) { |
194 WaitForServicesToStart(1, false); | 193 WaitForServicesToStart(1, false); |
195 TestInjection(true, true); | 194 TestInjection(true, true); |
196 } | 195 } |
OLD | NEW |