| 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 "chrome/browser/ui/app_list/search/webstore/webstore_provider.h" | 5 #include "chrome/browser/ui/app_list/search/webstore/webstore_provider.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 ~WebstoreProviderTest() override {} | 164 ~WebstoreProviderTest() override {} |
| 165 | 165 |
| 166 // InProcessBrowserTest overrides: | 166 // InProcessBrowserTest overrides: |
| 167 void SetUpOnMainThread() override { | 167 void SetUpOnMainThread() override { |
| 168 embedded_test_server()->RegisterRequestHandler( | 168 embedded_test_server()->RegisterRequestHandler( |
| 169 base::Bind(&WebstoreProviderTest::HandleRequest, | 169 base::Bind(&WebstoreProviderTest::HandleRequest, |
| 170 base::Unretained(this))); | 170 base::Unretained(this))); |
| 171 ASSERT_TRUE(embedded_test_server()->Start()); | 171 ASSERT_TRUE(embedded_test_server()->Start()); |
| 172 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 172 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
| 173 ::switches::kAppsGalleryURL, embedded_test_server()->base_url().spec()); | 173 ::switches::kAppsGalleryURL, embedded_test_server()->base_url().spec()); |
| 174 base::CommandLine::ForCurrentProcess()->AppendSwitch( | |
| 175 switches::kEnableExperimentalAppList); | |
| 176 | 174 |
| 177 mock_controller_.reset(new AppListControllerDelegateForTest); | 175 mock_controller_.reset(new AppListControllerDelegateForTest); |
| 178 webstore_provider_.reset(new WebstoreProvider( | 176 webstore_provider_.reset(new WebstoreProvider( |
| 179 ProfileManager::GetActiveUserProfile(), mock_controller_.get())); | 177 ProfileManager::GetActiveUserProfile(), mock_controller_.get())); |
| 180 webstore_provider_->set_webstore_search_fetched_callback( | 178 webstore_provider_->set_webstore_search_fetched_callback( |
| 181 base::Bind(&WebstoreProviderTest::OnSearchResultsFetched, | 179 base::Bind(&WebstoreProviderTest::OnSearchResultsFetched, |
| 182 base::Unretained(this))); | 180 base::Unretained(this))); |
| 183 // TODO(mukai): add test cases for throttling. | 181 // TODO(mukai): add test cases for throttling. |
| 184 webstore_provider_->set_use_throttling(false); | 182 webstore_provider_->set_use_throttling(false); |
| 185 } | 183 } |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 RunQueryAndVerify("fun", "", kParsedOneResult, 1); | 382 RunQueryAndVerify("fun", "", kParsedOneResult, 1); |
| 385 } | 383 } |
| 386 | 384 |
| 387 IN_PROC_BROWSER_TEST_F(WebstoreProviderTest, IgnoreInstalledApps) { | 385 IN_PROC_BROWSER_TEST_F(WebstoreProviderTest, IgnoreInstalledApps) { |
| 388 mock_controller()->MockInstallApp("app1_id"); | 386 mock_controller()->MockInstallApp("app1_id"); |
| 389 RunQueryAndVerify("fun", kOneResult, kParsedOneStoreSearchResult, 1); | 387 RunQueryAndVerify("fun", kOneResult, kParsedOneStoreSearchResult, 1); |
| 390 } | 388 } |
| 391 | 389 |
| 392 } // namespace test | 390 } // namespace test |
| 393 } // namespace app_list | 391 } // namespace app_list |
| OLD | NEW |