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

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

Issue 2952763002: SearchBoxView now enables/disables cursor based on user interaction. (Closed)
Patch Set: Addressed Comments, refactored. 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_box_view.h" 5 #include "ui/app_list/views/search_box_view.h"
6 6
7 #include <cctype> 7 #include <cctype>
8 #include <map> 8 #include <map>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 class SearchBoxViewTest : public views::test::WidgetTest, 45 class SearchBoxViewTest : public views::test::WidgetTest,
46 public SearchBoxViewDelegate { 46 public SearchBoxViewDelegate {
47 public: 47 public:
48 SearchBoxViewTest() : query_changed_count_(0) {} 48 SearchBoxViewTest() : query_changed_count_(0) {}
49 ~SearchBoxViewTest() override {} 49 ~SearchBoxViewTest() override {}
50 50
51 // Overridden from testing::Test: 51 // Overridden from testing::Test:
52 void SetUp() override { 52 void SetUp() override {
53 views::test::WidgetTest::SetUp(); 53 views::test::WidgetTest::SetUp();
54 widget_ = CreateTopLevelPlatformWidget(); 54 widget_ = CreateTopLevelPlatformWidget();
55 view_ = new SearchBoxView(this, &view_delegate_); 55 view_ = new SearchBoxView(this, &view_delegate_, app_list_view_);
56 counter_view_ = new KeyPressCounterView(); 56 counter_view_ = new KeyPressCounterView();
57 widget_->GetContentsView()->AddChildView(view_); 57 widget_->GetContentsView()->AddChildView(view_);
58 widget_->GetContentsView()->AddChildView(counter_view_); 58 widget_->GetContentsView()->AddChildView(counter_view_);
59 view_->set_contents_view(counter_view_); 59 view_->set_contents_view(counter_view_);
60 } 60 }
61 61
62 void TearDown() override { 62 void TearDown() override {
63 widget_->CloseNow(); 63 widget_->CloseNow();
64 views::test::WidgetTest::TearDown(); 64 views::test::WidgetTest::TearDown();
65 } 65 }
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 ResetAutoLaunchTimeout(); 159 ResetAutoLaunchTimeout();
160 160
161 // Clearing search box also cancels. 161 // Clearing search box also cancels.
162 SetLongAutoLaunchTimeout(); 162 SetLongAutoLaunchTimeout();
163 view()->ClearSearch(); 163 view()->ClearSearch();
164 EXPECT_EQ(base::TimeDelta(), GetAutoLaunchTimeout()); 164 EXPECT_EQ(base::TimeDelta(), GetAutoLaunchTimeout());
165 } 165 }
166 166
167 } // namespace test 167 } // namespace test
168 } // namespace app_list 168 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698