OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // Tests for the --load-and-launch-app switch. | 5 // Tests for the --load-and-launch-app switch. |
6 // The two cases are when chrome is running and another process uses the switch | 6 // The two cases are when chrome is running and another process uses the switch |
7 // and when chrome is started from scratch. | 7 // and when chrome is started from scratch. |
8 | 8 |
9 #include "apps/switches.h" | 9 #include "apps/switches.h" |
10 #include "base/process/launch.h" | 10 #include "base/process/launch.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
164 | 164 |
165 // Skip showing the error message box to avoid freezing the main thread. | 165 // Skip showing the error message box to avoid freezing the main thread. |
166 chrome::internal::g_should_skip_message_box_for_test = true; | 166 chrome::internal::g_should_skip_message_box_for_test = true; |
167 } | 167 } |
168 | 168 |
169 DISALLOW_COPY_AND_ASSIGN(LoadAndLaunchExtensionBrowserTest); | 169 DISALLOW_COPY_AND_ASSIGN(LoadAndLaunchExtensionBrowserTest); |
170 }; | 170 }; |
171 | 171 |
172 } // namespace | 172 } // namespace |
173 | 173 |
174 | |
175 // TODO(jackhou): Make this test not flaky on Vista or Linux Aura. See | |
176 // http://crbug.com/176897 | |
msw
2016/10/03 21:16:52
nit: mention BUG=176897 (and close that bug if thi
proberge
2016/10/04 13:31:54
Done.
| |
177 #if defined(OS_WIN) || (defined(OS_LINUX) && defined(USE_AURA)) | |
178 #define MAYBE_LoadAndLaunchAppChromeNotRunning \ | |
179 DISABLED_LoadAndLaunchAppChromeNotRunning | |
180 #else | |
181 #define MAYBE_LoadAndLaunchAppChromeNotRunning \ | |
182 LoadAndLaunchAppChromeNotRunning | |
183 #endif | |
184 | |
185 // Case where Chrome is not running. | 174 // Case where Chrome is not running. |
186 IN_PROC_BROWSER_TEST_F(LoadAndLaunchPlatformAppBrowserTest, | 175 IN_PROC_BROWSER_TEST_F(LoadAndLaunchPlatformAppBrowserTest, |
187 MAYBE_LoadAndLaunchAppChromeNotRunning) { | 176 LoadAndLaunchAppChromeNotRunning) { |
188 LoadAndLaunchApp(); | 177 LoadAndLaunchApp(); |
189 } | 178 } |
190 | 179 |
191 IN_PROC_BROWSER_TEST_F(LoadAndLaunchExtensionBrowserTest, | 180 IN_PROC_BROWSER_TEST_F(LoadAndLaunchExtensionBrowserTest, |
192 LoadAndLaunchExtension) { | 181 LoadAndLaunchExtension) { |
193 const std::vector<base::string16>* errors = | 182 const std::vector<base::string16>* errors = |
194 ExtensionErrorReporter::GetInstance()->GetErrors(); | 183 ExtensionErrorReporter::GetInstance()->GetErrors(); |
195 | 184 |
196 #if defined(GOOGLE_CHROME_BUILD) | 185 #if defined(GOOGLE_CHROME_BUILD) |
197 // The error is skipped on official builds. | 186 // The error is skipped on official builds. |
198 EXPECT_TRUE(errors->empty()); | 187 EXPECT_TRUE(errors->empty()); |
199 #else | 188 #else |
200 // Expect |extension_instead_of_app_error|. | 189 // Expect |extension_instead_of_app_error|. |
201 EXPECT_EQ(1u, errors->size()); | 190 EXPECT_EQ(1u, errors->size()); |
202 EXPECT_NE(base::string16::npos, | 191 EXPECT_NE(base::string16::npos, |
203 errors->at(0).find(base::ASCIIToUTF16( | 192 errors->at(0).find(base::ASCIIToUTF16( |
204 "App loading flags cannot be used to load extensions"))); | 193 "App loading flags cannot be used to load extensions"))); |
205 #endif | 194 #endif |
206 | 195 |
207 extensions::ExtensionRegistry* registry = | 196 extensions::ExtensionRegistry* registry = |
208 extensions::ExtensionRegistry::Get(profile()); | 197 extensions::ExtensionRegistry::Get(profile()); |
209 EXPECT_EQ(nullptr, | 198 EXPECT_EQ(nullptr, |
210 registry->GetExtensionById( | 199 registry->GetExtensionById( |
211 kTestExtensionId, extensions::ExtensionRegistry::EVERYTHING)); | 200 kTestExtensionId, extensions::ExtensionRegistry::EVERYTHING)); |
212 } | 201 } |
213 | 202 |
214 } // namespace apps | 203 } // namespace apps |
OLD | NEW |