OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/apps_grid_view.h" | 5 #include "ui/app_list/views/apps_grid_view.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
16 #include "base/run_loop.h" | |
16 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
17 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
18 #include "build/build_config.h" | 19 #include "build/build_config.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
20 #include "ui/app_list/app_list_constants.h" | 21 #include "ui/app_list/app_list_constants.h" |
21 #include "ui/app_list/app_list_folder_item.h" | 22 #include "ui/app_list/app_list_folder_item.h" |
22 #include "ui/app_list/app_list_item.h" | 23 #include "ui/app_list/app_list_item.h" |
23 #include "ui/app_list/app_list_model.h" | 24 #include "ui/app_list/app_list_model.h" |
24 #include "ui/app_list/app_list_switches.h" | 25 #include "ui/app_list/app_list_switches.h" |
25 #include "ui/app_list/pagination_model.h" | 26 #include "ui/app_list/pagination_model.h" |
(...skipping 20 matching lines...) Expand all Loading... | |
46 : ui_loop_(ui_loop), model_(model), wait_(false) { | 47 : ui_loop_(ui_loop), model_(model), wait_(false) { |
47 model_->AddObserver(this); | 48 model_->AddObserver(this); |
48 } | 49 } |
49 | 50 |
50 ~PageFlipWaiter() override { model_->RemoveObserver(this); } | 51 ~PageFlipWaiter() override { model_->RemoveObserver(this); } |
51 | 52 |
52 void Wait() { | 53 void Wait() { |
53 DCHECK(!wait_); | 54 DCHECK(!wait_); |
54 wait_ = true; | 55 wait_ = true; |
55 | 56 |
56 ui_loop_->Run(); | 57 base::RunLoop().Run(); |
sadrul
2016/08/08 20:42:42
I think this should remain ui_loop_->Run(), or ui_
fdoray
2016/08/23 15:30:27
Done.
| |
57 wait_ = false; | 58 wait_ = false; |
58 } | 59 } |
59 | 60 |
60 void Reset() { selected_pages_.clear(); } | 61 void Reset() { selected_pages_.clear(); } |
61 | 62 |
62 const std::string& selected_pages() const { return selected_pages_; } | 63 const std::string& selected_pages() const { return selected_pages_; } |
63 | 64 |
64 private: | 65 private: |
65 // PaginationModelObserver overrides: | 66 // PaginationModelObserver overrides: |
66 void TotalPagesChanged() override {} | 67 void TotalPagesChanged() override {} |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
767 AppListItemView* item_view = GetItemViewAt(0); | 768 AppListItemView* item_view = GetItemViewAt(0); |
768 ASSERT_TRUE(item_view); | 769 ASSERT_TRUE(item_view); |
769 const views::Label* title_label = item_view->title(); | 770 const views::Label* title_label = item_view->title(); |
770 EXPECT_FALSE(title_label->GetTooltipText( | 771 EXPECT_FALSE(title_label->GetTooltipText( |
771 title_label->bounds().CenterPoint(), &actual_tooltip)); | 772 title_label->bounds().CenterPoint(), &actual_tooltip)); |
772 EXPECT_EQ(title, base::UTF16ToUTF8(title_label->text())); | 773 EXPECT_EQ(title, base::UTF16ToUTF8(title_label->text())); |
773 } | 774 } |
774 | 775 |
775 } // namespace test | 776 } // namespace test |
776 } // namespace app_list | 777 } // namespace app_list |
OLD | NEW |