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

Unified Diff: ash/shelf/shelf_view_unittest.cc

Issue 2696073002: Merge ShelfItemDelegate::ItemSelected & LauncherItemDelegate::Activate. (Closed)
Patch Set: Cleanup Created 3 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
Index: ash/shelf/shelf_view_unittest.cc
diff --git a/ash/shelf/shelf_view_unittest.cc b/ash/shelf/shelf_view_unittest.cc
index 04aff136026446704bdceb6ef40e3a9b7771fe1a..a3332b3b3e39b8355fdba13784d2c4cce8f7af2b 100644
--- a/ash/shelf/shelf_view_unittest.cc
+++ b/ash/shelf/shelf_view_unittest.cc
@@ -148,8 +148,7 @@ class ShelfItemSelectionTracker : public TestShelfItemDelegate {
// Resets to the initial state.
void Reset() { selected_ = false; }
- void set_item_selected_action(
- ShelfItemDelegate::PerformedAction item_selected_action) {
+ void set_item_selected_action(ShelfAction item_selected_action) {
item_selected_action_ = item_selected_action;
}
@@ -157,8 +156,10 @@ class ShelfItemSelectionTracker : public TestShelfItemDelegate {
bool WasSelected() { return selected_; }
// TestShelfItemDelegate:
- ShelfItemDelegate::PerformedAction ItemSelected(
- const ui::Event& event) override {
+ ShelfAction ItemSelected(ui::EventType event_type,
+ int event_flags,
+ int64_t display_id,
+ ShelfLaunchSource source) override {
selected_ = true;
return item_selected_action_;
}
@@ -167,7 +168,7 @@ class ShelfItemSelectionTracker : public TestShelfItemDelegate {
bool selected_;
// The action returned from ItemSelected(const ui::Event&).
- ShelfItemDelegate::PerformedAction item_selected_action_;
+ ShelfAction item_selected_action_;
DISALLOW_COPY_AND_ASSIGN(ShelfItemSelectionTracker);
};
@@ -1828,8 +1829,7 @@ TEST_F(ShelfViewTest, Launcher_TaskUserActionsRecordedWhenItemSelected) {
ShelfID browser_shelf_id = model_->items()[browser_index_].id;
ShelfItemSelectionTracker* selection_tracker = new ShelfItemSelectionTracker;
- selection_tracker->set_item_selected_action(
- ShelfItemDelegate::kNewWindowCreated);
+ selection_tracker->set_item_selected_action(kNewWindowCreated);
model_->SetShelfItemDelegate(
browser_shelf_id, std::unique_ptr<ShelfItemDelegate>(selection_tracker));
@@ -1848,12 +1848,10 @@ TEST_F(ShelfViewTest,
model_->SetShelfItemDelegate(
browser_shelf_id, std::unique_ptr<ShelfItemDelegate>(selection_tracker));
- selection_tracker->set_item_selected_action(
- ShelfItemDelegate::kExistingWindowMinimized);
+ selection_tracker->set_item_selected_action(kExistingWindowMinimized);
SimulateClick(browser_index_);
- selection_tracker->set_item_selected_action(
- ShelfItemDelegate::kExistingWindowActivated);
+ selection_tracker->set_item_selected_action(kExistingWindowActivated);
SimulateClick(browser_index_);
histogram_tester.ExpectTotalCount(

Powered by Google App Engine
This is Rietveld 408576698