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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/stringprintf.h" | 6 #include "base/stringprintf.h" |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/extension_host.h" | 8 #include "chrome/browser/extensions/extension_host.h" |
9 #include "chrome/browser/extensions/extension_install_ui.h" | 9 #include "chrome/browser/extensions/extension_install_ui.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 RunTest("runTest2"); | 139 RunTest("runTest2"); |
140 } | 140 } |
141 | 141 |
142 IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerTest, FindLink) { | 142 IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerTest, FindLink) { |
143 ui_test_utils::NavigateToURL( | 143 ui_test_utils::NavigateToURL( |
144 browser(), GenerateTestServerUrl(kAppDomain, "find_link.html")); | 144 browser(), GenerateTestServerUrl(kAppDomain, "find_link.html")); |
145 | 145 |
146 RunTest("runTest"); | 146 RunTest("runTest"); |
147 } | 147 } |
148 | 148 |
149 IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerTest, ArgumentValidation) { | 149 // Crashes at random intervals on MacOS: http://crbug.com/95713. |
| 150 #if defined(OS_MACOSX) |
| 151 #define Maybe_ArgumentValidation DISABLED_ArgumentValidation |
| 152 #else |
| 153 #define Maybe_ArgumentValidation ArgumentValidation |
| 154 #endif |
| 155 IN_PROC_BROWSER_TEST_F(WebstoreStartupInstallerTest, Maybe_ArgumentValidation) { |
150 CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 156 CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
151 switches::kAppsGalleryInstallAutoConfirmForTests, "cancel"); | 157 switches::kAppsGalleryInstallAutoConfirmForTests, "cancel"); |
152 | 158 |
153 // Each of these tests has to run separately, since one page/tab can | 159 // Each of these tests has to run separately, since one page/tab can |
154 // only have one in-progress install request. These tests don't all pass | 160 // only have one in-progress install request. These tests don't all pass |
155 // callbacks to install, so they have no way to wait for the installation | 161 // callbacks to install, so they have no way to wait for the installation |
156 // to complete before starting the next test. | 162 // to complete before starting the next test. |
157 bool is_finished = false; | 163 bool is_finished = false; |
158 for (int i = 0; !is_finished; ++i) { | 164 for (int i = 0; !is_finished; ++i) { |
159 ui_test_utils::NavigateToURL( | 165 ui_test_utils::NavigateToURL( |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 switches::kLimitedInstallFromWebstore, "2"); | 368 switches::kLimitedInstallFromWebstore, "2"); |
363 command_line->AppendSwitchASCII( | 369 command_line->AppendSwitchASCII( |
364 switches::kAppsGalleryInstallAutoConfirmForTests, "cancel"); | 370 switches::kAppsGalleryInstallAutoConfirmForTests, "cancel"); |
365 extensions::StartupHelper helper; | 371 extensions::StartupHelper helper; |
366 helper.LimitedInstallFromWebstore(*command_line, browser()->profile(), | 372 helper.LimitedInstallFromWebstore(*command_line, browser()->profile(), |
367 MessageLoop::QuitWhenIdleClosure()); | 373 MessageLoop::QuitWhenIdleClosure()); |
368 MessageLoop::current()->Run(); | 374 MessageLoop::current()->Run(); |
369 EXPECT_FALSE(saw_install()); | 375 EXPECT_FALSE(saw_install()); |
370 EXPECT_EQ(0, browser_open_count()); | 376 EXPECT_EQ(0, browser_open_count()); |
371 } | 377 } |
OLD | NEW |