| 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/path_service.h" | 5 #include "base/path_service.h" |
| 6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/extensions/extension_browsertest.h" | 8 #include "chrome/browser/extensions/extension_browsertest.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" | 10 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 private: | 116 private: |
| 117 base::string16 item_to_observe_; | 117 base::string16 item_to_observe_; |
| 118 app_list::AppListModel::SearchResults* observed_results_list_; | 118 app_list::AppListModel::SearchResults* observed_results_list_; |
| 119 | 119 |
| 120 DISALLOW_COPY_AND_ASSIGN(AppListControllerSearchResultsBrowserTest); | 120 DISALLOW_COPY_AND_ASSIGN(AppListControllerSearchResultsBrowserTest); |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 // Test showing search results, and uninstalling one of them while displayed. | 123 // Test showing search results, and uninstalling one of them while displayed. |
| 124 IN_PROC_BROWSER_TEST_F(AppListControllerSearchResultsBrowserTest, | 124 IN_PROC_BROWSER_TEST_F(AppListControllerSearchResultsBrowserTest, |
| 125 UninstallSearchResult) { | 125 UninstallSearchResult) { |
| 126 test::SigninProfile(browser()->profile()); | |
| 127 base::FilePath test_extension_path; | 126 base::FilePath test_extension_path; |
| 128 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_extension_path)); | 127 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_extension_path)); |
| 129 test_extension_path = test_extension_path.AppendASCII("extensions") | 128 test_extension_path = test_extension_path.AppendASCII("extensions") |
| 130 .AppendASCII("platform_apps") | 129 .AppendASCII("platform_apps") |
| 131 .AppendASCII("minimal"); | 130 .AppendASCII("minimal"); |
| 132 const extensions::Extension* extension = | 131 const extensions::Extension* extension = |
| 133 InstallExtension(test_extension_path, | 132 InstallExtension(test_extension_path, |
| 134 1 /* expected_change: new install */); | 133 1 /* expected_change: new install */); |
| 135 ASSERT_TRUE(extension); | 134 ASSERT_TRUE(extension); |
| 136 | 135 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 156 EXPECT_EQ(1, item_uninstall_count_); | 155 EXPECT_EQ(1, item_uninstall_count_); |
| 157 | 156 |
| 158 // Results should not be immediately refreshed. When they are, the item should | 157 // Results should not be immediately refreshed. When they are, the item should |
| 159 // be removed from the model. | 158 // be removed from the model. |
| 160 EXPECT_TRUE(observed_result_); | 159 EXPECT_TRUE(observed_result_); |
| 161 base::RunLoop().RunUntilIdle(); | 160 base::RunLoop().RunUntilIdle(); |
| 162 EXPECT_FALSE(observed_result_); | 161 EXPECT_FALSE(observed_result_); |
| 163 StopWatchingResults(); | 162 StopWatchingResults(); |
| 164 service->DismissAppList(); | 163 service->DismissAppList(); |
| 165 } | 164 } |
| OLD | NEW |