| 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 #import "base/mac/scoped_nsobject.h" | 5 #import "base/mac/scoped_nsobject.h" |
| 6 #include "base/macros.h" | 6 #include "base/macros.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #import "testing/gtest_mac.h" | 8 #import "testing/gtest_mac.h" |
| 9 #include "ui/app_list/app_list_view_delegate.h" | 9 #include "ui/app_list/app_list_view_delegate.h" |
| 10 #import "ui/app_list/cocoa/app_list_view_controller.h" | 10 #import "ui/app_list/cocoa/app_list_view_controller.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 protected: | 22 protected: |
| 23 void TearDown() override; | 23 void TearDown() override; |
| 24 | 24 |
| 25 base::scoped_nsobject<AppListWindowController> controller_; | 25 base::scoped_nsobject<AppListWindowController> controller_; |
| 26 | 26 |
| 27 app_list::test::AppListTestViewDelegate* delegate() { | 27 app_list::test::AppListTestViewDelegate* delegate() { |
| 28 return delegate_.get(); | 28 return delegate_.get(); |
| 29 } | 29 } |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 scoped_ptr<app_list::test::AppListTestViewDelegate> delegate_; | 32 std::unique_ptr<app_list::test::AppListTestViewDelegate> delegate_; |
| 33 | 33 |
| 34 DISALLOW_COPY_AND_ASSIGN(AppListWindowControllerTest); | 34 DISALLOW_COPY_AND_ASSIGN(AppListWindowControllerTest); |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 AppListWindowControllerTest::AppListWindowControllerTest() | 37 AppListWindowControllerTest::AppListWindowControllerTest() |
| 38 : delegate_(new app_list::test::AppListTestViewDelegate) { | 38 : delegate_(new app_list::test::AppListTestViewDelegate) { |
| 39 Init(); | 39 Init(); |
| 40 controller_.reset([[AppListWindowController alloc] init]); | 40 controller_.reset([[AppListWindowController alloc] init]); |
| 41 [[controller_ appListViewController] setDelegate:delegate()]; | 41 [[controller_ appListViewController] setDelegate:delegate()]; |
| 42 } | 42 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 EXPECT_TRUE([view_controller showingSearchResults]); | 86 EXPECT_TRUE([view_controller showingSearchResults]); |
| 87 | 87 |
| 88 EXPECT_EQ(0, delegate()->open_search_result_count()); | 88 EXPECT_EQ(0, delegate()->open_search_result_count()); |
| 89 [view_controller openResult:nil]; | 89 [view_controller openResult:nil]; |
| 90 EXPECT_EQ(1, delegate()->open_search_result_count()); | 90 EXPECT_EQ(1, delegate()->open_search_result_count()); |
| 91 | 91 |
| 92 EXPECT_TRUE([view_controller showingSearchResults]); | 92 EXPECT_TRUE([view_controller showingSearchResults]); |
| 93 [[controller_ window] close]; // Hide. | 93 [[controller_ window] close]; // Hide. |
| 94 EXPECT_FALSE([view_controller showingSearchResults]); | 94 EXPECT_FALSE([view_controller showingSearchResults]); |
| 95 } | 95 } |
| OLD | NEW |