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

Unified Diff: ui/app_list/views/search_result_list_view_unittest.cc

Issue 935523002: App launcher: Spoken feedback reads out details of search results. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added NON_EXPORTED_BASE to fix Windows compile. Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/app_list/views/search_result_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/search_result_list_view_unittest.cc
diff --git a/ui/app_list/views/search_result_list_view_unittest.cc b/ui/app_list/views/search_result_list_view_unittest.cc
index 475ad00fc99b1b1ce6c835cf72b46dde5cfcd5d3..75cb4283de7de2cb50d222c8dd4a400e69cac37c 100644
--- a/ui/app_list/views/search_result_list_view_unittest.cc
+++ b/ui/app_list/views/search_result_list_view_unittest.cc
@@ -6,6 +6,7 @@
#include <map>
+#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "ui/app_list/app_list_model.h"
#include "ui/app_list/test/app_list_test_view_delegate.h"
@@ -38,6 +39,10 @@ class SearchResultListViewTest : public views::ViewsTestBase,
protected:
SearchResultListView* view() { return view_.get(); }
+ SearchResultView* GetResultViewAt(int index) {
+ return view_->GetResultViewAt(index);
+ }
+
AppListModel::SearchResults* GetResults() {
return view_delegate_.GetModel()->results();
}
@@ -56,6 +61,9 @@ class SearchResultListViewTest : public views::ViewsTestBase,
for (int i = 0; i < kDefaultSearchItems; ++i) {
TestSearchResult* result = new TestSearchResult();
result->set_display_type(SearchResult::DISPLAY_LIST);
+ result->set_title(base::UTF8ToUTF16(base::StringPrintf("Result %d", i)));
+ if (i < 2)
+ result->set_details(base::ASCIIToUTF16("Detail"));
results->Add(result);
}
@@ -103,12 +111,12 @@ class SearchResultListViewTest : public views::ViewsTestBase,
AppListModel::SearchResults* results = GetResults();
for (size_t i = 0; i < results->item_count(); ++i) {
- EXPECT_EQ(results->GetItemAt(i), view_->GetResultViewAt(i)->result());
+ EXPECT_EQ(results->GetItemAt(i), GetResultViewAt(i)->result());
}
}
ProgressBarView* GetProgressBarAt(size_t index) {
- return view()->GetResultViewAt(index)->progress_bar_;
+ return GetResultViewAt(index)->progress_bar_;
}
private:
@@ -194,6 +202,19 @@ TEST_F(SearchResultListViewTest, CancelAutoLaunch) {
EXPECT_TRUE(IsAutoLaunching());
}
+TEST_F(SearchResultListViewTest, SpokenFeedback) {
+ SetUpSearchResults();
+
+ // Result 0 has a detail text. Expect that the detail is appended to the
+ // accessibility name.
+ EXPECT_EQ(base::ASCIIToUTF16("Result 0, Detail"),
+ GetResultViewAt(0)->ComputeAccessibleName());
+
+ // Result 2 has no detail text.
+ EXPECT_EQ(base::ASCIIToUTF16("Result 2"),
+ GetResultViewAt(2)->ComputeAccessibleName());
+}
+
TEST_F(SearchResultListViewTest, ModelObservers) {
SetUpSearchResults();
ExpectConsistent();
« no previous file with comments | « no previous file | ui/app_list/views/search_result_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698