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 #include "base/command_line.h" |
5 #include "base/path_service.h" | 6 #include "base/path_service.h" |
6 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
7 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/extension_browsertest.h" | 9 #include "chrome/browser/extensions/extension_browsertest.h" |
9 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" | 11 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
11 #include "chrome/browser/ui/app_list/app_list_service.h" | 12 #include "chrome/browser/ui/app_list/app_list_service.h" |
12 #include "chrome/browser/ui/app_list/test/chrome_app_list_test_support.h" | 13 #include "chrome/browser/ui/app_list/test/chrome_app_list_test_support.h" |
13 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
14 #include "chrome/browser/ui/browser_finder.h" | 15 #include "chrome/browser/ui/browser_finder.h" |
15 #include "chrome/browser/ui/host_desktop.h" | 16 #include "chrome/browser/ui/host_desktop.h" |
16 #include "chrome/common/chrome_paths.h" | 17 #include "chrome/common/chrome_paths.h" |
17 #include "chrome/test/base/in_process_browser_test.h" | 18 #include "chrome/test/base/in_process_browser_test.h" |
18 #include "ui/app_list/app_list_model.h" | 19 #include "ui/app_list/app_list_model.h" |
| 20 #include "ui/app_list/app_list_switches.h" |
19 #include "ui/app_list/search_box_model.h" | 21 #include "ui/app_list/search_box_model.h" |
20 #include "ui/app_list/search_result.h" | 22 #include "ui/app_list/search_result.h" |
21 #include "ui/app_list/search_result_observer.h" | 23 #include "ui/app_list/search_result_observer.h" |
22 #include "ui/base/models/list_model_observer.h" | 24 #include "ui/base/models/list_model_observer.h" |
23 | 25 |
24 // Browser Test for AppListController that runs on all platforms supporting | 26 // Browser Test for AppListController that runs on all platforms supporting |
25 // app_list. | 27 // app_list. |
26 typedef InProcessBrowserTest AppListControllerBrowserTest; | 28 typedef InProcessBrowserTest AppListControllerBrowserTest; |
27 | 29 |
28 // Test the CreateNewWindow function of the controller delegate. | 30 // Test the CreateNewWindow function of the controller delegate. |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 169 |
168 // Flaky on Mac. https://crbug.com/415264 | 170 // Flaky on Mac. https://crbug.com/415264 |
169 #if defined(OS_MACOSX) | 171 #if defined(OS_MACOSX) |
170 #define MAYBE_UninstallSearchResult DISABLED_UninstallSearchResult | 172 #define MAYBE_UninstallSearchResult DISABLED_UninstallSearchResult |
171 #else | 173 #else |
172 #define MAYBE_UninstallSearchResult UninstallSearchResult | 174 #define MAYBE_UninstallSearchResult UninstallSearchResult |
173 #endif | 175 #endif |
174 // Test showing search results, and uninstalling one of them while displayed. | 176 // Test showing search results, and uninstalling one of them while displayed. |
175 IN_PROC_BROWSER_TEST_F(AppListControllerSearchResultsBrowserTest, | 177 IN_PROC_BROWSER_TEST_F(AppListControllerSearchResultsBrowserTest, |
176 MAYBE_UninstallSearchResult) { | 178 MAYBE_UninstallSearchResult) { |
| 179 // TODO(calamity): This test fails in the experimental app list |
| 180 // (http://crbug.com/438119). For now, force the test to run in the classic |
| 181 // app list. |
| 182 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 183 app_list::switches::kDisableExperimentalAppList); |
| 184 |
177 base::FilePath test_extension_path; | 185 base::FilePath test_extension_path; |
178 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_extension_path)); | 186 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_extension_path)); |
179 test_extension_path = test_extension_path.AppendASCII("extensions") | 187 test_extension_path = test_extension_path.AppendASCII("extensions") |
180 .AppendASCII("platform_apps") | 188 .AppendASCII("platform_apps") |
181 .AppendASCII("minimal"); | 189 .AppendASCII("minimal"); |
182 const extensions::Extension* extension = | 190 const extensions::Extension* extension = |
183 InstallExtension(test_extension_path, | 191 InstallExtension(test_extension_path, |
184 1 /* expected_change: new install */); | 192 1 /* expected_change: new install */); |
185 ASSERT_TRUE(extension); | 193 ASSERT_TRUE(extension); |
186 | 194 |
(...skipping 19 matching lines...) Expand all Loading... |
206 EXPECT_EQ(1, item_uninstall_count_); | 214 EXPECT_EQ(1, item_uninstall_count_); |
207 | 215 |
208 // Results should not be immediately refreshed. When they are, the item should | 216 // Results should not be immediately refreshed. When they are, the item should |
209 // be removed from the model. | 217 // be removed from the model. |
210 EXPECT_TRUE(observed_result_); | 218 EXPECT_TRUE(observed_result_); |
211 base::RunLoop().RunUntilIdle(); | 219 base::RunLoop().RunUntilIdle(); |
212 EXPECT_FALSE(observed_result_); | 220 EXPECT_FALSE(observed_result_); |
213 StopWatchingResults(); | 221 StopWatchingResults(); |
214 service->DismissAppList(); | 222 service->DismissAppList(); |
215 } | 223 } |
OLD | NEW |