Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: ui/app_list/views/search_result_answer_card_view_unittest.cc

Issue 2972243002: Fix app list item indexing bug. (Closed)
Patch Set: oshima's comments. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "ui/app_list/views/search_result_answer_card_view.h" 5 #include "ui/app_list/views/search_result_answer_card_view.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "ui/accessibility/ax_node_data.h" 10 #include "ui/accessibility/ax_node_data.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 result->set_view(result_view_.get()); 54 result->set_view(result_view_.get());
55 result->set_relevance(kRelevance); 55 result->set_relevance(kRelevance);
56 results->Add(std::move(result)); 56 results->Add(std::move(result));
57 57
58 // Adding results will schedule Update(). 58 // Adding results will schedule Update().
59 RunPendingMessages(); 59 RunPendingMessages();
60 result_container_view_->OnContainerSelected(false, false); 60 result_container_view_->OnContainerSelected(false, false);
61 } 61 }
62 62
63 int GetOpenResultCountAndReset(int ranking) { 63 int GetOpenResultCountAndReset(int ranking) {
64 EXPECT_GT(view_delegate_.open_search_result_counts().count(ranking), 0u);
64 int result = view_delegate_.open_search_result_counts()[ranking]; 65 int result = view_delegate_.open_search_result_counts()[ranking];
65 view_delegate_.open_search_result_counts().clear(); 66 view_delegate_.open_search_result_counts().clear();
66 return result; 67 return result;
67 } 68 }
68 69
69 void ClearSelectedIndex() { result_container_view_->ClearSelectedIndex(); } 70 void ClearSelectedIndex() { result_container_view_->ClearSelectedIndex(); }
70 71
71 void DeleteResult() { 72 void DeleteResult() {
72 GetResults()->DeleteAt(0); 73 GetResults()->DeleteAt(0);
73 RunPendingMessages(); 74 RunPendingMessages();
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 DeleteResult(); 171 DeleteResult();
171 EXPECT_EQ(0UL, GetResults()->item_count()); 172 EXPECT_EQ(0UL, GetResults()->item_count());
172 EXPECT_EQ(nullptr, result_view()->parent()); 173 EXPECT_EQ(nullptr, result_view()->parent());
173 EXPECT_EQ(0, GetYSize()); 174 EXPECT_EQ(0, GetYSize());
174 ASSERT_FALSE(search_card_view()->visible()); 175 ASSERT_FALSE(search_card_view()->visible());
175 EXPECT_EQ(0, GetContainerScore()); 176 EXPECT_EQ(0, GetContainerScore());
176 } 177 }
177 178
178 } // namespace test 179 } // namespace test
179 } // namespace app_list 180 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/test/app_list_test_view_delegate.h ('k') | ui/app_list/views/search_result_list_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698